Vergleich inc/functions_online.php - 1.6.7 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 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 19Zeile 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 51Zeile 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 79Zeile 79
			elseif($parameters['action'] == "addevent" || $parameters['action'] == "do_addevent")
{
$user_activity['activity'] = "calendar_addevent";

			elseif($parameters['action'] == "addevent" || $parameters['action'] == "do_addevent")
{
$user_activity['activity'] = "calendar_addevent";

			}

			}

			elseif($parameters['action'] == "editevent" || $parameters['action'] == "do_editevent")
{
$user_activity['activity'] = "calendar_editevent";

			elseif($parameters['action'] == "editevent" || $parameters['action'] == "do_editevent")
{
$user_activity['activity'] = "calendar_editevent";

Zeile 106Zeile 106
			break;
case "managegroup":
$user_activity['activity'] = "managegroup";

			break;
case "managegroup":
$user_activity['activity'] = "managegroup";

			break;

			break;

		case "member":
if($parameters['action'] == "activate")

		case "member":
if($parameters['action'] == "activate")

			{

			{

				$user_activity['activity'] = "member_activate";
}
elseif($parameters['action'] == "register" || $parameters['action'] == "do_register")
{
$user_activity['activity'] = "member_register";

				$user_activity['activity'] = "member_activate";
}
elseif($parameters['action'] == "register" || $parameters['action'] == "do_register")
{
$user_activity['activity'] = "member_register";

			}

			}

			elseif($parameters['action'] == "login" || $parameters['action'] == "do_login")
{
$user_activity['activity'] = "member_login";

			elseif($parameters['action'] == "login" || $parameters['action'] == "do_login")
{
$user_activity['activity'] = "member_login";

			}

			}

			elseif($parameters['action'] == "logout")
{
$user_activity['activity'] = "member_logout";

			elseif($parameters['action'] == "logout")
{
$user_activity['activity'] = "member_logout";

Zeile 146Zeile 146
				$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']))

			{
if(is_numeric($parameters['tid']))

				{
$tid_list[] = $parameters['tid'];
}

				{
$tid_list[] = $parameters['tid'];
}

Zeile 175Zeile 175
			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 217Zeile 217
			break;
case "newreply":
if(is_numeric($parameters['pid']))

			break;
case "newreply":
if(is_numeric($parameters['pid']))

			{

			{

				$pid_list[] = $parameters['pid'];
$user_activity['activity'] = "newreply";
$user_activity['pid'] = $parameters['pid'];

				$pid_list[] = $parameters['pid'];
$user_activity['activity'] = "newreply";
$user_activity['pid'] = $parameters['pid'];

			}

			}

			else
{
if(is_numeric($parameters['tid']))

			else
{
if(is_numeric($parameters['tid']))

Zeile 230Zeile 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 244Zeile 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";
}

Zeile 271Zeile 271
						$user_activity['activity'] = $action;
break;
}

						$user_activity['activity'] = $action;
break;
}

				}


				}


				if(!$user_activity['activity'])
{
$user_activity['activity'] = "showresults";

				if(!$user_activity['activity'])
{
$user_activity['activity'] = "showresults";

Zeile 285Zeile 285
				$tid_list[] = $parameters['tid'];
}
$user_activity['activity'] = "printthread";

				$tid_list[] = $parameters['tid'];
}
$user_activity['activity'] = "printthread";

			$user_activity['tid'] = $parameters['tid'];
break;

			$user_activity['tid'] = $parameters['tid'];
break;

		case "private":
if($parameters['action'] == "send" || $parameters['action'] == "do_send")
{
$user_activity['activity'] = "private_send";
}
elseif($parameters['action'] == "read")

		case "private":
if($parameters['action'] == "send" || $parameters['action'] == "do_send")
{
$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_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";
}

Zeile 383Zeile 383
				$user_activity['activity'] = "usercp_editsig";
}
elseif($parameters['action'] == "avatar" || $parameters['action'] == "do_avatar")

				$user_activity['activity'] = "usercp_editsig";
}
elseif($parameters['action'] == "avatar" || $parameters['action'] == "do_avatar")

			{

			{

				$user_activity['activity'] = "usercp_avatar";

				$user_activity['activity'] = "usercp_avatar";

			}

			}

			elseif($parameters['action'] == "editlists" || $parameters['action'] == "do_editlists")

			elseif($parameters['action'] == "editlists" || $parameters['action'] == "do_editlists")

			{

			{

				$user_activity['activity'] = "usercp_editlists";

				$user_activity['activity'] = "usercp_editlists";

			}

			}

			elseif($parameters['action'] == "favorites")
{
$user_activity['activity'] = "usercp_favorites";

			elseif($parameters['action'] == "favorites")
{
$user_activity['activity'] = "usercp_favorites";

Zeile 397Zeile 397
			elseif($parameters['action'] == "subscriptions")
{
$user_activity['activity'] = "usercp_subscriptions";

			elseif($parameters['action'] == "subscriptions")
{
$user_activity['activity'] = "usercp_subscriptions";

			}

			}

			elseif($parameters['action'] == "notepad" || $parameters['action'] == "do_notepad")
{
$user_activity['activity'] = "usercp_notepad";

			elseif($parameters['action'] == "notepad" || $parameters['action'] == "do_notepad")
{
$user_activity['activity'] = "usercp_notepad";

Zeile 424Zeile 424
			if($parameters['action'] == "warn" || $parameters['action'] == "do_warn")
{
$user_activity['activity'] = "warnings_warn";

			if($parameters['action'] == "warn" || $parameters['action'] == "do_warn")
{
$user_activity['activity'] = "warnings_warn";

			}

			}

			elseif($parameters['action'] == "do_revoke")

			elseif($parameters['action'] == "do_revoke")

			{

			{

				$user_activity['activity'] = "warnings_revoke";

				$user_activity['activity'] = "warnings_revoke";

			}

			}

			elseif($parameters['action'] == "view")
{
$user_activity['activity'] = "warnings_view";

			elseif($parameters['action'] == "view")
{
$user_activity['activity'] = "warnings_view";

Zeile 437Zeile 437
			{
$user_activity['activity'] = "warnings";
}

			{
$user_activity['activity'] = "warnings";
}

			break;

			break;

		case "nopermission":
$user_activity['activity'] = "nopermission";
$user_activity['nopermission'] = 1;

		case "nopermission":
$user_activity['activity'] = "nopermission";
$user_activity['nopermission'] = 1;

Zeile 463Zeile 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 479Zeile 479
		$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))

		{

		{

			$usernames[$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)

	{

	{

		$aid_sql = implode(",", $aid_list);
$query = $db->simple_select("attachments", "aid,pid", "aid IN ($aid_sql)");
while($attachment = $db->fetch_array($query))
{
$attachments[$attachment['aid']] = $attachment['pid'];
$pid_list[] = $attachment['pid'];

		$aid_sql = implode(",", $aid_list);
$query = $db->simple_select("attachments", "aid,pid", "aid IN ($aid_sql)");
while($attachment = $db->fetch_array($query))
{
$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 551Zeile 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 576Zeile 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;

Zeile 592Zeile 610
			if($threads[$tid])
{
$location_name = $lang->sprintf($lang->viewing_attachment2, $user_activity['aid'], $threads[$tid], get_thread_link($tid));

			if($threads[$tid])
{
$location_name = $lang->sprintf($lang->viewing_attachment2, $user_activity['aid'], $threads[$tid], get_thread_link($tid));

			}
else

			}
else

			{
$location_name = $lang->viewing_attachment;
}

			{
$location_name = $lang->viewing_attachment;
}

Zeile 613Zeile 631
			}
break;
case "calendar_addevent":

			}
break;
case "calendar_addevent":

			$location_name = $lang->adding_event;

			$location_name = $lang->adding_event;

			break;
case "calendar_editevent":
$location_name = $lang->editing_event;

			break;
case "calendar_editevent":
$location_name = $lang->editing_event;

			break;

			break;

		// editpost.php functions
case "editpost":
$location_name = $lang->editing_post;

		// editpost.php functions
case "editpost":
$location_name = $lang->editing_post;

Zeile 627Zeile 645
			if($forums[$user_activity['fid']])
{
if($forums_linkto[$user_activity['fid']])

			if($forums[$user_activity['fid']])
{
if($forums_linkto[$user_activity['fid']])

				{

				{

					$location_name = $lang->sprintf($lang->forum_redirect_to, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
}
else

					$location_name = $lang->sprintf($lang->forum_redirect_to, get_forum_link($user_activity['fid']), $forums[$user_activity['fid']]);
}
else

Zeile 669Zeile 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 724Zeile 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 752Zeile 770
			break;
case "modcp_delete_announcement":
$location_name = $lang->deleting_announcement;

			break;
case "modcp_delete_announcement":
$location_name = $lang->deleting_announcement;

			break;

			break;

		case "modcp_edit_announcement":
$location_name = $lang->editing_announcement;
break;

		case "modcp_edit_announcement":
$location_name = $lang->editing_announcement;
break;

Zeile 792Zeile 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;
}
break;
// online.php functions
case "wol":
$location_name = $lang->viewing_wol;

				$location_name = $lang->posting_thread;
}
break;
// online.php functions
case "wol":
$location_name = $lang->viewing_wol;

			break;

			break;

		case "woltoday":
$location_name = $lang->viewing_woltoday;
break;
// polls.php functions
case "newpoll":
$location_name = $lang->creating_poll;

		case "woltoday":
$location_name = $lang->viewing_woltoday;
break;
// polls.php functions
case "newpoll":
$location_name = $lang->creating_poll;

			break;

			break;

		case "editpoll":
$location_name = $lang->editing_poll;
break;

		case "editpoll":
$location_name = $lang->editing_poll;
break;

Zeile 835Zeile 853
			break;
case "private_read":
$location_name = $lang->reading_pm;

			break;
case "private_read":
$location_name = $lang->reading_pm;

			break;

			break;

		case "private_folders":
$location_name = $lang->editing_pmfolders;
break;
case "private":
$location_name = $lang->using_pmsystem;

		case "private_folders":
$location_name = $lang->editing_pmfolders;
break;
case "private":
$location_name = $lang->using_pmsystem;

			break;

			break;

		/* Ratethread functions */
case "ratethread":
$location_name = $lang->rating_thread;

		/* Ratethread functions */
case "ratethread":
$location_name = $lang->rating_thread;

Zeile 849Zeile 867
		// report.php functions
case "report":
$location_name = $lang->reporting_post;

		// report.php functions
case "report":
$location_name = $lang->reporting_post;

			break;

			break;

		// reputation.php functions
case "reputation":
$location_name = $lang->sprintf($lang->giving_reputation, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]);
break;

		// reputation.php functions
case "reputation":
$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']]);
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":
$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 864Zeile 889
		// showthread.php functions
case "showthread":
if($threads[$user_activity['tid']])

		// showthread.php functions
case "showthread":
if($threads[$user_activity['tid']])

			{

			{

				$pagenote = '';
$location_name = $lang->sprintf($lang->reading_thread2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']], $pagenote);
}

				$pagenote = '';
$location_name = $lang->sprintf($lang->reading_thread2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']], $pagenote);
}

Zeile 905Zeile 930
			break;
case "usercp_notepad":
$location_name = $lang->editing_pad;

			break;
case "usercp_notepad":
$location_name = $lang->editing_pad;

			break;

			break;

		case "usercp_password":
$location_name = $lang->editing_password;
break;

		case "usercp_password":
$location_name = $lang->editing_password;
break;

Zeile 942Zeile 967
	
$plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);
$plugins->run_hooks("build_friendly_wol_location_end", $plugin_array);

	
$plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);
$plugins->run_hooks("build_friendly_wol_location_end", $plugin_array);

	
if($user_activity['nopermission'] == 1)


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']);