Utility functions for people tags

This commit is contained in:
Shashi Gowda 2011-03-06 23:33:39 +05:30
parent 1b1a427237
commit 4b8ee81ca9
3 changed files with 17 additions and 9 deletions

View File

@ -269,6 +269,11 @@ $default =
'group' =>
array('maxaliases' => 3,
'desclimit' => null),
'peopletag' =>
array('maxtags' => 100, // maximum number of tags a user can create.
'maxpeople' => 500, // maximum no. of people with the same tag by the same user
'allow_tagging' => array('all' => true), // equivalent to array('local' => true, 'remote' => true)
'desclimit' => null),
'oohembed' => array('endpoint' => 'http://oohembed.com/oohembed/'),
'search' =>
array('type' => 'fulltext'),

View File

@ -45,6 +45,7 @@ define('NOTICE_INBOX_SOURCE_SUB', 1);
define('NOTICE_INBOX_SOURCE_GROUP', 2);
define('NOTICE_INBOX_SOURCE_REPLY', 3);
define('NOTICE_INBOX_SOURCE_FORWARD', 4);
define('NOTICE_INBOX_SOURCE_PROFILE_TAG', 5);
define('NOTICE_INBOX_SOURCE_GATEWAY', -1);
# append our extlib dir as the last-resort place to find libs

View File

@ -753,17 +753,19 @@ function common_find_mentions($text, $notice)
foreach ($hmatches[1] as $hmatch) {
$tag = common_canonical_tag($hmatch[0]);
$plist = Profile_list::getByTaggerAndTag($sender->id, $tag);
if (!empty($plist) && !$plist->private) {
$tagged = $sender->getTaggedSubscribers($tag);
$tagged = Profile_tag::getTagged($sender->id, $tag);
$url = common_local_url('showprofiletag',
array('tagger' => $sender->nickname,
'tag' => $tag));
$url = common_local_url('subscriptions',
array('nickname' => $sender->nickname,
'tag' => $tag));
$mentions[] = array('mentioned' => $tagged,
'text' => $hmatch[0],
'position' => $hmatch[1],
'url' => $url);
$mentions[] = array('mentioned' => $tagged,
'text' => $hmatch[0],
'position' => $hmatch[1],
'url' => $url);
}
}
Event::handle('EndFindMentions', array($sender, $text, &$mentions));