Vergleich online.php - 1.6.0 - 1.6.9

  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: online.php 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id$

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 35Zeile 35

$plugins->run_hooks("online_today_start");



$plugins->run_hooks("online_today_start");


	$todaycount = 0;
$stime = TIME_NOW-(60*60*24);




























	$threshold = TIME_NOW-(60*60*24);
$query = $db->simple_select("users", "COUNT(uid) AS users", "lastactive > '{$threshold}'");
$todaycount = $db->fetch_field($query, "users");

$query = $db->simple_select("users", "COUNT(uid) AS users", "lastactive > '{$threshold}' AND invisible = '1'");
$invis_count = $db->fetch_field($query, "users");

// Add pagination
$perpage = $mybb->settings['threadsperpage'];

if(intval($mybb->input['page']) > 0)
{
$page = intval($mybb->input['page']);
$start = ($page-1) * $perpage;
$pages = ceil($todaycount / $perpage);
if($page > $pages)
{
$start = 0;
$page = 1;
}
}
else
{
$start = 0;
$page = 1;
}

$query = $db->simple_select("users", "*", "lastactive > '{$threshold}'", array("order_by" => "lastactive", "order_dir" => "desc", "limit" => $perpage, "limit_start" => $start));


	$todayrows = '';

	$todayrows = '';

	$query = $db->query("
SELECT u.*
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
WHERE u.lastactive > $stime
ORDER BY u.lastactive DESC
");

 
	while($online = $db->fetch_array($query))

	while($online = $db->fetch_array($query))

	{
if($online['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $online['uid'] == $mybb->user['uid'])


	{
$invisiblemark = '';
if($online['invisible'] == 1)

		{

		{

			if($online['invisible'] == 1)
{
$invisiblemark = "*";
}
else
{
$invisiblemark = "";
}

			$invisiblemark = "*";
}

if($online['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $online['uid'] == $mybb->user['uid'])
{




			$username = $online['username'];
$username = format_name($username, $online['usergroup'], $online['displaygroup']);
$online['profilelink'] = build_profile_link($username, $online['uid']);
$onlinetime = my_date($mybb->settings['timeformat'], $online['lastactive']);

			$username = $online['username'];
$username = format_name($username, $online['usergroup'], $online['displaygroup']);
$online['profilelink'] = build_profile_link($username, $online['uid']);
$onlinetime = my_date($mybb->settings['timeformat'], $online['lastactive']);

 


			eval("\$todayrows .= \"".$templates->get("online_today_row")."\";");
}

			eval("\$todayrows .= \"".$templates->get("online_today_row")."\";");
}

		++$todaycount;

 
	}

	}

 


	if($todaycount == 1)
{
$onlinetoday = $lang->member_online_today;
}
else

	if($todaycount == 1)
{
$onlinetoday = $lang->member_online_today;
}
else

	{

	{

		$onlinetoday = $lang->sprintf($lang->members_were_online_today, $todaycount);
}

		$onlinetoday = $lang->sprintf($lang->members_were_online_today, $todaycount);
}

 

if($invis_count)
{
$string = $lang->members_online_hidden;

if($invis_count == 1)
{
$string = $lang->member_online_hidden;
}

$onlinetoday .= $lang->sprintf($string, $invis_count);
}

$multipage = multipage($todaycount, $perpage, $page, "online.php?action=today");


$plugins->run_hooks("online_today_end");



$plugins->run_hooks("online_today_end");