Vergleich stats.php - 1.8.0 - 1.8.7

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 56Zeile 56
// Get forum permissions
$unviewableforums = get_unviewable_forums(true);
$inactiveforums = get_inactive_forums();

// Get forum permissions
$unviewableforums = get_unviewable_forums(true);
$inactiveforums = get_inactive_forums();

$fidnot = '1=1 AND ';
$unviewableforumsarray = array();


$unviewablefids = $inactivefids = array();
$fidnot = '';


if($unviewableforums)
{

if($unviewableforums)
{

	$fidnot .= "fid NOT IN ($unviewableforums) AND ";
$unviewableforumsfids = explode(',', str_replace("'", '', $unviewableforums));
foreach($unviewableforumsfids as $fid)
{
$unviewableforumsarray[] = (int)$fid;
}
}
if($inactiveforums)
{
$fidnot .= "fid NOT IN ($inactiveforums) AND ";
$unviewableforumsfids = explode(',', $inactiveforums);
foreach($unviewableforumsfids as $fid)
{
$unviewableforumsarray[] = (int)$fid;
}

	$fidnot .= "AND fid NOT IN ($unviewableforums)";
$unviewablefids = explode(',', $unviewableforums);














}

}










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

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


// Most replied-to threads
$most_replied = $cache->read("most_replied_threads");


// Most replied-to threads
$most_replied = $cache->read("most_replied_threads");


Zeile 96Zeile 91
			$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$numberbit = my_number_format($thread['replies']);
$numbertype = $lang->replies;

			$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$numberbit = my_number_format($thread['replies']);
$numbertype = $lang->replies;

			$thread['threadlink'] = get_thread_link($thread['tid']);

			$thread['threadlink'] = get_thread_link($thread['tid']);

			eval("\$mostreplies .= \"".$templates->get("stats_thread")."\";");
}
}
}

			eval("\$mostreplies .= \"".$templates->get("stats_thread")."\";");
}
}
}





// Most viewed threads
$most_viewed = $cache->read("most_viewed_threads");

if(!$most_viewed)

// Most viewed threads
$most_viewed = $cache->read("most_viewed_threads");

if(!$most_viewed)

{

{

	$cache->update_most_viewed_threads();
$most_viewed = $cache->read("most_viewed_threads", true);
}

	$cache->update_most_viewed_threads();
$most_viewed = $cache->read("most_viewed_threads", true);
}

Zeile 129Zeile 124

$statistics = $cache->read('statistics');
$mybb->settings['statscachetime'] = (int)$mybb->settings['statscachetime'];


$statistics = $cache->read('statistics');
$mybb->settings['statscachetime'] = (int)$mybb->settings['statscachetime'];

 


if($mybb->settings['statscachetime'] < 1)

if($mybb->settings['statscachetime'] < 1)

{

{

	$mybb->settings['statscachetime'] = 0;
}

	$mybb->settings['statscachetime'] = 0;
}

$interval = (int)$mybb->settings['statscachetime']*60860;

 




if(!$statistics || TIME_NOW-$interval > $statistics['time'] || $mybb->settings['statscachetime'] == 0)



$interval = $mybb->settings['statscachetime']*3600;

if(!$statistics || $interval == 0 || TIME_NOW - $interval > $statistics['time'])

{
$cache->update_statistics();
$statistics = $cache->read('statistics');

{
$cache->update_statistics();
$statistics = $cache->read('statistics');

}

}


// Top forum


// Top forum

if(!isset($statistics['top_forum']['posts']))
{




$query = $db->simple_select('forums', 'fid, name, threads, posts', "type='f'$fidnot", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1));
$forum = $db->fetch_array($query);

if(empty($forum['fid']))
{

	$topforum = $lang->none;
$topforumposts = $lang->no;
$topforumthreads = $lang->no;
}
else
{

	$topforum = $lang->none;
$topforumposts = $lang->no;
$topforumthreads = $lang->no;
}
else
{

	$forum = $forum_cache[(int)$statistics['top_forum']['fid']];

$topforum = "<a href=\"".get_forum_link($forum['fid'])."\">{$forum['name']}</a>";
$topforumposts = (int)$statistics['top_forum']['posts'];
$topforumthreads = (int)$statistics['top_forum']['threads'];

	$forum['name'] = htmlspecialchars_uni(strip_tags($forum['name']));
$topforum = '<a href="'.get_forum_link($forum['fid'])."\">{$forum['name']}</a>";
$topforumposts = $forum['posts'];
$topforumthreads = $forum['threads'];


}

// Top referrer defined for the templates even if we don't use it

}

// Top referrer defined for the templates even if we don't use it