Web Hosting Talk







View Full Version : vbulletin query question


Domenico
02-22-2003, 07:46 AM
Since the great minds at vbulletin.org don't answer this question I will try my luck here.

I want to change the following code in index.php:

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");

$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");

I want to exclude two forums from these queries, how?
Thank you!

Rich2k
02-22-2003, 08:36 AM
I've never tried this myself but this may work

$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]' AND forumid <> [FORUMID]");

where you replace [FORUMID] with the id number of the particular forum you don't want (get the id from the query string of a particular forum.

You shouldn't need to edit the second sql statement as I would expect that is only executed as part of the first loop (without looking into the vBulletin code)