Topic: Missing Numbers on Index page

I was checking out a new forum and I noticed this on the index page

    Total number of topics: 
    Total number of posts:

The issue is this query

$result = $db->query('SELECT SUM(num_topics), SUM(num_posts) FROM '.$db->prefix.'forums') or error('Unable to fetch topic/post count', __FILE__, __LINE__, $db->error());

The problem is that sum returns null if it has no rows to count. If there are no forums (as was the case here), there's a null rather than a number. I think the easiest way to fix this is to use intval on the output of the query (which should turn it to 0)

Re: Missing Numbers on Index page

Noted. Will fix in 1.3.

"Programming is like sex: one mistake and you have to support it for the rest of your life."