Quote:
Originally Posted by thincom2000
Don't use ' around the number (it implies a string). This could result in a slow query because MySQL has to do a type conversion on the inforum column (SMALLINT to VARCHAR). If this weren't a full table scan already (which it is), the conversion would cause one, so make it a little easier on the server.
Also recommend having the product add inforum as a session table index to avoid the full scan.
|
Like this?
PHP Code:
$currentforumid = $vbulletin->input->clean_gpc('r', 'f', TYPE_UINT);
$hook_query_fields = 'session.inforum';
$hook_query_where = empty($currentforumid) ? "" : "AND session.inforum = $currentforumid";