Vergleich stats.php - 1.8.0 - 1.8.10

  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 20Zeile 21
// Load global language phrases
$lang->load("stats");


// Load global language phrases
$lang->load("stats");


add_breadcrumb($lang->nav_stats);


add_breadcrumb($lang->nav_stats);


$stats = $cache->read("stats");

if($stats['numthreads'] < 1 || $stats['numusers'] < 1)
{
error($lang->not_enough_info_stats);

$stats = $cache->read("stats");

if($stats['numthreads'] < 1 || $stats['numusers'] < 1)
{
error($lang->not_enough_info_stats);

}

}


if($mybb->settings['statsenabled'] != 1)
{


if($mybb->settings['statsenabled'] != 1)
{

Zeile 56Zeile 57
// 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;
}
}

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





if($inactiveforums)

if($inactiveforums)

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

{
$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 84Zeile 80
{
$cache->update_most_replied_threads();
$most_replied = $cache->read("most_replied_threads", true);

{
$cache->update_most_replied_threads();
$most_replied = $cache->read("most_replied_threads", true);

}

}


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


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

Zeile 98Zeile 94
			$numbertype = $lang->replies;
$thread['threadlink'] = get_thread_link($thread['tid']);
eval("\$mostreplies .= \"".$templates->get("stats_thread")."\";");

			$numbertype = $lang->replies;
$thread['threadlink'] = get_thread_link($thread['tid']);
eval("\$mostreplies .= \"".$templates->get("stats_thread")."\";");

		}
}
}

		}
}
}


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


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

Zeile 129Zeile 125

$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');

}


}


// 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']));
$forum['link'] = get_forum_link($forum['fid']);
eval("\$topforum = \"".$templates->get("stats_topforum")."\";");
$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

Zeile 164Zeile 165
	// 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 183Zeile 184
	}
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'];