Vergleich inc/functions_online.php - 1.6.0 - 1.6.11

  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 5016 2010-06-12 00:24:02Z RyanGordon $

 * $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 191Zeile 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 312Zeile 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 327Zeile 340
		break;
case "showteam":
$user_activity['activity'] = "showteam";

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

			break;

			break;

		case "showthread":
if(is_numeric($parameters['pid']) && $parameters['action'] == "showpost")
{

		case "showthread":
if(is_numeric($parameters['pid']) && $parameters['action'] == "showpost")
{

Zeile 372Zeile 385
			elseif($parameters['action'] == "avatar" || $parameters['action'] == "do_avatar")
{
$user_activity['activity'] = "usercp_avatar";

			elseif($parameters['action'] == "avatar" || $parameters['action'] == "do_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";
}
elseif($parameters['action'] == "favorites")

				$user_activity['activity'] = "usercp_editlists";
}
elseif($parameters['action'] == "favorites")

			{

			{

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

				$user_activity['activity'] = "usercp_favorites";
}
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 418Zeile 431
			}
elseif($parameters['action'] == "view")
{

			}
elseif($parameters['action'] == "view")
{

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

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

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

			}
else
{
$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 437Zeile 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 450Zeile 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 466Zeile 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

	}

// Fetch any attachments

Zeile 480Zeile 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;
}
}


	// Fetch any posts
if(!is_array($posts) && count($pid_list) > 0)
{

	// Fetch any posts
if(!is_array($posts) && count($pid_list) > 0)
{

Zeile 498Zeile 523
	// 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 526Zeile 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 551Zeile 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 662Zeile 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 686Zeile 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 810Zeile 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 824Zeile 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":

		// 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 913Zeile 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);

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

	$plugins->run_hooks("build_friendly_wol_location_end", $plugin_array);

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