Topic: Adding further stats to collect in index.php
I was just trying to manually add some code to collect how many spammers/bots I've blocked and show in statistic, but I'm having trouble knowing where to put it in lines 265-304.... or how I select the table "stopforumspam" and/or "url_spam"...
[code=php]
// Collect some statistics from the database
$query = array(
'SELECT' => 'COUNT(u.id) - 1',
'FROM' => 'users AS u',
'WHERE' => 'u.group_id != '.FORUM_UNVERIFIED
);
($hook = get_hook('in_stats_qr_get_user_count')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$stats['total_users'] = $forum_db->result($result);
$query = array(
'SELECT' => 'u.id, u.username',
'FROM' => 'users AS u',
'WHERE' => 'u.group_id != '.FORUM_UNVERIFIED,
'ORDER BY' => 'u.registered DESC',
'LIMIT' => '1'
);
($hook = get_hook('in_stats_qr_get_newest_user')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$stats['last_user'] = $forum_db->fetch_assoc($result);
$query = array(
'SELECT' => 'SUM(f.num_topics), SUM(f.num_posts), SUM(f.stopforumspam)',
'FROM' => 'forums AS f'
);
($hook = get_hook('in_stats_qr_get_post_stats')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
list($stats['total_topics'], $stats['total_posts'], $stats['total_stopforumspam']) = $forum_db->fetch_row($result);
$stats_list['no_of_users'] = '<li class="st-users"><span>'.sprintf($lang_index['No of users'], '<strong>'.forum_number_format($stats['total_users']).'</strong>').'</span></li>';
$stats_list['newest_user'] = '<li class="st-users"><span>'.sprintf($lang_index['Newest user'], '<strong>'.($forum_user['g_view_users'] == '1' ? '<a href="'.forum_link($forum_url['user'], $stats['last_user']['id']).'">'.forum_htmlencode($stats['last_user']['username']).'</a>' : forum_htmlencode($stats['last_user']['username'])).'</strong>').'</span></li>';
$stats_list['no_of_topics'] = '<li class="st-activity"><span>'.sprintf($lang_index['No of topics'], '<strong>'.forum_number_format($stats['total_topics']).'</strong>').'</span></li>';
$stats_list['no_of_posts'] = '<li class="st-activity"><span>'.sprintf($lang_index['No of posts'], '<strong>'.forum_number_format($stats['total_posts']).'</strong>').'</span></li>';
($hook = get_hook('in_stats_pre_info_output')) ? eval($hook) : null;
?>
[/code]
What would be best:
Knowing how to easily add via a hook & manifest