function verify(&$cronimage, $cbf = false)
{
global $vbulletin, $vb4;
if (empty($cbf))
{
$copyright = '<div><a href="http://www.dragonbyte-tech.com/product.php?credits">vBCredits II Deluxe</a> v2.0.0 Copyright © 2010 <a href="http://www.dragonbyte-tech.com$
if ($vb4) $cronimage .= $copyright; else $vbulletin->templatecache['footer'] = str_replace('$cronimage', addslashes('$cronimage' . $copyright), $vbulletin->templatecache['f$
}
if ($vbulletin->userinfo['userid'])
{ //only users have transactions
$trans = $vbulletin->db->query_first("SELECT t.* FROM " . TABLE_PREFIX . "credits_transaction AS t LEFT JOIN " . TABLE_PREFIX . "credits_event AS e ON (t.eventid = e.eventid) WHERE t.userid = " . $vbulletin->userinfo['userid'] . " AND t.status = 0 AND t.timestamp <= (" . TIMENOW . " - IF(ISNULL(e.eventid), 0, e.delay)) ORDER BY t.transactionid ASC LIMIT 1"$
VBCREDITS::process($trans, $vbulletin->userinfo);
}
}
$trans = $vbulletin->db->query_first("SELECT t.* FROM " . TABLE_PREFIX . "credits_transaction AS t LEFT JOIN " . TABLE_PREFIX . "credits_event AS e ON (t.eventid =
e.eventid) WHERE t.userid = " . $vbulletin->userinfo['userid'] . " AND t.status = 0 AND t.timestamp <= (" . TIMENOW . " - IF(ISNULL(e.eventid), 0, e.delay)) ORDER BY t.transactionid ASC LIMIT 1"$
VBCREDITS::process($trans, $vbulletin->userinfo);
Thats an extremely important query though Without it, none of your events will actually process, and nobody will get anything.
Now... I do have an index specifically for that query, so it is as good as I think I can get it, but of course if you manage to make it better (without blindly snipping it out of course) I would be glad to accept it
We use essential cookies to make this site work, and optional cookies to enhance your experience.