Vergleich index.php - 1.8.3 - 1.8.27

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 19Zeile 19
require_once MYBB_ROOT.'inc/functions_forumlist.php';
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;

require_once MYBB_ROOT.'inc/functions_forumlist.php';
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;


$plugins->run_hooks('index_start');

 

// Load global language phrases
$lang->load('index');


// Load global language phrases
$lang->load('index');






$plugins->run_hooks('index_start');


$logoutlink = '';
if($mybb->user['uid'] != 0)
{

$logoutlink = '';
if($mybb->user['uid'] != 0)
{

Zeile 34Zeile 34
$statspage = '';
if($mybb->settings['statsenabled'] != 0)
{

$statspage = '';
if($mybb->settings['statsenabled'] != 0)
{

 
	$stats_page_separator = '';
if(!empty($logoutlink))
{
$stats_page_separator = $lang->board_stats_link_separator;
}

	eval('$statspage = "'.$templates->get('index_statspage').'";');
}

	eval('$statspage = "'.$templates->get('index_statspage').'";');
}





$whosonline = '';
if($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)
{

$whosonline = '';
if($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0)
{

Zeile 45Zeile 50
	{
$order_by = 'u.username ASC';
$order_by2 = 's.time DESC';

	{
$order_by = 'u.username ASC';
$order_by2 = 's.time DESC';

	}

	}

	else
{
$order_by = 's.time DESC';

	else
{
$order_by = 's.time DESC';

Zeile 53Zeile 58
	}

$timesearch = TIME_NOW - (int)$mybb->settings['wolcutoff'];

	}

$timesearch = TIME_NOW - (int)$mybb->settings['wolcutoff'];

	$comma = '';

























$membercount = $guestcount = $anoncount = $botcount = 0;
$forum_viewers = $doneusers = $onlinemembers = $onlinebots = array();

if($mybb->settings['showforumviewing'] != 0)
{
$query = $db->query("
SELECT
location1, COUNT(DISTINCT ip) AS guestcount
FROM
".TABLE_PREFIX."sessions
WHERE uid = 0 AND location1 != 0 AND SUBSTR(sid,4,1) != '=' AND time > $timesearch
GROUP BY location1
");

while($location = $db->fetch_array($query))
{
$forum_viewers[$location['location1']] += $location['guestcount'];
}
}

$query = $db->simple_select("sessions", "COUNT(DISTINCT ip) AS guestcount", "uid = 0 AND SUBSTR(sid,4,1) != '=' AND time > $timesearch");
$guestcount = $db->fetch_field($query, "guestcount");


	$query = $db->query("

	$query = $db->query("

		SELECT s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
FROM ".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE s.time > '".$timesearch."'



		SELECT
s.sid, s.ip, s.uid, s.time, s.location, s.location1, u.username, u.invisible, u.usergroup, u.displaygroup
FROM
".TABLE_PREFIX."sessions s
LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
WHERE (s.uid != 0 OR SUBSTR(s.sid,4,1) = '=') AND s.time > $timesearch

		ORDER BY {$order_by}, {$order_by2}
");

		ORDER BY {$order_by}, {$order_by2}
");


$forum_viewers = $doneusers = array();
$membercount = $guestcount = $anoncount = $botcount = 0;
$onlinemembers = $comma = '';

 

// Fetch spiders
$spiders = $cache->read('spiders');



// Fetch spiders
$spiders = $cache->read('spiders');


	// Loop through all users.

	// Loop through all users and spiders.

	while($user = $db->fetch_array($query))
{
// Create a key to test if this user is a search bot.

	while($user = $db->fetch_array($query))
{
// Create a key to test if this user is a search bot.

Zeile 82Zeile 108
			if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time'])
{
// If the user is logged in anonymously, update the count for that.

			if(empty($doneusers[$user['uid']]) || $doneusers[$user['uid']] < $user['time'])
{
// If the user is logged in anonymously, update the count for that.

				if($user['invisible'] == 1)

				if($user['invisible'] == 1 && $mybb->usergroup['canbeinvisible'] == 1)

				{
++$anoncount;
}

				{
++$anoncount;
}

Zeile 90Zeile 116
				if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{
// If this usergroup can see anonymously logged-in users, mark them.

				if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
{
// If this usergroup can see anonymously logged-in users, mark them.

					if($user['invisible'] == 1)

					if($user['invisible'] == 1 && $mybb->usergroup['canbeinvisible'] == 1)

					{
$invisiblemark = '*';

					{
$invisiblemark = '*';

					}

					}

					else
{
$invisiblemark = '';

					else
{
$invisiblemark = '';

					}


					}


					// Properly format the username and assign the template.

					// Properly format the username and assign the template.

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

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

					$user['profilelink'] = build_profile_link($user['username'], $user['uid']);

					$user['profilelink'] = build_profile_link($user['username'], $user['uid']);

					eval('$onlinemembers .= "'.$templates->get('index_whosonline_memberbit', 1, 0).'";');
$comma = $lang->comma;

					eval('$onlinemembers[] = "'.$templates->get('index_whosonline_memberbit', 1, 0).'";');


				}
// This user has been handled.
$doneusers[$user['uid']] = $user['time'];
}
}

				}
// This user has been handled.
$doneusers[$user['uid']] = $user['time'];
}
}

		elseif(my_strpos($user['sid'], 'bot=') !== false && $spiders[$botkey])

		elseif(my_strpos($user['sid'], 'bot=') !== false && $spiders[$botkey] && $mybb->settings['woldisplayspiders'] == 1)

		{

		{

 
			if($mybb->settings['wolorder'] == 'username')
{
$key = $spiders[$botkey]['name'];
}
else
{
$key = $user['time'];
}


			// The user is a search bot.

			// The user is a search bot.

			$onlinemembers .= $comma.format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']);
$comma = $lang->comma;

			$onlinebots[$key] = format_name($spiders[$botkey]['name'], $spiders[$botkey]['usergroup']);


			++$botcount;

			++$botcount;

		}
else
{
// The user is a guest.
++$guestcount;
}


		}







		if($user['location1'])
{
++$forum_viewers[$user['location1']];
}

		if($user['location1'])
{
++$forum_viewers[$user['location1']];
}

 
	}

if($mybb->settings['wolorder'] == 'activity')
{
// activity ordering is DESC, username is ASC
krsort($onlinebots);
}
else
{
ksort($onlinebots);
}

$onlinemembers = array_merge($onlinebots, $onlinemembers);
if(!empty($onlinemembers))
{
$comma = $lang->comma." ";
$onlinemembers = implode($comma, $onlinemembers);
}
else
{
$onlinemembers = "";

	}

// Build the who's online bit on the index page.

	}

// Build the who's online bit on the index page.

Zeile 134Zeile 183
	if($onlinecount != 1)
{
$onlinebit = $lang->online_online_plural;

	if($onlinecount != 1)
{
$onlinebit = $lang->online_online_plural;

	}

	}

	else
{
$onlinebit = $lang->online_online_singular;

	else
{
$onlinebit = $lang->online_online_singular;

Zeile 142Zeile 191
	if($membercount != 1)
{
$memberbit = $lang->online_member_plural;

	if($membercount != 1)
{
$memberbit = $lang->online_member_plural;

	}

	}

	else
{
$memberbit = $lang->online_member_singular;

	else
{
$memberbit = $lang->online_member_singular;

Zeile 150Zeile 199
	if($anoncount != 1)
{
$anonbit = $lang->online_anon_plural;

	if($anoncount != 1)
{
$anonbit = $lang->online_anon_plural;

	}
else

	}
else

	{
$anonbit = $lang->online_anon_singular;
}
if($guestcount != 1)

	{
$anonbit = $lang->online_anon_singular;
}
if($guestcount != 1)

	{

	{

		$guestbit = $lang->online_guest_plural;
}
else

		$guestbit = $lang->online_guest_plural;
}
else

Zeile 177Zeile 226
	$year = my_date('Y', TIME_NOW, '', 0);

$bdaycache = $cache->read('birthdays');

	$year = my_date('Y', TIME_NOW, '', 0);

$bdaycache = $cache->read('birthdays');





	if(!is_array($bdaycache))
{
$cache->update_birthdays();

	if(!is_array($bdaycache))
{
$cache->update_birthdays();

Zeile 241Zeile 290
					$age = ' ('.($year - $bday['2']).')';
}


					$age = ' ('.($year - $bday['2']).')';
}


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

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

				$bdayuser['profilelink'] = build_profile_link($bdayuser['username'], $bdayuser['uid']);
eval('$bdays .= "'.$templates->get('index_birthdays_birthday', 1, 0).'";');
++$bdaycount;
$comma = $lang->comma;
}

				$bdayuser['profilelink'] = build_profile_link($bdayuser['username'], $bdayuser['uid']);
eval('$bdays .= "'.$templates->get('index_birthdays_birthday', 1, 0).'";');
++$bdaycount;
$comma = $lang->comma;
}

		}
}

		}
}


if($hiddencount > 0)
{


if($hiddencount > 0)
{

Zeile 262Zeile 311

// If there are one or more birthdays, show them.
if($bdaycount > 0 || $hiddencount > 0)


// If there are one or more birthdays, show them.
if($bdaycount > 0 || $hiddencount > 0)

	{

	{

		eval('$birthdays = "'.$templates->get('index_birthdays').'";');
}
}

		eval('$birthdays = "'.$templates->get('index_birthdays').'";');
}
}





// Build the forum statistics to show on the index page.
$forumstats = '';
if($mybb->settings['showindexstats'] != 0)

// Build the forum statistics to show on the index page.
$forumstats = '';
if($mybb->settings['showindexstats'] != 0)

Zeile 282Zeile 331
	else
{
$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);

	else
{
$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);

	}


	}


	// Format the stats language.
$lang->stats_posts_threads = $lang->sprintf($lang->stats_posts_threads, my_number_format($stats['numposts']), my_number_format($stats['numthreads']));
$lang->stats_numusers = $lang->sprintf($lang->stats_numusers, my_number_format($stats['numusers']));
$lang->stats_newestuser = $lang->sprintf($lang->stats_newestuser, $newestmember);

	// Format the stats language.
$lang->stats_posts_threads = $lang->sprintf($lang->stats_posts_threads, my_number_format($stats['numposts']), my_number_format($stats['numthreads']));
$lang->stats_numusers = $lang->sprintf($lang->stats_numusers, my_number_format($stats['numusers']));
$lang->stats_newestuser = $lang->sprintf($lang->stats_newestuser, $newestmember);





	// Find out what the highest users online count is.
$mostonline = $cache->read('mostonline');
if($onlinecount > $mostonline['numusers'])

	// Find out what the highest users online count is.
$mostonline = $cache->read('mostonline');
if($onlinecount > $mostonline['numusers'])

	{

	{

		$time = TIME_NOW;
$mostonline['numusers'] = $onlinecount;
$mostonline['time'] = $time;

		$time = TIME_NOW;
$mostonline['numusers'] = $onlinecount;
$mostonline['time'] = $time;

Zeile 313Zeile 362
if(($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0) || $mybb->settings['showindexstats'] != 0 || ($mybb->settings['showbirthdays'] != 0 && $bdaycount > 0))
{
if(!isset($stats) || isset($stats) && !is_array($stats))

if(($mybb->settings['showwol'] != 0 && $mybb->usergroup['canviewonline'] != 0) || $mybb->settings['showindexstats'] != 0 || ($mybb->settings['showbirthdays'] != 0 && $bdaycount > 0))
{
if(!isset($stats) || isset($stats) && !is_array($stats))

	{

	{

		// Load the stats cache.
$stats = $cache->read('stats');

		// Load the stats cache.
$stats = $cache->read('stats');

	}

	}





	$post_code_string = '';
if($mybb->user['uid'])








	if(!isset($collapsedthead['boardstats']))
{
$collapsedthead['boardstats'] = '';
}
if(!isset($collapsedimg['boardstats']))
{
$collapsedimg['boardstats'] = '';
}
if(!isset($collapsed['boardstats_e']))

	{

	{

		$post_code_string = '&amp;my_post_key='.$mybb->post_code;

		$collapsed['boardstats_e'] = '';

	}


	}


 
	$expaltext = (in_array("boardstats", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

	eval('$boardstats = "'.$templates->get('index_boardstats').'";');
}


	eval('$boardstats = "'.$templates->get('index_boardstats').'";');
}


Zeile 371Zeile 428
}

$excols = 'index';

}

$excols = 'index';

$permissioncache['-1'] = '1';

$permissioncache = null;

$bgcolor = 'trow1';

// Decide if we're showing first-level subforums on the index page.

$bgcolor = 'trow1';

// Decide if we're showing first-level subforums on the index page.