Quote:
Originally Posted by Boofo
Can you add the number of threads made today to this, too? 
|
I've yet to find a way to join two COUNT(*) queries together, but this will work
PHP Code:
$starttime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
$newposts = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline >= $starttime");
$newthreads = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE dateline >= $starttime");
$poststoday = vb_number_format($newposts['count']);
$threadstoday = vb_number_format($newthreads['count']);
Sadly, 2 queries per view of the forumhome page -.-
If we could store the data in the datastore that would help >_<
Satan