diff options
author | redmatrix <git@macgirvin.com> | 2016-05-01 22:45:38 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-01 22:45:38 -0700 |
commit | a10fe5f13e67faa33a72caa33c49c36113213ffe (patch) | |
tree | e48c4e25990516fb6fde181bfe693b29da5cd070 /include | |
parent | bd2f11ed8b0be4fb611c33e85b568048f79b7090 (diff) | |
download | volse-hubzilla-a10fe5f13e67faa33a72caa33c49c36113213ffe.tar.gz volse-hubzilla-a10fe5f13e67faa33a72caa33c49c36113213ffe.tar.bz2 volse-hubzilla-a10fe5f13e67faa33a72caa33c49c36113213ffe.zip |
a couple of bugfixes from earlier checkins and implementation of source tags
Diffstat (limited to 'include')
-rwxr-xr-x | include/items.php | 34 | ||||
-rw-r--r-- | include/text.php | 2 |
2 files changed, 35 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php index 2720dd841..3649ef8c9 100755 --- a/include/items.php +++ b/include/items.php @@ -3400,6 +3400,37 @@ function tgroup_check($uid,$item) { */ function start_delivery_chain($channel, $item, $item_id, $parent) { + $sourced = check_item_source($channel['channel_id'],$item); + + if($sourced) { + $r = q("select * from source where src_channel_id = %d and ( src_xchan = '%s' or src_xchan = '*' ) limit 1", + intval($channel['channel_id']), + dbesc(($item['source_xchan']) ? $item['source_xchan'] : $item['owner_xchan']) + ); + if($r) { + $t = trim($r[0]['src_tag']); + if($t) { + $tags = explode(',',$t); + if($tags) { + foreach($tags as $tt) { + $tt = trim($tt); + if($tt) { + q("insert into term (uid,oid,otype,type,term,url) + values(%d,%d,%d,%d,'%s','%s') ", + intval($channel['channel_id']), + intval($item_id), + intval(TERM_OBJ_POST), + intval(TERM_UNKNOWN), + dbesc($tt), + dbesc(z_root() . '/search?f=&tag=' . urlencode($tt)) + ); + } + } + } + } + } + } + // Change this copy of the post to a forum head message and deliver to all the tgroup members // also reset all the privacy bits to the forum default permissions @@ -3459,6 +3490,9 @@ function start_delivery_chain($channel, $item, $item_id, $parent) { intval($item_id) ); + + + if($r) proc_run('php','include/notifier.php','tgroup',$item_id); else { diff --git a/include/text.php b/include/text.php index cf2f777aa..66a49d4b5 100644 --- a/include/text.php +++ b/include/text.php @@ -122,7 +122,7 @@ function z_input_filter($channel_id,$s,$type = 'text/bbcode') { -function purify_html($s, $allow_position) { +function purify_html($s, $allow_position = false) { require_once('library/HTMLPurifier.auto.php'); require_once('include/html2bbcode.php'); |