private forum mentions
This commit is contained in:
parent
cadef5924f
commit
e864679942
@ -542,7 +542,7 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
// Look for tags and linkify them
|
// Look for tags and linkify them
|
||||||
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
$results = linkify_tags($a, $body, ($uid) ? $uid : $profile_uid);
|
||||||
|
|
||||||
if($results) {
|
if($results) {
|
||||||
|
|
||||||
// Set permissions based on tag replacements
|
// Set permissions based on tag replacements
|
||||||
|
@ -2577,6 +2577,9 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d
|
|||||||
|
|
||||||
// The @! tag will alter permissions
|
// The @! tag will alter permissions
|
||||||
$exclusive = (((! $grouptag) && (strpos($tag,'!') === 1) && (! $diaspora)) ? true : false);
|
$exclusive = (((! $grouptag) && (strpos($tag,'!') === 1) && (! $diaspora)) ? true : false);
|
||||||
|
if(($grouptag) && (strpos($tag,'!!') === 0)) {
|
||||||
|
$exclusive = true;
|
||||||
|
}
|
||||||
|
|
||||||
//is it already replaced?
|
//is it already replaced?
|
||||||
if(strpos($tag,'[zrl='))
|
if(strpos($tag,'[zrl='))
|
||||||
@ -2749,8 +2752,8 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d
|
|||||||
$profile = str_replace(',','%2c',$profile);
|
$profile = str_replace(',','%2c',$profile);
|
||||||
$url = $profile;
|
$url = $profile;
|
||||||
if($grouptag) {
|
if($grouptag) {
|
||||||
$newtag = '!' . '[zrl=' . $profile . ']' . $newname . '[/zrl]';
|
$newtag = '!' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . '[/zrl]';
|
||||||
$body = str_replace('!' . $name, $newtag, $body);
|
$body = str_replace('!' . (($exclusive) ? '!' : '') . $name, $newtag, $body);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . (($forum && ! $trailing_plus_name) ? '+' : '') . '[/zrl]';
|
$newtag = '@' . (($exclusive) ? '!' : '') . '[zrl=' . $profile . ']' . $newname . (($forum && ! $trailing_plus_name) ? '+' : '') . '[/zrl]';
|
||||||
@ -2800,6 +2803,7 @@ function linkify_tags($a, &$body, $uid, $diaspora = false) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
$success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : App::$profile_uid , $tag, $diaspora);
|
$success = handle_tag($a, $body, $access_tag, $str_tags, ($uid) ? $uid : App::$profile_uid , $tag, $diaspora);
|
||||||
|
|
||||||
$results[] = array('success' => $success, 'access_tag' => $access_tag);
|
$results[] = array('success' => $success, 'access_tag' => $access_tag);
|
||||||
if($success['replaced']) $tagged[] = $tag;
|
if($success['replaced']) $tagged[] = $tag;
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,7 @@ function string2bb(element) {
|
|||||||
|
|
||||||
// Autocomplete forums
|
// Autocomplete forums
|
||||||
forums = {
|
forums = {
|
||||||
match: /(^|\s)(\!)([^ \n]+)$/,
|
match: /(^|\s)(\!\!*)([^ \n]+)$/,
|
||||||
index: 3,
|
index: 3,
|
||||||
search: function(term, callback) { contact_search(term, callback, backend_url, 'f', extra_channels, spinelement=false); },
|
search: function(term, callback) { contact_search(term, callback, backend_url, 'f', extra_channels, spinelement=false); },
|
||||||
replace: editor_replace,
|
replace: editor_replace,
|
||||||
|
Reference in New Issue
Block a user