Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: functions_online.php 5498 2011-07-18 08:05:00Z Tomm $
| * $Id$
|
*/
|
*/
|
$uid_list = $aid_list = $pid_list = $tid_list = $fid_list = $eid_list = array();
| $uid_list = $aid_list = $pid_list = $tid_list = $fid_list = $ann_list = $eid_list = array();
|
/** * Fetch a users activity and any corresponding details from their location.
| /** * Fetch a users activity and any corresponding details from their location.
|
Zeile 19 | Zeile 19 |
---|
*/ function fetch_wol_activity($location, $nopermission=false) {
|
*/ function fetch_wol_activity($location, $nopermission=false) {
|
global $uid_list, $aid_list, $pid_list, $tid_list, $fid_list, $eid_list, $plugins, $user, $parameters;
| global $uid_list, $aid_list, $pid_list, $tid_list, $fid_list, $ann_list, $eid_list, $plugins, $user, $parameters;
|
$user_activity = array();
| $user_activity = array();
|
Zeile 51 | Zeile 51 |
---|
switch($filename) { case "announcements":
|
switch($filename) { case "announcements":
|
if(is_numeric($parameters['fid']))
| if(is_numeric($parameters['aid']))
|
{
|
{
|
$fid_list[] = $parameters['fid'];
| $ann_list[] = $parameters['aid'];
|
} $user_activity['activity'] = "announcements";
|
} $user_activity['activity'] = "announcements";
|
$user_activity['fid'] = $parameters['fid'];
| $user_activity['ann'] = $parameters['aid'];
|
break; case "attachment": if(is_numeric($parameters['aid']))
| break; case "attachment": if(is_numeric($parameters['aid']))
|
Zeile 312 | Zeile 312 |
---|
$user_activity['activity'] = "report"; break; case "reputation":
|
$user_activity['activity'] = "report"; break; case "reputation":
|
$user_activity['activity'] = "reputation";
| if(is_numeric($parameters['uid'])) { $uid_list[] = $parameters['uid']; $user_activity['uid'] = $parameters['uid']; }
if($parameters['action'] == "add") { $user_activity['activity'] = "reputation"; } else { $user_activity['activity'] = "reputation_report"; }
|
break; case "search": $user_activity['activity'] = "search";
| break; case "search": $user_activity['activity'] = "search";
|
Zeile 437 | Zeile 450 |
---|
// Expects $location to be passed through already sanitized $user_activity['location'] = $location;
|
// Expects $location to be passed through already sanitized $user_activity['location'] = $location;
|
$plugins->run_hooks_by_ref("fetch_wol_activity_end", $user_activity);
| $user_activity = $plugins->run_hooks("fetch_wol_activity_end", $user_activity);
|
return $user_activity; }
| return $user_activity; }
|
Zeile 450 | Zeile 463 |
---|
*/ function build_friendly_wol_location($user_activity) {
|
*/ function build_friendly_wol_location($user_activity) {
|
global $db, $lang, $uid_list, $aid_list, $pid_list, $tid_list, $fid_list, $eid_list, $plugins, $parser, $mybb; global $threads, $forums, $forums_linkto, $posts, $events, $usernames, $attachments;
| global $db, $lang, $uid_list, $aid_list, $pid_list, $tid_list, $fid_list, $ann_list, $eid_list, $plugins, $parser, $mybb; global $threads, $forums, $forums_linkto, $forum_cache, $posts, $announcements, $events, $usernames, $attachments;
|
// Fetch forum permissions for this user $unviewableforums = get_unviewable_forums();
| // Fetch forum permissions for this user $unviewableforums = get_unviewable_forums();
|
Zeile 480 | Zeile 493 |
---|
{ $attachments[$attachment['aid']] = $attachment['pid']; $pid_list[] = $attachment['pid'];
|
{ $attachments[$attachment['aid']] = $attachment['pid']; $pid_list[] = $attachment['pid'];
|
| } }
// Fetch any announcements if(!is_array($announcements) && count($ann_list) > 0) { $aid_sql = implode(",", $ann_list); $query = $db->simple_select("announcements", "aid,subject", "aid IN ({$aid_sql}) {$fidnot}"); while($announcement = $db->fetch_array($query)) { $announcement_title = htmlspecialchars_uni($parser->parse_badwords($announcement['subject'])); $announcements[$announcement['aid']] = $announcement_title;
|
} }
| } }
|
Zeile 538 | Zeile 563 |
---|
// Fetch any forums if(!is_array($forums) && count($fid_list) > 0) {
|
// Fetch any forums if(!is_array($forums) && count($fid_list) > 0) {
|
$fid_sql = implode(",", $fid_list); $query = $db->simple_select("forums", "fid,name,linkto", "fid IN ($fid_sql) $fidnot"); while($forum = $db->fetch_array($query))
| if($fidnot && $unviewableforums)
|
{
|
{
|
$forums[$forum['fid']] = $forum['name']; $forums_linkto[$forum['fid']] = $forum['linkto'];
| $fidnot = explode(',', $unviewableforums); }
foreach($forum_cache as $fid => $forum) { if(in_array($fid, $fid_list) && (!$fidnot || is_array($fidnot) && !in_array("'{$fid}'", $fidnot))) { $forums[$fid] = $forum['name']; $forums_linkto[$fid] = $forum['linkto']; }
|
} }
// And finaly any events if(!is_array($events) && count($eid_list) > 0)
|
} }
// And finaly any events if(!is_array($events) && count($eid_list) > 0)
|
{
| {
|
$eid_sql = implode(",", $eid_list); $query = $db->simple_select("events", "eid,name", "eid IN ($eid_sql)"); while($event = $db->fetch_array($query))
| $eid_sql = implode(",", $eid_list); $query = $db->simple_select("events", "eid,name", "eid IN ($eid_sql)"); while($event = $db->fetch_array($query))
|
Zeile 563 | Zeile 594 |
---|
{ // announcement.php functions case "announcements":
|
{ // announcement.php functions case "announcements":
|
if($forums[$user_activity['fid']])
| if($announcements[$user_activity['ann']])
|
{
|
{
|
$location_name = $lang->sprintf($lang->viewing_announcements, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
| $location_name = $lang->sprintf($lang->viewing_announcements, get_announcement_link($user_activity['ann']), $announcements[$user_activity['ann']]);
|
} else {
| } else {
|
Zeile 711 | Zeile 742 |
---|
break; case "misc_syndication": $location_name = $lang->viewing_syndication;
|
break; case "misc_syndication": $location_name = $lang->viewing_syndication;
|
break;
| break;
|
case "misc_imcenter": $location_name = $lang->viewing_imcenter; break;
| case "misc_imcenter": $location_name = $lang->viewing_imcenter; break;
|
Zeile 839 | Zeile 870 |
---|
break; // reputation.php functions case "reputation":
|
break; // reputation.php functions case "reputation":
|
$location_name = $lang->giving_reputation;
| $location_name = $lang->sprintf($lang->giving_reputation, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]); break; case "reputation_report": if($usernames[$user_activity['uid']]) { $location_name = $lang->sprintf($lang->viewing_reputation_report, "reputation.php?uid={$user_activity['uid']}", $usernames[$user_activity['uid']]); } else { $location_name = $lang->sprintf($lang->viewing_reputation_report2); }
|
break; // search.php functions case "search":
| break; // search.php functions case "search":
|
Zeile 874 | Zeile 915 |
---|
break; case "usercp_options": $location_name = $lang->updating_options;
|
break; case "usercp_options": $location_name = $lang->updating_options;
|
break;
| break;
|
case "usercp_editsig": $location_name = $lang->editing_signature; break;
| case "usercp_editsig": $location_name = $lang->editing_signature; break;
|
Zeile 918 | Zeile 959 |
---|
break; case "warnings_view": $location_name = $lang->viewing_warning;
|
break; case "warnings_view": $location_name = $lang->viewing_warning;
|
break;
| break;
|
case "warnings": $location_name = $lang->managing_warnings; break; } $plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);
|
case "warnings": $location_name = $lang->managing_warnings; break; } $plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);
|
$plugins->run_hooks_by_ref("build_friendly_wol_location_end", $plugin_array); if($user_activity['nopermission'] == 1)
| $plugins->run_hooks("build_friendly_wol_location_end", $plugin_array);
if(isset($user_activity['nopermission']) && $user_activity['nopermission'] == 1)
|
{ $location_name = $lang->viewing_noperms; }
|
{ $location_name = $lang->viewing_noperms; }
|
|
|
if(!$location_name) { $location_name = $lang->sprintf($lang->unknown_location, $user_activity['location']);
| if(!$location_name) { $location_name = $lang->sprintf($lang->unknown_location, $user_activity['location']);
|