Vergleich inc/functions_online.php - 1.6.3 - 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 5380 2011-02-21 12:04:43Z Tomm $

 * $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 336Zeile 349
				$user_activity['pid'] = $parameters['pid'];
}
else

				$user_activity['pid'] = $parameters['pid'];
}
else

			{

			{

				if($parameters['page'])
{
$user_activity['page'] = $parameters['page'];

				if($parameters['page'])
{
$user_activity['page'] = $parameters['page'];

Zeile 360Zeile 373
			elseif($parameters['action'] == "options" || $parameters['action'] == "do_options")
{
$user_activity['activity'] = "usercp_options";

			elseif($parameters['action'] == "options" || $parameters['action'] == "do_options")
{
$user_activity['activity'] = "usercp_options";

			}

			}

			elseif($parameters['action'] == "password" || $parameters['action'] == "do_password")

			elseif($parameters['action'] == "password" || $parameters['action'] == "do_password")

			{

			{

				$user_activity['activity'] = "usercp_password";
}
elseif($parameters['action'] == "editsig" || $parameters['action'] == "do_editsig")
{
$user_activity['activity'] = "usercp_editsig";

				$user_activity['activity'] = "usercp_password";
}
elseif($parameters['action'] == "editsig" || $parameters['action'] == "do_editsig")
{
$user_activity['activity'] = "usercp_editsig";

			}

			}

			elseif($parameters['action'] == "avatar" || $parameters['action'] == "do_avatar")

			elseif($parameters['action'] == "avatar" || $parameters['action'] == "do_avatar")

			{

			{

				$user_activity['activity'] = "usercp_avatar";
}
elseif($parameters['action'] == "editlists" || $parameters['action'] == "do_editlists")
{
$user_activity['activity'] = "usercp_editlists";

				$user_activity['activity'] = "usercp_avatar";
}
elseif($parameters['action'] == "editlists" || $parameters['action'] == "do_editlists")
{
$user_activity['activity'] = "usercp_editlists";

			}

			}

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

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

			{

			{

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

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

			}

			}

			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";

			}
else

			}
else

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

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

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

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

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

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

			}
else
{

			}
else
{

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 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;

		}
}


		}
}


Zeile 501Zeile 526
		$perms = array();
$tid_sql = implode(",", $tid_list);
$query = $db->query("

		$perms = array();
$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}

Zeile 514Zeile 539
				$perms[$thread['fid']] = forum_permissions($thread['fid']);
}


				$perms[$thread['fid']] = forum_permissions($thread['fid']);
}


			if($perms[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])

			if($perms[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'] && !is_moderator($thread['fid']))

			{
continue;
}

			{
continue;
}

Zeile 538Zeile 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'];
}

		}
}

// And finaly any events
if(!is_array($events) && count($eid_list) > 0)

		}
}

// And finaly any events
if(!is_array($events) && count($eid_list) > 0)

	{

	{

		$eid_sql = implode(",", $eid_list);
$query = $db->simple_select("events", "eid,name", "eid IN ($eid_sql)");
while($event = $db->fetch_array($query))

		$eid_sql = implode(",", $eid_list);
$query = $db->simple_select("events", "eid,name", "eid IN ($eid_sql)");
while($event = $db->fetch_array($query))

Zeile 563Zeile 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 674Zeile 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 698Zeile 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 839Zeile 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 874Zeile 915
			break;
case "usercp_options":
$location_name = $lang->updating_options;

			break;
case "usercp_options":
$location_name = $lang->updating_options;

			break;

			break;

		case "usercp_editsig":
$location_name = $lang->editing_signature;
break;

		case "usercp_editsig":
$location_name = $lang->editing_signature;
break;

Zeile 918Zeile 959
			break;
case "warnings_view":
$location_name = $lang->viewing_warning;

			break;
case "warnings_view":
$location_name = $lang->viewing_warning;

			break;

			break;

		case "warnings":
$location_name = $lang->managing_warnings;
break;
}

$plugin_array = array('user_activity' => &$user_activity, 'location_name' => &$location_name);

		case "warnings":
$location_name = $lang->managing_warnings;
break;
}

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