Quote:
Originally Posted by Xenon
that's why i said you need a static variable to run it just once 
|
Yea I know and I tried using a static variable. Heres the code I used in ": postbit_display_start".
PHP Code:
global $db, $vbulletin;
static $alreadychecked, $check;
if (!$alreadychecked)
{
$checkdata = $db->query_read("
SELECT dateline
FROM " . TABLE_PREFIX . "custom
WHERE userid = " . $vbulletin->userinfo['userid'] . "
AND threadid = " . intval($thread['threadid']) . "
");
if ($db->num_rows($checkdata))
{
$check = true;
}
else
{
$check = false;
}
$alreadychecked = true;
}
The conditions worked for each postbit, but its still running the query for each postbit. =\ I had to add:
PHP Code:
global $db, $vbulletin;
Or it would give me a "Fatal error: Call to a member function on a non-object in /home/vbhacker/public_html/jelsoft/includes/class_postbit.php(251) : eval()'d code on line 6"