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 5623 2011-10-01 02:46:09Z ralgith $
| * $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 87 | Zeile 87 |
---|
else { $user_activity['activity'] = "calendar";
|
else { $user_activity['activity'] = "calendar";
|
} break;
| } break;
|
case "editpost": $user_activity['activity'] = "editpost"; break;
| case "editpost": $user_activity['activity'] = "editpost"; break;
|
Zeile 136 | Zeile 136 |
---|
elseif($parameters['action'] == "emailuser" || $parameters['action'] == "do_emailuser") { $user_activity['activity'] = "member_emailuser";
|
elseif($parameters['action'] == "emailuser" || $parameters['action'] == "do_emailuser") { $user_activity['activity'] = "member_emailuser";
|
}
| }
|
elseif($parameters['action'] == "rate" || $parameters['action'] == "do_rate")
|
elseif($parameters['action'] == "rate" || $parameters['action'] == "do_rate")
|
{
| {
|
$user_activity['activity'] = "member_rate"; } elseif($parameters['action'] == "resendactivation" || $parameters['action'] == "do_resendactivation")
|
$user_activity['activity'] = "member_rate"; } elseif($parameters['action'] == "resendactivation" || $parameters['action'] == "do_resendactivation")
|
{
| {
|
$user_activity['activity'] = "member_resendactivation"; } elseif($parameters['action'] == "lostpw" || $parameters['action'] == "do_lostpw" || $parameters['action'] == "resetpassword")
|
$user_activity['activity'] = "member_resendactivation"; } elseif($parameters['action'] == "lostpw" || $parameters['action'] == "do_lostpw" || $parameters['action'] == "resetpassword")
|
{
| {
|
$user_activity['activity'] = "member_lostpw";
|
$user_activity['activity'] = "member_lostpw";
|
} else {
| } else {
|
$user_activity['activity'] = "member"; }
|
$user_activity['activity'] = "member"; }
|
break;
| break;
|
case "memberlist": $user_activity['activity'] = "memberlist"; break; case "misc": $accepted_parameters = array("markread", "help", "buddypopup", "smilies", "syndication", "imcenter", "dstswitch"); if($parameters['action'] == "whoposted")
|
case "memberlist": $user_activity['activity'] = "memberlist"; break; case "misc": $accepted_parameters = array("markread", "help", "buddypopup", "smilies", "syndication", "imcenter", "dstswitch"); if($parameters['action'] == "whoposted")
|
{ if(is_numeric($parameters['tid'])) { $tid_list[] = $parameters['tid'];
| { if(is_numeric($parameters['tid'])) { $tid_list[] = $parameters['tid'];
|
} $user_activity['activity'] = "misc_whoposted"; $user_activity['tid'] = $parameters['tid']; } elseif(in_array($parameters['action'], $accepted_parameters))
|
} $user_activity['activity'] = "misc_whoposted"; $user_activity['tid'] = $parameters['tid']; } elseif(in_array($parameters['action'], $accepted_parameters))
|
{
| {
|
$user_activity['activity'] = "misc_".$parameters['action'];
|
$user_activity['activity'] = "misc_".$parameters['action'];
|
} else { $user_activity['activity'] = "misc"; }
| } else { $user_activity['activity'] = "misc"; }
|
break; case "modcp": $accepted_parameters = array("modlogs", "announcements", "finduser", "warninglogs", "ipsearch");
| break; case "modcp": $accepted_parameters = array("modlogs", "announcements", "finduser", "warninglogs", "ipsearch");
|
Zeile 185 | Zeile 185 |
---|
if($parameters['action'] == $action) { $user_activity['activity'] = "modcp_".$action;
|
if($parameters['action'] == $action) { $user_activity['activity'] = "modcp_".$action;
|
break; } }
| break; } }
|
$accepted_parameters = array(); $accepted_parameters['report'] = array("do_reports", "reports", "allreports"); $accepted_parameters['new_announcement'] = array("do_new_announcement", "new_announcement");
| $accepted_parameters = array(); $accepted_parameters['report'] = array("do_reports", "reports", "allreports"); $accepted_parameters['new_announcement'] = array("do_new_announcement", "new_announcement");
|
Zeile 248 | Zeile 248 |
---|
else { $user_activity['activity'] = "wol";
|
else { $user_activity['activity'] = "wol";
|
} break;
| } break;
|
case "polls": // Make the "do" parts the same as the other one. if($parameters['action'] == "do_newpoll")
|
case "polls": // Make the "do" parts the same as the other one. if($parameters['action'] == "do_newpoll")
|
{
| {
|
$user_activity['activity'] = "newpoll";
|
$user_activity['activity'] = "newpoll";
|
}
| }
|
elseif($parameters['action'] == "do_editpoll") { $user_activity['activity'] = "editpoll";
|
elseif($parameters['action'] == "do_editpoll") { $user_activity['activity'] = "editpoll";
|
} else
| } else
|
{ $accepted_parameters = array("do_editpoll", "editpoll", "newpoll", "do_newpoll", "showresults", "vote");
| { $accepted_parameters = array("do_editpoll", "editpoll", "newpoll", "do_newpoll", "showresults", "vote");
|
Zeile 285 | Zeile 285 |
---|
$tid_list[] = $parameters['tid']; } $user_activity['activity'] = "printthread";
|
$tid_list[] = $parameters['tid']; } $user_activity['activity'] = "printthread";
|
$user_activity['tid'] = $parameters['tid'];
| $user_activity['tid'] = $parameters['tid'];
|
break; case "private": if($parameters['action'] == "send" || $parameters['action'] == "do_send")
|
break; case "private": if($parameters['action'] == "send" || $parameters['action'] == "do_send")
|
{
| {
|
$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")
|
{
| {
|
$user_activity['activity'] = "private_folders"; } else
| $user_activity['activity'] = "private_folders"; } else
|
Zeile 321 | Zeile 321 |
---|
if($parameters['action'] == "add") { $user_activity['activity'] = "reputation";
|
if($parameters['action'] == "add") { $user_activity['activity'] = "reputation";
|
} else
| } else
|
{ $user_activity['activity'] = "reputation_report"; }
| { $user_activity['activity'] = "reputation_report"; }
|
Zeile 334 | Zeile 334 |
---|
if(is_numeric($parameters['tid'])) { $tid_list[] = $parameters['tid'];
|
if(is_numeric($parameters['tid'])) { $tid_list[] = $parameters['tid'];
|
}
| }
|
$user_activity['activity'] = "sendthread"; $user_activity['tid'] = $parameters['tid']; break;
| $user_activity['activity'] = "sendthread"; $user_activity['tid'] = $parameters['tid']; break;
|
Zeile 343 | 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'];
|
} else {
| } else {
|
if($parameters['page']) { $user_activity['page'] = $parameters['page'];
| if($parameters['page']) { $user_activity['page'] = $parameters['page'];
|
Zeile 463 | 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 493 | 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 502 | Zeile 514 |
---|
$pid_sql = implode(",", $pid_list); $query = $db->simple_select("posts", "pid,tid", "pid IN ($pid_sql) $fidnot"); while($post = $db->fetch_array($query))
|
$pid_sql = implode(",", $pid_list); $query = $db->simple_select("posts", "pid,tid", "pid IN ($pid_sql) $fidnot"); while($post = $db->fetch_array($query))
|
{
| {
|
$posts[$post['pid']] = $post['tid']; $tid_list[] = $post['tid']; }
| $posts[$post['pid']] = $post['tid']; $tid_list[] = $post['tid']; }
|
Zeile 523 | Zeile 535 |
---|
while($thread = $db->fetch_array($query)) { if(!$perms[$thread['fid']])
|
while($thread = $db->fetch_array($query)) { if(!$perms[$thread['fid']])
|
{
| {
|
$perms[$thread['fid']] = forum_permissions($thread['fid']); }
if($perms[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'] && !is_moderator($thread['fid'])) { continue;
|
$perms[$thread['fid']] = forum_permissions($thread['fid']); }
if($perms[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'] && !is_moderator($thread['fid'])) { continue;
|
}
| }
|
if(is_moderator($thread['fid']) || $thread['visible'] != '0') {
| if(is_moderator($thread['fid']) || $thread['visible'] != '0') {
|
Zeile 550 | 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 576 | 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 755 | Zeile 773 |
---|
break; case "modcp_edit_announcement": $location_name = $lang->editing_announcement;
|
break; case "modcp_edit_announcement": $location_name = $lang->editing_announcement;
|
break;
| break;
|
case "modcp_mod_queue": $location_name = $lang->managing_modqueue; break;
| case "modcp_mod_queue": $location_name = $lang->managing_modqueue; break;
|
Zeile 792 | Zeile 810 |
---|
if($forums[$user_activity['fid']]) { $location_name = $lang->sprintf($lang->posting_thread2, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
|
if($forums[$user_activity['fid']]) { $location_name = $lang->sprintf($lang->posting_thread2, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
|
} else
| } else
|
{ $location_name = $lang->posting_thread; }
| { $location_name = $lang->posting_thread; }
|
Zeile 817 | Zeile 835 |
---|
break; case "vote": $location_name = $lang->voting_poll;
|
break; case "vote": $location_name = $lang->voting_poll;
|
break;
| break;
|
// printthread.php functions case "printthread": if($threads[$user_activity['tid']])
| // printthread.php functions case "printthread": if($threads[$user_activity['tid']])
|
Zeile 855 | Zeile 873 |
---|
$location_name = $lang->sprintf($lang->giving_reputation, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]); break; case "reputation_report":
|
$location_name = $lang->sprintf($lang->giving_reputation, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]); break; case "reputation_report":
|
$location_name = $lang->sprintf($lang->viewing_reputation_report, "reputation.php?uid={$user_activity['uid']}", $usernames[$user_activity['uid']]);
| 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":
|