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 5380 2011-02-21 12:04:43Z 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 191 | Zeile 191 |
---|
$accepted_parameters = array(); $accepted_parameters['report'] = array("do_reports", "reports", "allreports");
|
$accepted_parameters = array(); $accepted_parameters['report'] = array("do_reports", "reports", "allreports");
|
$accepted_parameters['new_annoucement'] = array("do_new_announcement", "new_announcement");
| $accepted_parameters['new_announcement'] = array("do_new_announcement", "new_announcement");
|
$accepted_parameters['delete_announcement'] = array("do_delete_announcement", "delete_announcement"); $accepted_parameters['edit_announcement'] = array("do_edit_announcement", "edit_announcement"); $accepted_parameters['mod_queue'] = array("do_modqueue", "modqueue");
| $accepted_parameters['delete_announcement'] = array("do_delete_announcement", "delete_announcement"); $accepted_parameters['edit_announcement'] = array("do_edit_announcement", "edit_announcement"); $accepted_parameters['mod_queue'] = array("do_modqueue", "modqueue");
|
Zeile 244 | Zeile 244 |
---|
if($parameters['action'] == "today") { $user_activity['activity'] = "woltoday";
|
if($parameters['action'] == "today") { $user_activity['activity'] = "woltoday";
|
}
| }
|
else
|
else
|
{
| {
|
$user_activity['activity'] = "wol";
|
$user_activity['activity'] = "wol";
|
}
| }
|
break; case "polls": // Make the "do" parts the same as the other one.
| break; case "polls": // Make the "do" parts the same as the other one.
|
Zeile 257 | Zeile 257 |
---|
$user_activity['activity'] = "newpoll"; } elseif($parameters['action'] == "do_editpoll")
|
$user_activity['activity'] = "newpoll"; } elseif($parameters['action'] == "do_editpoll")
|
{
| {
|
$user_activity['activity'] = "editpoll"; } else
| $user_activity['activity'] = "editpoll"; } else
|
Zeile 280 | Zeile 280 |
---|
} break; case "printthread":
|
} break; case "printthread":
|
if(is_numeric($parameters['tid'])) {
| if(is_numeric($parameters['tid'])) {
|
$tid_list[] = $parameters['tid'];
|
$tid_list[] = $parameters['tid'];
|
}
| }
|
$user_activity['activity'] = "printthread"; $user_activity['tid'] = $parameters['tid']; break;
| $user_activity['activity'] = "printthread"; $user_activity['tid'] = $parameters['tid']; break;
|
Zeile 293 | Zeile 293 |
---|
$user_activity['activity'] = "private_send"; } elseif($parameters['action'] == "read")
|
$user_activity['activity'] = "private_send"; } elseif($parameters['action'] == "read")
|
{
| {
|
$user_activity['activity'] = "private_read"; } elseif($parameters['action'] == "folders" || $parameters['action'] == "do_folders")
| $user_activity['activity'] = "private_read"; } elseif($parameters['action'] == "folders" || $parameters['action'] == "do_folders")
|
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 330 | Zeile 343 |
---|
break; case "showthread": if(is_numeric($parameters['pid']) && $parameters['action'] == "showpost")
|
break; case "showthread": if(is_numeric($parameters['pid']) && $parameters['action'] == "showpost")
|
{
| {
|
$pid_list[] = $parameters['pid']; $user_activity['activity'] = "showpost"; $user_activity['pid'] = $parameters['pid'];
| $pid_list[] = $parameters['pid']; $user_activity['activity'] = "showpost"; $user_activity['pid'] = $parameters['pid'];
|
Zeile 342 | Zeile 355 |
---|
$user_activity['page'] = $parameters['page']; } if(is_numeric($parameters['tid']))
|
$user_activity['page'] = $parameters['page']; } if(is_numeric($parameters['tid']))
|
{
| {
|
$tid_list[] = $parameters['tid']; } $user_activity['activity'] = "showthread";
| $tid_list[] = $parameters['tid']; } $user_activity['activity'] = "showthread";
|
Zeile 418 | Zeile 431 |
---|
} elseif($parameters['action'] == "view") {
|
} elseif($parameters['action'] == "view") {
|
$user_activity['activity'] == "warnings_view";
| $user_activity['activity'] = "warnings_view";
|
} else {
| } else {
|
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 501 | Zeile 526 |
---|
$perms = array(); $tid_sql = implode(",", $tid_list); $query = $db->query("
|
$perms = array(); $tid_sql = implode(",", $tid_list); $query = $db->query("
|
SELECT t.fid, t.tid, t.subject, t.visible, p.displaystyle AS threadprefix
| SELECT t.uid, t.fid, t.tid, t.subject, t.visible, p.displaystyle AS threadprefix
|
FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix) WHERE tid IN({$tid_sql}) {$fidnot} {$visible}
| FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix) WHERE tid IN({$tid_sql}) {$fidnot} {$visible}
|
Zeile 512 | Zeile 537 |
---|
if(!$perms[$thread['fid']]) { $perms[$thread['fid']] = forum_permissions($thread['fid']);
|
if(!$perms[$thread['fid']]) { $perms[$thread['fid']] = forum_permissions($thread['fid']);
|
}
| }
|
|
|
if($perms[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
| if($perms[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'] && !is_moderator($thread['fid']))
|
{ continue; }
| { continue; }
|
Zeile 537 | Zeile 562 |
---|
// 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)) { $forums[$forum['fid']] = $forum['name']; $forums_linkto[$forum['fid']] = $forum['linkto']; } }
| { if($fidnot && $unviewableforums) { $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) {
|
Zeile 563 | Zeile 594 |
---|
{ // announcement.php functions case "announcements":
|
{ // announcement.php functions case "announcements":
|
if($forums[$user_activity['fid']]) { $location_name = $lang->sprintf($lang->viewing_announcements, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]); }
| if($announcements[$user_activity['ann']]) { $location_name = $lang->sprintf($lang->viewing_announcements, get_announcement_link($user_activity['ann']), $announcements[$user_activity['ann']]); }
|
else { $location_name = $lang->viewing_announcements2;
|
else { $location_name = $lang->viewing_announcements2;
|
} break;
| } break;
|
// attachment.php actions case "attachment": $pid = $attachments[$user_activity['aid']]; $tid = $posts[$pid]; if($threads[$tid])
|
// attachment.php actions case "attachment": $pid = $attachments[$user_activity['aid']]; $tid = $posts[$pid]; if($threads[$tid])
|
{
| {
|
$location_name = $lang->sprintf($lang->viewing_attachment2, $user_activity['aid'], $threads[$tid], get_thread_link($tid)); } else { $location_name = $lang->viewing_attachment;
|
$location_name = $lang->sprintf($lang->viewing_attachment2, $user_activity['aid'], $threads[$tid], get_thread_link($tid)); } else { $location_name = $lang->viewing_attachment;
|
} break;
| } break;
|
// calendar.php functions case "calendar": $location_name = $lang->viewing_calendar; break; case "calendar_event": if($events[$user_activity['eid']])
|
// calendar.php functions case "calendar": $location_name = $lang->viewing_calendar; break; case "calendar_event": if($events[$user_activity['eid']])
|
{
| {
|
$location_name = $lang->sprintf($lang->viewing_event2, get_event_link($user_activity['eid']), $events[$user_activity['eid']]);
|
$location_name = $lang->sprintf($lang->viewing_event2, get_event_link($user_activity['eid']), $events[$user_activity['eid']]);
|
} else {
| } else {
|
$location_name = $lang->viewing_event; } break;
| $location_name = $lang->viewing_event; } break;
|
Zeile 643 | Zeile 674 |
---|
if($usernames[$user_activity['uid']]) { $location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]);
|
if($usernames[$user_activity['uid']]) { $location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]);
|
}
| }
|
else { $location_name = $lang->viewing_profile; }
|
else { $location_name = $lang->viewing_profile; }
|
break;
| break;
|
case "member_register": $location_name = $lang->registering; break;
| case "member_register": $location_name = $lang->registering; break;
|
Zeile 656 | Zeile 687 |
---|
case "member_login": // Guest or member? if($mybb->user['uid'] == 0)
|
case "member_login": // Guest or member? if($mybb->user['uid'] == 0)
|
{
| {
|
$location_name = $lang->logging_in; } else
| $location_name = $lang->logging_in; } else
|
Zeile 674 | Zeile 705 |
---|
$location_name = $lang->rating_user; break; case "member_resendactivation":
|
$location_name = $lang->rating_user; break; case "member_resendactivation":
|
$location_name = $lang->resending_account_activation;
| $location_name = $lang->member_resendactivation;
|
break; case "member_lostpw": $location_name = $lang->member_lostpw;
| break; case "member_lostpw": $location_name = $lang->member_lostpw;
|
Zeile 698 | Zeile 729 |
---|
} break; case "misc_markread":
|
} break; case "misc_markread":
|
$location_name = $lang->marking_read;
| $location_name = $lang->sprintf($lang->marking_read, $mybb->post_code);
|
break; case "misc_help": $location_name = $lang->viewing_helpdocs;
| break; case "misc_help": $location_name = $lang->viewing_helpdocs;
|
Zeile 718 | Zeile 749 |
---|
// modcp.php functions case "modcp_modlogs": $location_name = $lang->viewing_modlogs;
|
// modcp.php functions case "modcp_modlogs": $location_name = $lang->viewing_modlogs;
|
break;
| break;
|
case "modcp_announcements": $location_name = $lang->managing_announcements;
|
case "modcp_announcements": $location_name = $lang->managing_announcements;
|
break;
| break;
|
case "modcp_finduser": $location_name = $lang->search_for_user;
|
case "modcp_finduser": $location_name = $lang->search_for_user;
|
break;
| break;
|
case "modcp_warninglogs": $location_name = $lang->managing_warninglogs; break; case "modcp_ipsearch": $location_name = $lang->searching_ips;
|
case "modcp_warninglogs": $location_name = $lang->managing_warninglogs; break; case "modcp_ipsearch": $location_name = $lang->searching_ips;
|
break;
| break;
|
case "modcp_report": $location_name = $lang->viewing_reports;
|
case "modcp_report": $location_name = $lang->viewing_reports;
|
break;
| break;
|
case "modcp_new_announcement": $location_name = $lang->adding_announcement;
|
case "modcp_new_announcement": $location_name = $lang->adding_announcement;
|
break;
| break;
|
case "modcp_delete_announcement": $location_name = $lang->deleting_announcement; break; case "modcp_edit_announcement": $location_name = $lang->editing_announcement;
|
case "modcp_delete_announcement": $location_name = $lang->deleting_announcement; break; case "modcp_edit_announcement": $location_name = $lang->editing_announcement;
|
break;
| break;
|
case "modcp_mod_queue": $location_name = $lang->managing_modqueue;
|
case "modcp_mod_queue": $location_name = $lang->managing_modqueue;
|
break;
| break;
|
case "modcp_editprofile": $location_name = $lang->editing_user_profiles;
|
case "modcp_editprofile": $location_name = $lang->editing_user_profiles;
|
break;
| break;
|
case "modcp_banning": $location_name = $lang->managing_bans; break; case "modcp": $location_name = $lang->viewing_modcp;
|
case "modcp_banning": $location_name = $lang->managing_bans; break; case "modcp": $location_name = $lang->viewing_modcp;
|
break;
| break;
|
// moderation.php functions case "moderation": $location_name = $lang->using_modtools;
| // moderation.php functions case "moderation": $location_name = $lang->using_modtools;
|
Zeile 762 | Zeile 793 |
---|
// newreply.php functions case "newreply": if($user_activity['pid'])
|
// newreply.php functions case "newreply": if($user_activity['pid'])
|
{
| {
|
$user_activity['tid'] = $posts[$user_activity['pid']];
|
$user_activity['tid'] = $posts[$user_activity['pid']];
|
} if($threads[$user_activity['tid']]) {
| } if($threads[$user_activity['tid']]) {
|
$location_name = $lang->sprintf($lang->replying_thread2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']]); } else
| $location_name = $lang->sprintf($lang->replying_thread2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']]); } else
|
Zeile 814 | Zeile 845 |
---|
else { $location_name = $lang->printing_thread;
|
else { $location_name = $lang->printing_thread;
|
}
| }
|
break; // private.php functions case "private_send":
| break; // private.php functions case "private_send":
|
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 925 | Zeile 966 |
---|
} $plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);
|
} $plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);
|
$plugins->run_hooks_by_ref("build_friendly_wol_location_end", $plugin_array);
| $plugins->run_hooks("build_friendly_wol_location_end", $plugin_array);
|
if($user_activity['nopermission'] == 1) {
| if($user_activity['nopermission'] == 1) {
|