actually, there is not a single code that would save processors or server resources... vBulletin is coded to do just that, use the best of the code and features to make server-safe transactions and processes... if you go further in trying to enhance it, you break the process...
so any suggestion to make the code better is just moronish grace... if there is a way to help, vBulletin is upgraded to fix that possibility already... no need to download a hack for that.
I think you misunderstood what I said.
Promotions.php contains this code (note the "save a bit of cpu time.")..
Code:
// $nextrun is the time difference between runs. Should be sent over from cron.php!!
// We only check the users that have been active since the lastrun to save a bit of cpu time.
$thisrun = TIMENOW;
$lastrun = $vbulletin->crondata['promotions_lastrun'] ? $vbulletin->crondata['promotions_lastrun'] : $thisrun - ($nextrun - $thisrun);
$promotions = $vbulletin->db->query_read("
SELECT user.joindate, user.userid, user.membergroupids, user.posts, user.reputation,
user.usergroupid, user.displaygroupid, user.customtitle, user.username, user.ipoints,
userpromotion.joinusergroupid, userpromotion.reputation AS jumpreputation, userpromotion.posts AS jumpposts,
userpromotion.date AS jumpdate, userpromotion.type, userpromotion.strategy,
usergroup.title, usergroup.usertitle AS ug_usertitle,
usertextfield.rank
FROM " . TABLE_PREFIX . "user AS user
INNER JOIN " . TABLE_PREFIX . "userpromotion AS userpromotion ON (user.usergroupid = userpromotion.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usergroup AS usergroup ON (userpromotion.joinusergroupid = usergroup.usergroupid)
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (usertextfield.userid = user.userid)
" . iif(VB_AREA != 'AdminCP', "WHERE user.lastactivity >= $lastrun")
);
That code does not allow the promotions system to move users to a different usergroup if they have been inactive in 30 days. The only way to fix that is to remove the .iif at the end of the query.