@N8_115
That's overkill ...
Use this as stats.php
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'stats');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array('userstats');
// pre-cache templates used by all actions
$globaltemplates = array('STATS');
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$userstats = unserialize($datastore['userstats']);
$stats = $DB_site->query_first("SELECT SUM(replycount) AS posts, SUM(threadcount) AS threads FROM " . TABLE_PREFIX . "forum");
eval('print_output("' . fetch_template('STATS') . '");');
?>
Then in template STATS you can use
Threads: $stats[threads]
Posts: $stats[posts]
Members: $userstats[numbermembers]