Vergleich inc/functions_online.php - 1.8.3 - 1.8.26

  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 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'] = 0;

				}

				}

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

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

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

				}

				}

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

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

			}

			}

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

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

			{

			{

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

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

			}

			}

			elseif($parameters['action'] == "resendactivation" || $parameters['action'] == "do_resendactivation")
{
$user_activity['activity'] = "member_resendactivation";
}
elseif($parameters['action'] == "lostpw" || $parameters['action'] == "do_lostpw" || $parameters['action'] == "resetpassword")

			elseif($parameters['action'] == "resendactivation" || $parameters['action'] == "do_resendactivation")
{
$user_activity['activity'] = "member_resendactivation";
}
elseif($parameters['action'] == "lostpw" || $parameters['action'] == "do_lostpw" || $parameters['action'] == "resetpassword")

			{

			{

				$user_activity['activity'] = "member_lostpw";
}
else

				$user_activity['activity'] = "member_lostpw";
}
else

Zeile 196Zeile 214
			$user_activity['activity'] = "memberlist";
break;
case "misc":

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

			if(!isset($parameters['action']))
{
$parameters['action'] = '';
}
$accepted_parameters = array("markread", "help", "buddypopup", "smilies", "syndication", "imcenter", "dstswitch");
if($parameters['action'] == "whoposted")
{

			if(!isset($parameters['action']))
{
$parameters['action'] = '';
}
$accepted_parameters = array("markread", "help", "buddypopup", "smilies", "syndication", "dstswitch");
if($parameters['action'] == "whoposted")
{

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

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

Zeile 218Zeile 236
			elseif(in_array($parameters['action'], $accepted_parameters))
{
$user_activity['activity'] = "misc_".$parameters['action'];

			elseif(in_array($parameters['action'], $accepted_parameters))
{
$user_activity['activity'] = "misc_".$parameters['action'];

			}

			}

			else

			else

			{

			{

				$user_activity['activity'] = "misc";
}
break;
case "modcp":
if(!isset($parameters['action']))
{

				$user_activity['activity'] = "misc";
}
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 335Zeile 353
				}

if(!$user_activity['activity'])

				}

if(!$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'];
}

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

Zeile 354Zeile 372
			$user_activity['tid'] = $parameters['tid'];
break;
case "private":

			$user_activity['tid'] = $parameters['tid'];
break;
case "private":

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

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

			if($parameters['action'] == "send" || $parameters['action'] == "do_send")
{
$user_activity['activity'] = "private_send";

			if($parameters['action'] == "send" || $parameters['action'] == "do_send")
{
$user_activity['activity'] = "private_send";

Zeile 390Zeile 408
			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;

			}
break;

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

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

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

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

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

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

			{

			{

				$parameters['action'] = 0;

				$parameters['action'] = '';

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

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

Zeile 456Zeile 474
				}
$user_activity['activity'] = "showthread";
$user_activity['tid'] = $parameters['tid'];

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

			}

			}

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

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

Zeile 467Zeile 485
				$parameters['action'] = '';
}
if($parameters['action'] == "profile" || $parameters['action'] == "do_profile")

				$parameters['action'] = '';
}
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_profile";
}
elseif($parameters['action'] == "options" || $parameters['action'] == "do_options")

Zeile 489Zeile 507
			elseif($parameters['action'] == "editlists" || $parameters['action'] == "do_editlists")
{
$user_activity['activity'] = "usercp_editlists";

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

			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 506Zeile 532
			{
$user_activity['activity'] = "usercp";
}

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

			break;















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

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

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

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

			}

			}

			if($parameters['action'] == "warn" || $parameters['action'] == "do_warn")

			if($parameters['action'] == "warn" || $parameters['action'] == "do_warn")

			{

			{

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

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

			}

			}

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

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

			{

			{

				$user_activity['activity'] = "warnings_revoke";
}
elseif($parameters['action'] == "view")

				$user_activity['activity'] = "warnings_revoke";
}
elseif($parameters['action'] == "view")

			{

			{

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

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

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

/**
* 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 578Zeile 590
	$unviewableforums = get_unviewable_forums();
$inactiveforums = get_inactive_forums();
$fidnot = '';

	$unviewableforums = get_unviewable_forums();
$inactiveforums = get_inactive_forums();
$fidnot = '';

 
	$unviewablefids = $inactivefids = array();

	if($unviewableforums)

	if($unviewableforums)

	{

	{

		$fidnot = " AND fid NOT IN ($unviewableforums)";

		$fidnot = " AND fid NOT IN ($unviewableforums)";

 
		$unviewablefids = explode(',', $unviewableforums);

	}
if($inactiveforums)
{
$fidnot .= " AND fid NOT IN ($inactiveforums)";

	}
if($inactiveforums)
{
$fidnot .= " AND fid NOT IN ($inactiveforums)";

 
		$inactivefids = explode(',', $inactiveforums);

	}

// Fetch any users

	}

// Fetch any users

Zeile 596Zeile 611
			$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 614Zeile 629
		{
$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 626Zeile 641
		{
$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 686Zeile 701
	// Fetch any forums
if(!is_array($forums) && count($fid_list) > 0)
{

	// Fetch any forums
if(!is_array($forums) && count($fid_list) > 0)
{

		if($fidnot)
{
$fidnot = explode(',', str_replace('\'', '', (string)$unviewableforums).$inactiveforums);
}

		$fidnot = array_merge($unviewablefids, $inactivefids);





foreach($forum_cache as $fid => $forum)


foreach($forum_cache as $fid => $forum)

		{
if(in_array($fid, $fid_list) && (!$fidnot || is_array($fidnot) && !in_array($fid, $fidnot)))
{

		{
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 880
			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 1079
		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 1126
/**
* 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 1149
				$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 1164
		$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 1186
		$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'])
{