Vergleich inc/functions_online.php - 1.8.4 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 13Zeile 13
/**
* Fetch a users activity and any corresponding details from their location.
*

/**
* Fetch a users activity and any corresponding details from their location.
*

 * @param string The location (URL) of the user.


 * @param string $location The location (URL) of the user.
* @param bool $nopermission

 * @return array Array of location and activity information
*/
function fetch_wol_activity($location, $nopermission=false)

 * @return array Array of location and activity information
*/
function fetch_wol_activity($location, $nopermission=false)

Zeile 32Zeile 33
		$filename = my_substr($split_loc[0], -my_strpos(strrev($split_loc[0]), "/"));
}
$parameters = array();

		$filename = my_substr($split_loc[0], -my_strpos(strrev($split_loc[0]), "/"));
}
$parameters = array();

	if($split_loc[1])

	if(isset($split_loc[1]))

	{
$temp = explode("&", my_substr($split_loc[1], 1));
foreach($temp as $param)

	{
$temp = explode("&", my_substr($split_loc[1], 1));
foreach($temp as $param)

Zeile 160Zeile 161
			elseif($parameters['action'] == "profile")
{
$user_activity['activity'] = "member_profile";

			elseif($parameters['action'] == "profile")
{
$user_activity['activity'] = "member_profile";

 


				if(!isset($parameters['uid']))

				if(!isset($parameters['uid']))

				{

				{

					$parameters['uid'] = 0;
}
$parameters['uid'] = (int)$parameters['uid'];

					$parameters['uid'] = 0;
}
$parameters['uid'] = (int)$parameters['uid'];

 

if($parameters['uid'] == 0)
{
global $memprofile;

// $user is available in Who's Online but not in Member Profile, use $memprofile instead
if(!empty($user['uid']))
{
$parameters['uid'] = $user['uid'];
}
elseif(!empty($memprofile['uid']))
{
$parameters['uid'] = $memprofile['uid'];
}
}


				if($parameters['uid'] > 0)
{
$uid_list[$parameters['uid']] = $parameters['uid'];
}
$user_activity['uid'] = $parameters['uid'];

				if($parameters['uid'] > 0)
{
$uid_list[$parameters['uid']] = $parameters['uid'];
}
$user_activity['uid'] = $parameters['uid'];

			}

			}

			elseif($parameters['action'] == "emailuser" || $parameters['action'] == "do_emailuser")
{
$user_activity['activity'] = "member_emailuser";

			elseif($parameters['action'] == "emailuser" || $parameters['action'] == "do_emailuser")
{
$user_activity['activity'] = "member_emailuser";

Zeile 200Zeile 218
			{
$parameters['action'] = '';
}

			{
$parameters['action'] = '';
}

			$accepted_parameters = array("markread", "help", "buddypopup", "smilies", "syndication", "imcenter", "dstswitch");

			$accepted_parameters = array("markread", "help", "buddypopup", "smilies", "syndication", "dstswitch");

			if($parameters['action'] == "whoposted")
{
if(!isset($parameters['tid']))

			if($parameters['action'] == "whoposted")
{
if(!isset($parameters['tid']))

				{

				{

					$parameters['tid'] = 0;
}
$parameters['tid'] = (int)$parameters['tid'];

					$parameters['tid'] = 0;
}
$parameters['tid'] = (int)$parameters['tid'];

Zeile 226Zeile 244
			break;
case "modcp":
if(!isset($parameters['action']))

			break;
case "modcp":
if(!isset($parameters['action']))

			{
$parameters['action'] = 0;

			{
$parameters['action'] = '';

			}

$accepted_parameters = array("modlogs", "announcements", "finduser", "warninglogs", "ipsearch");

			}

$accepted_parameters = array("modlogs", "announcements", "finduser", "warninglogs", "ipsearch");

Zeile 249Zeile 267
			$accepted_parameters['mod_queue'] = array("do_modqueue", "modqueue");
$accepted_parameters['editprofile'] = array("do_editprofile", "editprofile");
$accepted_parameters['banning'] = array("do_banuser", "banning", "liftban", "banuser");

			$accepted_parameters['mod_queue'] = array("do_modqueue", "modqueue");
$accepted_parameters['editprofile'] = array("do_editprofile", "editprofile");
$accepted_parameters['banning'] = array("do_banuser", "banning", "liftban", "banuser");





			foreach($accepted_parameters as $name => $actions)
{
if(in_array($parameters['action'], $actions))

			foreach($accepted_parameters as $name => $actions)
{
if(in_array($parameters['action'], $actions))

Zeile 260Zeile 278
			}

if(empty($user_activity['activity']))

			}

if(empty($user_activity['activity']))

			{

			{

				$user_activity['activity'] = "modcp";
}

				$user_activity['activity'] = "modcp";
}

			break;

			break;

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

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

Zeile 271Zeile 289
			if(!isset($parameters['tid']))
{
$parameters['tid'] = 0;

			if(!isset($parameters['tid']))
{
$parameters['tid'] = 0;

			}

			}

			$parameters['tid'] = (int)$parameters['tid'];
if($parameters['tid'] > 0)
{

			$parameters['tid'] = (int)$parameters['tid'];
if($parameters['tid'] > 0)
{

Zeile 282Zeile 300
			break;
case "newthread":
if(!isset($parameters['fid']))

			break;
case "newthread":
if(!isset($parameters['fid']))

			{

			{

				$parameters['fid'] = 0;
}
$parameters['fid'] = (int)$parameters['fid'];

				$parameters['fid'] = 0;
}
$parameters['fid'] = (int)$parameters['fid'];

Zeile 326Zeile 344
				$accepted_parameters = array("do_editpoll", "editpoll", "newpoll", "do_newpoll", "showresults", "vote");

foreach($accepted_parameters as $action)

				$accepted_parameters = array("do_editpoll", "editpoll", "newpoll", "do_newpoll", "showresults", "vote");

foreach($accepted_parameters as $action)

				{

				{

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

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

Zeile 334Zeile 352
					}
}


					}
}


				if(!$user_activity['activity'])

				if(empty($user_activity['activity']))

				{
$user_activity['activity'] = "showresults";

				{
$user_activity['activity'] = "showresults";

				}
}

				}
}

			break;
case "printthread":

			break;
case "printthread":

			if(!isset($parameters['tid']))
{
$parameters['tid'] = 0;
}
$parameters['tid'] = (int)$parameters['tid'];
if($parameters['tid'] > 0)
{

			if(!isset($parameters['tid']))
{
$parameters['tid'] = 0;
}
$parameters['tid'] = (int)$parameters['tid'];
if($parameters['tid'] > 0)
{

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

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

Zeile 357Zeile 375
			if(!isset($parameters['action']))
{
$parameters['action'] = '';

			if(!isset($parameters['action']))
{
$parameters['action'] = '';

			}
if($parameters['action'] == "send" || $parameters['action'] == "do_send")
{

			}
if($parameters['action'] == "send" || $parameters['action'] == "do_send")
{

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

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

			}

			}

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

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

			{

			{

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

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

			}
elseif($parameters['action'] == "folders" || $parameters['action'] == "do_folders")
{
$user_activity['activity'] = "private_folders";

			}
elseif($parameters['action'] == "folders" || $parameters['action'] == "do_folders")
{
$user_activity['activity'] = "private_folders";

			}
else
{

			}
else
{

Zeile 382Zeile 400
			$user_activity['activity'] = "report";
break;
case "reputation":

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

 
            if(!isset($parameters['action']))
{
$parameters['action'] = '';
}

			if(!isset($parameters['uid']))
{
$parameters['uid'] = 0;

			if(!isset($parameters['uid']))
{
$parameters['uid'] = 0;

Zeile 390Zeile 412
			if($parameters['uid'] > 0)
{
$uid_list[$parameters['uid']] = $parameters['uid'];

			if($parameters['uid'] > 0)
{
$uid_list[$parameters['uid']] = $parameters['uid'];

			}

			}

			$user_activity['uid'] = $parameters['uid'];

if($parameters['action'] == "add")

			$user_activity['uid'] = $parameters['uid'];

if($parameters['action'] == "add")

			{

			{

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

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

			}

			}

			else
{
$user_activity['activity'] = "reputation_report";

			else
{
$user_activity['activity'] = "reputation_report";

			}

			}

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

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

Zeile 422Zeile 444
			$user_activity['activity'] = "showteam";
break;
case "showthread":

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

			if(!isset($parameters['action']))
{
$parameters['action'] = 0;
}
if(!isset($parameters['pid']))

			if(!isset($parameters['action']))
{
$parameters['action'] = '';
}
if(!isset($parameters['pid']))

			{
$parameters['pid'] = 0;
}

			{
$parameters['pid'] = 0;
}

Zeile 436Zeile 458
				$pid_list[$parameters['pid']] = $parameters['pid'];
$user_activity['activity'] = "showpost";
$user_activity['pid'] = $parameters['pid'];

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

			}

			}

			else
{
if(!isset($parameters['page']))

			else
{
if(!isset($parameters['page']))

Zeile 469Zeile 491
			if($parameters['action'] == "profile" || $parameters['action'] == "do_profile")
{
$user_activity['activity'] = "usercp_profile";

			if($parameters['action'] == "profile" || $parameters['action'] == "do_profile")
{
$user_activity['activity'] = "usercp_profile";

			}

			}

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

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

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

			{

			{

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

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

			}

			}

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

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

			{

			{

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

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

 
			}
elseif($parameters['action'] == "addfavorite" || $parameters['action'] == "removefavorite" || $parameters['action'] == "removefavorites")
{
$user_activity['activity'] = "usercp_managefavorites";
}
else if($parameters['action'] == "addsubscription" || $parameters['action'] == "do_addsubscription" || $parameters['action'] == "removesubscription" || $parameters['action'] == "removesubscriptions")
{
$user_activity['activity'] = "usercp_managesubscriptions";

			}
elseif($parameters['action'] == "notepad" || $parameters['action'] == "do_notepad")
{

			}
elseif($parameters['action'] == "notepad" || $parameters['action'] == "do_notepad")
{

Zeile 505Zeile 535
			else
{
$user_activity['activity'] = "usercp";

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

			}
break;
case "usercp2":
if(!isset($parameters['action']))
{
$parameters['action'] = '';
}
if($parameters['action'] == "addfavorite" || $parameters['action'] == "removefavorite" || $parameters['action'] == "removefavorites")
{
$user_activity['activity'] = "usercp2_favorites";
}
else if($parameters['action'] == "addsubscription" || $parameters['action'] == "do_addsubscription" || $parameters['action'] == "removesubscription" || $parameters['action'] == "removesubscriptions")
{
$user_activity['activity'] = "usercp2_subscriptions";

 
			}
break;
case "portal":

			}
break;
case "portal":

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

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

			break;

			break;

		default:
$user_activity['activity'] = "unknown";
break;

		default:
$user_activity['activity'] = "unknown";
break;

Zeile 557Zeile 573

// Expects $location to be passed through already sanitized
$user_activity['location'] = $location;


// Expects $location to be passed through already sanitized
$user_activity['location'] = $location;





	$user_activity = $plugins->run_hooks("fetch_wol_activity_end", $user_activity);

	$user_activity = $plugins->run_hooks("fetch_wol_activity_end", $user_activity);





	return $user_activity;
}

/**
* Builds a friendly named Who's Online location from an "activity" and array of user data. Assumes fetch_wol_activity has already been called.
*

	return $user_activity;
}

/**
* Builds a friendly named Who's Online location from an "activity" and array of user data. Assumes fetch_wol_activity has already been called.
*

 * @param array Array containing activity and essential IDs.

 * @param array $user_activity Array containing activity and essential IDs.

 * @return string Location name for the activity being performed.
*/
function build_friendly_wol_location($user_activity)

 * @return string Location name for the activity being performed.
*/
function build_friendly_wol_location($user_activity)

Zeile 599Zeile 615
			$query = $db->simple_select("users", "uid,username", "uid IN ($uid_sql)");
while($user = $db->fetch_array($query))
{

			$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']] = htmlspecialchars_uni($user['username']);

			}
}
else

			}
}
else

		{
$usernames[$mybb->user['uid']] = $mybb->user['username'];
}
}


		{
$usernames[$mybb->user['uid']] = htmlspecialchars_uni($mybb->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 617Zeile 633
		{
$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)


// Fetch any announcements
if(!is_array($announcements) && count($ann_list) > 0)

Zeile 629Zeile 645
		{
$announcement_title = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
$announcements[$announcement['aid']] = $announcement_title;

		{
$announcement_title = htmlspecialchars_uni($parser->parse_badwords($announcement['subject']));
$announcements[$announcement['aid']] = $announcement_title;

		}

		}

	}

// Fetch any posts

	}

// Fetch any posts

Zeile 694Zeile 710
		foreach($forum_cache as $fid => $forum)
{
if(in_array($fid, $fid_list) && !in_array($fid, $fidnot))

		foreach($forum_cache as $fid => $forum)
{
if(in_array($fid, $fid_list) && !in_array($fid, $fidnot))

			{

			{

				$forums[$fid] = $forum['name'];
$forums_linkto[$fid] = $forum['linkto'];
}

				$forums[$fid] = $forum['name'];
$forums_linkto[$fid] = $forum['linkto'];
}

Zeile 868Zeile 884
			break;
case "misc_syndication":
$location_name = $lang->viewing_syndication;

			break;
case "misc_syndication":
$location_name = $lang->viewing_syndication;

			break;
case "misc_imcenter":
$location_name = $lang->viewing_imcenter;

 
			break;
// modcp.php functions
case "modcp_modlogs":

			break;
// modcp.php functions
case "modcp_modlogs":

Zeile 1070Zeile 1083
		case "usercp":
$location_name = $lang->user_cp;
break;

		case "usercp":
$location_name = $lang->user_cp;
break;

		case "usercp2_favorites":

		case "usercp_managefavorites":

			$location_name = $lang->managing_favorites;
break;

			$location_name = $lang->managing_favorites;
break;

		case "usercp2_subscriptions":

		case "usercp_managesubscriptions":

			$location_name = $lang->managing_subscriptions;
break;
case "portal":

			$location_name = $lang->managing_subscriptions;
break;
case "portal":

Zeile 1117Zeile 1130
/**
* Build a Who's Online row for a specific user
*

/**
* Build a Who's Online row for a specific user
*

 * @param array Array of user information including activity information

 * @param array $user Array of user information including activity information

 * @return string Formatted online row
*/
function build_wol_row($user)

 * @return string Formatted online row
*/
function build_wol_row($user)

Zeile 1140Zeile 1153
				$invisible_mark = '';
}


				$invisible_mark = '';
}


			$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);

			$user['username'] = format_name(htmlspecialchars_uni($user['username']), $user['usergroup'], $user['displaygroup']);

			$online_name = build_profile_link($user['username'], $user['uid']).$invisible_mark;
}
}

			$online_name = build_profile_link($user['username'], $user['uid']).$invisible_mark;
}
}

Zeile 1155Zeile 1168
		$online_name = format_name($lang->guest, 1);
}


		$online_name = format_name($lang->guest, 1);
}


	$online_time = my_date($mybb->settings['timeformat'], $user['time']);

	$online_time = my_date('relative', $user['time']);


// Fetch the location name for this users activity
$location = build_friendly_wol_location($user['activity']);


// Fetch the location name for this users activity
$location = build_friendly_wol_location($user['activity']);

Zeile 1177Zeile 1190
		$user_ip = $lookup = $user['ip'] = '';
}


		$user_ip = $lookup = $user['ip'] = '';
}


 
	$online_row = '';

	// And finally if we have permission to view this user, return the completed online row
if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{

	// And finally if we have permission to view this user, return the completed online row
if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{