Vergleich stats.php - 1.8.4 - 1.8.22

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'stats.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'stats.php');


$templatelist = "stats,stats_thread";


$templatelist = "stats,stats_thread,stats_topforum";


require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/class_parser.php";

require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/class_parser.php";

Zeile 68Zeile 69
{
$fidnot .= "AND fid NOT IN ($inactiveforums)";
$inactivefids = explode(',', $inactiveforums);

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

}

}


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


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

 

// Check group permissions if we can't view threads not started by us
$group_permissions = forum_permissions();
$onlyusfids = array();
foreach($group_permissions as $gpfid => $forum_permissions)
{
if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
{
$onlyusfids[] = $gpfid;
}
}


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


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





if(!$most_replied)
{
$cache->update_most_replied_threads();

if(!$most_replied)
{
$cache->update_most_replied_threads();

Zeile 83Zeile 95

$mostreplies = '';
if(!empty($most_replied))


$mostreplies = '';
if(!empty($most_replied))

{

{

	foreach($most_replied as $key => $thread)
{

	foreach($most_replied as $key => $thread)
{

		if(!in_array($thread['fid'], $unviewableforumsarray))




		if(
!in_array($thread['fid'], $unviewableforumsarray) &&
(!in_array($thread['fid'], $onlyusfids) || ($mybb->user['uid'] && $thread['uid'] == $mybb->user['uid']))
)

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

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

Zeile 98Zeile 113
}

// Most viewed threads

}

// Most viewed threads

$most_viewed = $cache->read("most_viewed_threads");

$most_viewed = $cache->read("most_viewed_threads");


if(!$most_viewed)
{


if(!$most_viewed)
{

Zeile 111Zeile 126
{
foreach($most_viewed as $key => $thread)
{

{
foreach($most_viewed as $key => $thread)
{

		if(!in_array($thread['fid'], $unviewableforumsarray))




		if(
!in_array($thread['fid'], $unviewableforumsarray) &&
(!in_array($thread['fid'], $onlyusfids) || ($mybb->user['uid'] && $thread['uid'] == $mybb->user['uid']))
)

		{
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$numberbit = my_number_format($thread['views']);

		{
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject']));
$numberbit = my_number_format($thread['views']);

Zeile 124Zeile 142

$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)
{
$mybb->settings['statscachetime'] = 0;
}

if($mybb->settings['statscachetime'] < 1)
{
$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');

Zeile 149Zeile 169
else
{
$forum['name'] = htmlspecialchars_uni(strip_tags($forum['name']));

else
{
$forum['name'] = htmlspecialchars_uni(strip_tags($forum['name']));

	$topforum = '<a href="'.get_forum_link($forum['fid'])."\">{$forum['name']}</a>";


	$forum['link'] = get_forum_link($forum['fid']);
eval("\$topforum = \"".$templates->get("stats_topforum")."\";");

	$topforumposts = $forum['posts'];
$topforumthreads = $forum['threads'];
}

	$topforumposts = $forum['posts'];
$topforumthreads = $forum['threads'];
}

Zeile 161Zeile 182
	// Only show this if we have anything more the 0 referrals
if($statistics['top_referrer']['referrals'] > 0)
{

	// Only show this if we have anything more the 0 referrals
if($statistics['top_referrer']['referrals'] > 0)
{

		$toprefuser = build_profile_link($statistics['top_referrer']['username'], $statistics['top_referrer']['uid']);

		$toprefuser = build_profile_link(htmlspecialchars_uni($statistics['top_referrer']['username']), $statistics['top_referrer']['uid']);

		$top_referrer = $lang->sprintf($lang->top_referrer, $toprefuser, my_number_format($statistics['top_referrer']['referrals']));
}
}

		$top_referrer = $lang->sprintf($lang->top_referrer, $toprefuser, my_number_format($statistics['top_referrer']['referrals']));
}
}

Zeile 180Zeile 201
	}
else
{

	}
else
{

		$topposter = build_profile_link($statistics['top_poster']['username'], $statistics['top_poster']['uid']);

		$topposter = build_profile_link(htmlspecialchars_uni($statistics['top_poster']['username']), $statistics['top_poster']['uid']);

	}

$topposterposts = $statistics['top_poster']['poststoday'];

	}

$topposterposts = $statistics['top_poster']['poststoday'];