Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: functions_online.php 4058 2008-08-03 00:37:09Z Tikitiki $
| * $Id: functions_online.php 5379 2011-02-21 11:06:42Z Tomm $
|
*/
$uid_list = $aid_list = $pid_list = $tid_list = $fid_list = $eid_list = array();
| */
$uid_list = $aid_list = $pid_list = $tid_list = $fid_list = $eid_list = array();
|
Zeile 17 | Zeile 17 |
---|
* @param string The location (URL) of the user. * @return array Array of location and activity information */
|
* @param string The location (URL) of the user. * @return array Array of location and activity information */
|
function fetch_wol_activity($location)
| 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, $eid_list, $plugins, $user, $parameters;
|
Zeile 34 | Zeile 34 |
---|
} if($split_loc[1]) {
|
} if($split_loc[1]) {
|
$temp = explode("&", my_substr($split_loc[1], 1));
| $temp = explode("&", my_substr($split_loc[1], 1));
|
foreach($temp as $param) { $temp2 = explode("=", $param, 2); $parameters[$temp2[0]] = $temp2[1]; } }
|
foreach($temp as $param) { $temp2 = explode("=", $param, 2); $parameters[$temp2[0]] = $temp2[1]; } }
|
| if($nopermission) { $filename = "nopermission"; }
|
switch($filename) {
| switch($filename) {
|
Zeile 230 | Zeile 236 |
---|
if(is_numeric($parameters['fid'])) { $fid_list[] = $parameters['fid'];
|
if(is_numeric($parameters['fid'])) { $fid_list[] = $parameters['fid'];
|
}
| }
|
$user_activity['activity'] = "newthread"; $user_activity['fid'] = $parameters['fid']; break; case "online": if($parameters['action'] == "today")
|
$user_activity['activity'] = "newthread"; $user_activity['fid'] = $parameters['fid']; break; case "online": if($parameters['action'] == "today")
|
{
| {
|
$user_activity['activity'] = "woltoday"; } else { $user_activity['activity'] = "wol";
|
$user_activity['activity'] = "woltoday"; } else { $user_activity['activity'] = "wol";
|
}
| }
|
break; case "polls": // Make the "do" parts the same as the other one. if($parameters['action'] == "do_newpoll")
|
break; case "polls": // Make the "do" parts the same as the other one. if($parameters['action'] == "do_newpoll")
|
{
| {
|
$user_activity['activity'] = "newpoll"; } elseif($parameters['action'] == "do_editpoll") { $user_activity['activity'] = "editpoll";
|
$user_activity['activity'] = "newpoll"; } elseif($parameters['action'] == "do_editpoll") { $user_activity['activity'] = "editpoll";
|
} else { $user_activity['activity'] = $parameters['action']; } break;
| } else { $accepted_parameters = array("do_editpoll", "editpoll", "newpoll", "do_newpoll", "showresults", "vote"); foreach($accepted_parameters as $action) { if($parameters['action'] == $action) { $user_activity['activity'] = $action; break; } } if(!$user_activity['activity']) { $user_activity['activity'] = "showresults"; } } break;
|
case "printthread": if(is_numeric($parameters['tid'])) {
| case "printthread": if(is_numeric($parameters['tid'])) {
|
Zeile 266 | Zeile 286 |
---|
} $user_activity['activity'] = "printthread"; $user_activity['tid'] = $parameters['tid'];
|
} $user_activity['activity'] = "printthread"; $user_activity['tid'] = $parameters['tid'];
|
| break;
|
case "private": if($parameters['action'] == "send" || $parameters['action'] == "do_send") { $user_activity['activity'] = "private_send"; }
|
case "private": if($parameters['action'] == "send" || $parameters['action'] == "do_send") { $user_activity['activity'] = "private_send"; }
|
elseif($parameters['action'] == "show")
| elseif($parameters['action'] == "read")
|
{ $user_activity['activity'] = "private_read"; } elseif($parameters['action'] == "folders" || $parameters['action'] == "do_folders") { $user_activity['activity'] = "private_folders";
|
{ $user_activity['activity'] = "private_read"; } elseif($parameters['action'] == "folders" || $parameters['action'] == "do_folders") { $user_activity['activity'] = "private_folders";
|
} else {
| } else {
|
$user_activity['activity'] = "private"; }
|
$user_activity['activity'] = "private"; }
|
break;
| break;
|
case "ratethread": $user_activity['activity'] = "ratethread";
|
case "ratethread": $user_activity['activity'] = "ratethread";
|
break;
| break;
|
case "report": $user_activity['activity'] = "report"; break; case "reputation": $user_activity['activity'] = "reputation";
|
case "report": $user_activity['activity'] = "report"; break; case "reputation": $user_activity['activity'] = "reputation";
|
break;
| break;
|
case "search": $user_activity['activity'] = "search"; break;
| case "search": $user_activity['activity'] = "search"; break;
|
Zeile 326 | Zeile 347 |
---|
} $user_activity['activity'] = "showthread"; $user_activity['tid'] = $parameters['tid'];
|
} $user_activity['activity'] = "showthread"; $user_activity['tid'] = $parameters['tid'];
|
} break;
| } break;
|
case "stats": $user_activity['activity'] = "stats"; break;
| case "stats": $user_activity['activity'] = "stats"; break;
|
Zeile 378 | Zeile 399 |
---|
{ $user_activity['activity'] = "usercp2_favorites"; }
|
{ $user_activity['activity'] = "usercp2_favorites"; }
|
elseif($parameters['action'] == "addsubscription" || $parameters['action'] == "removesubscription" || $parameters['action'] == "removesubscription")
| else if($parameters['action'] == "addsubscription" || $parameters['action'] == "do_addsubscription" || $parameters['action'] == "removesubscription" || $parameters['action'] == "removesubscriptions")
|
{ $user_activity['activity'] = "usercp2_subscriptions"; }
| { $user_activity['activity'] = "usercp2_subscriptions"; }
|
Zeile 406 | Zeile 427 |
---|
break; case "nopermission": $user_activity['activity'] = "nopermission";
|
break; case "nopermission": $user_activity['activity'] = "nopermission";
|
| $user_activity['nopermission'] = 1;
|
break; default: $user_activity['activity'] = "unknown"; break; }
|
break; default: $user_activity['activity'] = "unknown"; break; }
|
| // 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['location'] = $location; $plugins->run_hooks_by_ref("fetch_wol_activity_end", $user_activity);
|
Zeile 425 | Zeile 448 |
---|
* @param array Array containing activity and essential IDs. * @return string Location name for the activity being performed. */
|
* @param array Array containing activity and essential IDs. * @return string Location name for the activity being performed. */
|
function build_friendly_wol_location($user_activity, $return=false)
| 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 $db, $lang, $uid_list, $aid_list, $pid_list, $tid_list, $fid_list, $eid_list, $plugins, $parser, $mybb;
|
global $threads, $forums, $forums_linkto, $posts, $events, $users, $attachments;
| global $threads, $forums, $forums_linkto, $posts, $events, $usernames, $attachments;
|
// Fetch forum permissions for this user $unviewableforums = get_unviewable_forums();
| // Fetch forum permissions for this user $unviewableforums = get_unviewable_forums();
|
Zeile 438 | Zeile 461 |
---|
}
// Fetch any users
|
}
// Fetch any users
|
if(!is_array($users) && count($uid_list) > 0)
| if(!is_array($usernames) && count($uid_list) > 0)
|
{ $uid_sql = implode(",", $uid_list); $query = $db->simple_select("users", "uid,username", "uid IN ($uid_sql)"); while($user = $db->fetch_array($query)) {
|
{ $uid_sql = implode(",", $uid_list); $query = $db->simple_select("users", "uid,username", "uid IN ($uid_sql)"); while($user = $db->fetch_array($query)) {
|
$users[$user['uid']] = $user['username'];
| $usernames[$user['uid']] = $user['username'];
|
} }
|
} }
|
|
|
// Fetch any attachments if(!is_array($attachments) && count($aid_list) > 0) {
| // Fetch any attachments if(!is_array($attachments) && count($aid_list) > 0) {
|
Zeile 474 | Zeile 497 |
---|
// Fetch any threads if(!is_array($threads) && count($tid_list) > 0)
|
// Fetch any threads if(!is_array($threads) && count($tid_list) > 0)
|
{
| {
|
$tid_sql = implode(",", $tid_list); $query = $db->simple_select("threads", "fid,tid,subject,visible", "tid IN($tid_sql) $fidnot $visible"); while($thread = $db->fetch_array($query))
| $tid_sql = implode(",", $tid_list); $query = $db->simple_select("threads", "fid,tid,subject,visible", "tid IN($tid_sql) $fidnot $visible"); while($thread = $db->fetch_array($query))
|
Zeile 483 | Zeile 506 |
---|
{ $threads[$thread['tid']] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $fid_list[] = $thread['fid'];
|
{ $threads[$thread['tid']] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $fid_list[] = $thread['fid'];
|
}
| }
|
} }
| } }
|
Zeile 493 | Zeile 516 |
---|
$fid_sql = implode(",", $fid_list); $query = $db->simple_select("forums", "fid,name,linkto", "fid IN ($fid_sql) $fidnot"); while($forum = $db->fetch_array($query))
|
$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']; }
| $forums[$forum['fid']] = $forum['name']; $forums_linkto[$forum['fid']] = $forum['linkto']; }
|
Zeile 511 | Zeile 534 |
---|
}
// Now we've got everything we need we can put a name to the location
|
}
// Now we've got everything we need we can put a name to the location
|
switch($user_activity['activity']['activity'])
| switch($user_activity['activity'])
|
{ // announcement.php functions case "announcements":
| { // announcement.php functions case "announcements":
|
Zeile 522 | Zeile 545 |
---|
else { $location_name = $lang->viewing_announcements2;
|
else { $location_name = $lang->viewing_announcements2;
|
} break;
| } break;
|
// attachment.php actions case "attachment": $pid = $attachments[$user_activity['aid']];
| // attachment.php actions case "attachment": $pid = $attachments[$user_activity['aid']];
|
Zeile 592 | Zeile 615 |
---|
$location_name = $lang->activating_account; break; case "member_profile":
|
$location_name = $lang->activating_account; break; case "member_profile":
|
if($users[$user_activity['uid']])
| if($usernames[$user_activity['uid']])
|
{
|
{
|
$location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $users[$user_activity['uid']]);
| $location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]);
|
} else {
| } else {
|
Zeile 757 | Zeile 780 |
---|
case "vote": $location_name = $lang->voting_poll; break;
|
case "vote": $location_name = $lang->voting_poll; break;
|
// postings.php functions case "postings": $location_name = $lang->using_modtools;
| // printthread.php functions case "printthread": if($threads[$user_activity['tid']]) { $location_name = $lang->sprintf($lang->printing_thread2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']]); } else { $location_name = $lang->printing_thread; }
|
break; // private.php functions case "private_send":
| break; // private.php functions case "private_send":
|
Zeile 785 | Zeile 815 |
---|
// reputation.php functions case "reputation": $location_name = $lang->giving_reputation;
|
// reputation.php functions case "reputation": $location_name = $lang->giving_reputation;
|
break;
| break;
|
// search.php functions case "search": $location_name = $lang->sprintf($lang->searching_forum, $mybb->settings['bbname']);
| // search.php functions case "search": $location_name = $lang->sprintf($lang->searching_forum, $mybb->settings['bbname']);
|
Zeile 813 | Zeile 843 |
---|
// usercp.php functions case "usercp_profile": $location_name = $lang->updating_profile;
|
// usercp.php functions case "usercp_profile": $location_name = $lang->updating_profile;
|
| break; case "usercp_editlists": $location_name = $lang->managing_buddyignorelist;
|
break; case "usercp_options": $location_name = $lang->updating_options;
| break; case "usercp_options": $location_name = $lang->updating_options;
|
Zeile 890 | Zeile 923 |
---|
*/ function build_wol_row($user) {
|
*/ function build_wol_row($user) {
|
global $mybb, $lang, $templates, $themes, $session;
| global $mybb, $lang, $templates, $theme, $session;
|
// We have a registered user if($user['uid'] > 0)
| // We have a registered user if($user['uid'] > 0)
|
Zeile 926 | Zeile 959 |
---|
$online_time = my_date($mybb->settings['timeformat'], $user['time']); // Fetch the location name for this users activity
|
$online_time = my_date($mybb->settings['timeformat'], $user['time']); // Fetch the location name for this users activity
|
$location = build_friendly_wol_location($user);
| $location = build_friendly_wol_location($user['activity']);
|
// Can view IPs, then fetch the IP template if($mybb->usergroup['canviewonlineips'] == 1)
| // Can view IPs, then fetch the IP template if($mybb->usergroup['canviewonlineips'] == 1)
|