MyBB Community Forums

Full Version: Output custom query results to template.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to output the results of a query to my boardstats, but I'm struggling.

I've added the following to index.php, above the $boardstats chunk:

$query = $db->query("SELECT COUNT(uid) as count FROM " . TABLE_PREFIX . "users WHERE usergroup = 8");
$count = $db->fetch_field($query, "count");
echo("<pre>");
var_dump($count);
echo("</pre>");
eval('$count = "'.$templates->get('countpositive').'";');

Then I added ${countpositive} to the index_stats template.

The var_dump is printing the correct information, but the template isn't getting parsed correctly.