Hi there, recently I have setup the user promotion in my vbulletin 5.3.2, but when the promotion cron job run, it always get 500 error. I have narrow down the issue to this query
It fetch almost all my user which I have over million users and try to loop though in the promotion, I assume the promotion query should only fetch the recent active user, but when I try to run the cron job in admincp, the last if statement will be false. I don't know if this is bug or this is intentional, can I just remove the VB_AREA check?
PHP Code:
$sql = "
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 >= " . $params['time']);
Comment