Vergleich inc/functions_online.php - 1.4.0 - 1.4.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*

 * $Id: functions_online.php 4058 2008-08-03 00:37:09Z Tikitiki $

 * $Id: functions_online.php 4427 2009-08-13 21:22:07Z RyanGordon $

 */

$uid_list = $aid_list = $pid_list = $tid_list = $fid_list = $eid_list = array();

 */

$uid_list = $aid_list = $pid_list = $tid_list = $fid_list = $eid_list = array();

Zeile 17Zeile 17
 * @param string The location (URL) of the user.
* @return array Array of location and activity information
*/

 * @param string The location (URL) of the user.
* @return array Array of location and activity information
*/

function fetch_wol_activity($location)

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, $eid_list, $plugins, $user, $parameters;


Zeile 34Zeile 34
	}
if($split_loc[1])
{

	}
if($split_loc[1])
{

		$temp = explode("&", my_substr($split_loc[1], 1));

		$temp = explode("&", my_substr($split_loc[1], 1));

		foreach($temp as $param)
{
$temp2 = explode("=", $param, 2);
$parameters[$temp2[0]] = $temp2[1];
}
}

		foreach($temp as $param)
{
$temp2 = explode("=", $param, 2);
$parameters[$temp2[0]] = $temp2[1];
}
}

 
	
if($nopermission)
{
$filename = "nopermission";
}



switch($filename)
{


switch($filename)
{

Zeile 230Zeile 236
			if(is_numeric($parameters['fid']))
{
$fid_list[] = $parameters['fid'];

			if(is_numeric($parameters['fid']))
{
$fid_list[] = $parameters['fid'];

			}

			}

			$user_activity['activity'] = "newthread";
$user_activity['fid'] = $parameters['fid'];
break;
case "online":
if($parameters['action'] == "today")

			$user_activity['activity'] = "newthread";
$user_activity['fid'] = $parameters['fid'];
break;
case "online":
if($parameters['action'] == "today")

			{

			{

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

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

			}

			}

			break;
case "polls":
// Make the "do" parts the same as the other one.
if($parameters['action'] == "do_newpoll")

			break;
case "polls":
// Make the "do" parts the same as the other one.
if($parameters['action'] == "do_newpoll")

			{

			{

				$user_activity['activity'] = "newpoll";
}
elseif($parameters['action'] == "do_editpoll")
{
$user_activity['activity'] = "editpoll";

				$user_activity['activity'] = "newpoll";
}
elseif($parameters['action'] == "do_editpoll")
{
$user_activity['activity'] = "editpoll";

			}
else
{
$user_activity['activity'] = $parameters['action'];
}
break;















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

foreach($accepted_parameters as $action)
{
if($parameters['action'] == $action)
{
$user_activity['activity'] = $action;
break;
}
}

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

		case "printthread":
if(is_numeric($parameters['tid']))
{

		case "printthread":
if(is_numeric($parameters['tid']))
{

Zeile 266Zeile 286
			}
$user_activity['activity'] = "printthread";
$user_activity['tid'] = $parameters['tid'];

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

 
			break;

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

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

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

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

			break;

			break;

		case "ratethread":
$user_activity['activity'] = "ratethread";

		case "ratethread":
$user_activity['activity'] = "ratethread";

			break;

			break;

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

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

			break;

			break;

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

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

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

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

			}
break;

			}
break;

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

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

Zeile 378Zeile 399
			{
$user_activity['activity'] = "usercp2_favorites";
}

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

			elseif($parameters['action'] == "addsubscription" || $parameters['action'] == "removesubscription" || $parameters['action'] == "removesubscription")

			else if($parameters['action'] == "addsubscription" || $parameters['action'] == "do_addsubscription" || $parameters['action'] == "removesubscription" || $parameters['action'] == "removesubscriptions")

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

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

Zeile 406Zeile 427
			break;
case "nopermission":
$user_activity['activity'] = "nopermission";

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

 
			$user_activity['nopermission'] = 1;

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


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


	$user_activity['location'] = $location;

	$user_activity['location'] = htmlspecialchars_uni($location);

	
$plugins->run_hooks_by_ref("fetch_wol_activity_end", $user_activity);


	
$plugins->run_hooks_by_ref("fetch_wol_activity_end", $user_activity);


Zeile 425Zeile 447
 * @param array Array containing activity and essential IDs.
* @return string Location name for the activity being performed.
*/

 * @param array Array containing activity and essential IDs.
* @return string Location name for the activity being performed.
*/

function build_friendly_wol_location($user_activity, $return=false)

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 $db, $lang, $uid_list, $aid_list, $pid_list, $tid_list, $fid_list, $eid_list, $plugins, $parser, $mybb;

	global $threads, $forums, $forums_linkto, $posts, $events, $users, $attachments;

	global $threads, $forums, $forums_linkto, $posts, $events, $usernames, $attachments;


// Fetch forum permissions for this user
$unviewableforums = get_unviewable_forums();


// Fetch forum permissions for this user
$unviewableforums = get_unviewable_forums();

Zeile 438Zeile 460
	}

// Fetch any users

	}

// Fetch any users

	if(!is_array($users) && count($uid_list) > 0)

	if(!is_array($usernames) && count($uid_list) > 0)

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

			$users[$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)
{

Zeile 511Zeile 533
	}

// Now we've got everything we need we can put a name to the location

	}

// Now we've got everything we need we can put a name to the location

	switch($user_activity['activity']['activity'])

	switch($user_activity['activity'])

	{
// announcement.php functions
case "announcements":

	{
// announcement.php functions
case "announcements":

Zeile 592Zeile 614
			$location_name = $lang->activating_account;
break;
case "member_profile":

			$location_name = $lang->activating_account;
break;
case "member_profile":

			if($users[$user_activity['uid']])

			if($usernames[$user_activity['uid']])

			{

			{

				$location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $users[$user_activity['uid']]);

				$location_name = $lang->sprintf($lang->viewing_profile2, get_profile_link($user_activity['uid']), $usernames[$user_activity['uid']]);

			}
else
{

			}
else
{

Zeile 621Zeile 643
			break;
case "member_emailuser":
$location_name = $lang->emailing_user;

			break;
case "member_emailuser":
$location_name = $lang->emailing_user;

			break;

			break;

		case "member_rate":
$location_name = $lang->rating_user;
break;

		case "member_rate":
$location_name = $lang->rating_user;
break;

Zeile 645Zeile 667
				$location_name = $lang->sprintf($lang->viewing_whoposted2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']]);
}
else

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

			{

			{

				$location_name = $lang->viewing_whoposted;
}

				$location_name = $lang->viewing_whoposted;
}

			break;

			break;

		case "misc_markread":
$location_name = $lang->marking_read;

		case "misc_markread":
$location_name = $lang->marking_read;

			break;

			break;

		case "misc_help":
$location_name = $lang->viewing_helpdocs;
break;
case "misc_buddypopup":
$location_name = $lang->viewing_buddylist;

		case "misc_help":
$location_name = $lang->viewing_helpdocs;
break;
case "misc_buddypopup":
$location_name = $lang->viewing_buddylist;

			break;

			break;

		case "misc_smilies":
$location_name = $lang->viewing_smilies;
break;

		case "misc_smilies":
$location_name = $lang->viewing_smilies;
break;

Zeile 716Zeile 738
			if($user_activity['pid'])
{
$user_activity['tid'] = $posts[$user_activity['pid']];

			if($user_activity['pid'])
{
$user_activity['tid'] = $posts[$user_activity['pid']];

			}

			}

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

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

Zeile 740Zeile 762
		// online.php functions
case "wol":
$location_name = $lang->viewing_wol;

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

			break;

			break;

		case "woltoday":
$location_name = $lang->viewing_woltoday;
break;

		case "woltoday":
$location_name = $lang->viewing_woltoday;
break;

Zeile 757Zeile 779
		case "vote":
$location_name = $lang->voting_poll;
break;

		case "vote":
$location_name = $lang->voting_poll;
break;

		// postings.php functions
case "postings":
$location_name = $lang->using_modtools;








		// printthread.php functions
case "printthread":
if($threads[$user_activity['tid']])
{
$location_name = $lang->sprintf($lang->printing_thread2, get_thread_link($user_activity['tid']), $threads[$user_activity['tid']]);
}
else
{
$location_name = $lang->printing_thread;
}

			break;
// private.php functions
case "private_send":

			break;
// private.php functions
case "private_send":

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

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

			break;

			break;

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

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

Zeile 789Zeile 818
		// 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']);

			break;

			break;

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

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

Zeile 801Zeile 830
			{
$location_name = $lang->reading_thread;
}

			{
$location_name = $lang->reading_thread;
}

			break;

			break;

		// showteam.php functions
case "showteam":
$location_name = $lang->viewing_team;

		// showteam.php functions
case "showteam":
$location_name = $lang->viewing_team;

Zeile 813Zeile 842
		// usercp.php functions
case "usercp_profile":
$location_name = $lang->updating_profile;

		// usercp.php functions
case "usercp_profile":
$location_name = $lang->updating_profile;

 
			break;
case "usercp_editlists":
$location_name = $lang->managing_buddyignorelist;

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

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

Zeile 890Zeile 922
 */
function build_wol_row($user)
{

 */
function build_wol_row($user)
{

	global $mybb, $lang, $templates, $themes, $session;

	global $mybb, $lang, $templates, $theme, $session;


// We have a registered user
if($user['uid'] > 0)


// We have a registered user
if($user['uid'] > 0)

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

// Fetch the location name for this users activity

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

// Fetch the location name for this users activity

	$location = build_friendly_wol_location($user);

	$location = build_friendly_wol_location($user['activity']);


// Can view IPs, then fetch the IP template
if($mybb->usergroup['canviewonlineips'] == 1)


// Can view IPs, then fetch the IP template
if($mybb->usergroup['canviewonlineips'] == 1)