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 5016 2010-06-12 00:24:02Z RyanGordon $
| * $Id: functions_online.php 5821 2012-05-02 15:40:38Z Tomm $
|
*/
|
*/
|
$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";
|
case "editpost": $user_activity['activity'] = "editpost";
|
break;
| break;
|
case "forumdisplay": if(is_numeric($parameters['fid'])) {
| case "forumdisplay": if(is_numeric($parameters['fid'])) {
|
Zeile 99 | Zeile 99 |
---|
} $user_activity['activity'] = "forumdisplay"; $user_activity['fid'] = $parameters['fid'];
|
} $user_activity['activity'] = "forumdisplay"; $user_activity['fid'] = $parameters['fid'];
|
break;
| break;
|
case "index": case '': $user_activity['activity'] = "index";
|
case "index": case '': $user_activity['activity'] = "index";
|
break;
| break;
|
case "managegroup": $user_activity['activity'] = "managegroup"; break;
| case "managegroup": $user_activity['activity'] = "managegroup"; break;
|
Zeile 111 | Zeile 111 |
---|
if($parameters['action'] == "activate") { $user_activity['activity'] = "member_activate";
|
if($parameters['action'] == "activate") { $user_activity['activity'] = "member_activate";
|
}
| }
|
elseif($parameters['action'] == "register" || $parameters['action'] == "do_register") { $user_activity['activity'] = "member_register";
| elseif($parameters['action'] == "register" || $parameters['action'] == "do_register") { $user_activity['activity'] = "member_register";
|
Zeile 134 | Zeile 134 |
---|
$user_activity['uid'] = $parameters['uid']; } elseif($parameters['action'] == "emailuser" || $parameters['action'] == "do_emailuser")
|
$user_activity['uid'] = $parameters['uid']; } elseif($parameters['action'] == "emailuser" || $parameters['action'] == "do_emailuser")
|
{
| {
|
$user_activity['activity'] = "member_emailuser";
|
$user_activity['activity'] = "member_emailuser";
|
}
| }
|
elseif($parameters['action'] == "rate" || $parameters['action'] == "do_rate") { $user_activity['activity'] = "member_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_resendactivation"; } elseif($parameters['action'] == "lostpw" || $parameters['action'] == "do_lostpw" || $parameters['action'] == "resetpassword")
|
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_lostpw"; } else
| $user_activity['activity'] = "member_lostpw"; } else
|
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 219 | Zeile 219 |
---|
if(is_numeric($parameters['pid'])) { $pid_list[] = $parameters['pid'];
|
if(is_numeric($parameters['pid'])) { $pid_list[] = $parameters['pid'];
|
$user_activity['activity'] = "newreply";
| $user_activity['activity'] = "newreply";
|
$user_activity['pid'] = $parameters['pid'];
|
$user_activity['pid'] = $parameters['pid'];
|
}
| }
|
else { if(is_numeric($parameters['tid']))
| else { if(is_numeric($parameters['tid']))
|
Zeile 230 | Zeile 230 |
---|
} $user_activity['activity'] = "newreply"; $user_activity['tid'] = $parameters['tid'];
|
} $user_activity['activity'] = "newreply"; $user_activity['tid'] = $parameters['tid'];
|
} break;
| } break;
|
case "newthread": if(is_numeric($parameters['fid'])) {
| case "newthread": if(is_numeric($parameters['fid'])) {
|
Zeile 242 | Zeile 242 |
---|
break; case "online": if($parameters['action'] == "today")
|
break; case "online": if($parameters['action'] == "today")
|
{
| {
|
$user_activity['activity'] = "woltoday"; } else
| $user_activity['activity'] = "woltoday"; } else
|
Zeile 277 | Zeile 277 |
---|
{ $user_activity['activity'] = "showresults"; }
|
{ $user_activity['activity'] = "showresults"; }
|
} break;
| } break;
|
case "printthread": if(is_numeric($parameters['tid'])) {
| case "printthread": if(is_numeric($parameters['tid'])) {
|
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 338 | Zeile 351 |
---|
else { if($parameters['page'])
|
else { if($parameters['page'])
|
{
| {
|
$user_activity['page'] = $parameters['page']; } if(is_numeric($parameters['tid']))
| $user_activity['page'] = $parameters['page']; } if(is_numeric($parameters['tid']))
|
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 492 | Zeile 517 |
---|
{ $posts[$post['pid']] = $post['tid']; $tid_list[] = $post['tid'];
|
{ $posts[$post['pid']] = $post['tid']; $tid_list[] = $post['tid'];
|
} }
| } }
|
// Fetch any threads if(!is_array($threads) && count($tid_list) > 0) {
|
// Fetch any threads if(!is_array($threads) && count($tid_list) > 0) {
|
| $perms = array();
|
$tid_sql = implode(",", $tid_list); $query = $db->query("
|
$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} ");
|
|
|
while($thread = $db->fetch_array($query)) {
|
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; }
|
if(is_moderator($thread['fid']) || $thread['visible'] != '0') { $thread_title = '';
| if(is_moderator($thread['fid']) || $thread['visible'] != '0') { $thread_title = '';
|
Zeile 526 | 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']; }
|
} }
| } }
|
Zeile 551 | 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 662 | 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 686 | 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 827 | 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 913 | 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) {
|