aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-04-12 00:56:04 -0700
committerfriendica <info@friendica.com>2014-04-12 00:56:04 -0700
commit71929c6caa1d4fc07c6b932c5f7797ff7000d9a4 (patch)
tree0cf9bb99c837a912545dac5c1ce149570136a332 /mod/item.php
parentaa5054d5ba9fa1bcae06b39b858a56e53ed08738 (diff)
downloadvolse-hubzilla-71929c6caa1d4fc07c6b932c5f7797ff7000d9a4.tar.gz
volse-hubzilla-71929c6caa1d4fc07c6b932c5f7797ff7000d9a4.tar.bz2
volse-hubzilla-71929c6caa1d4fc07c6b932c5f7797ff7000d9a4.zip
add forum mode to tag handling
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/mod/item.php b/mod/item.php
index 7630cb031..00ea4c61d 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -956,6 +956,13 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
// is it some generated name?
+ $forum = false;
+
+ if(substr($newname,-1,1)) === '+') {
+ $forum = true;
+ $newname = substr($newname,0,-1);
+ }
+
if(strrpos($newname,'+')) {
//get the id
$tagcid = intval(substr($newname,strrpos($newname,'+') + 1));
@@ -1024,7 +1031,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
}
$channel = get_app()->get_channel();
if($channel) {
- $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . z_root() . '/channel/' . $channel['channel_address'] . ']' . $newname . '[/zrl]';
+ $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . z_root() . '/channel/' . $channel['channel_address'] . ']' . $newname . '[/zrl]';
$body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body);
}
}
@@ -1037,7 +1044,7 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag) {
//create profile link
$profile = str_replace(',','%2c',$profile);
$url = $profile;
- $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]';
+ $newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . (($forum) ? '+' : '') . '[/zrl]';
$body = str_replace('@' . (($exclusive) ? '!' : '') . $name, $newtag, $body);
//append tag to str_tags
if(! stristr($str_tags,$newtag)) {