MyBB Community Forums

Full Version: Task works fine manually but not using schedule
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I wrote a plugin that shows the "best" threads in different periods of time, and it has a task that updates the table shown on the index page.

My forum with the plugin enabled here:

The problem is, when the task is run manually everything works fine, the table with the top threads are shown correctly, but when it runs using the schedule, it creates a broken table.

The thing is that I can't find out what's wrong as there is no way to see what's going on with the task. For some reason my local wamp installation is not running the scheduled tasks.

The query I'm running:
Quote: $sql="
SELECT t.subject,t.username,t.uid,t.tid,t.fid,t.lastpost,t.lastposter,t.lastposteruid,t.replies, t.totalratings, ".($g33kthanks ? "tyl_tnumtyls" : "").", t.views, ,
TRUNCATE(t.totalratings/t.numratings*2+t.numratings/8".($g33kthanks ? "+tyl_tnumtyls" : "")."+t.replies+t.views/".$days.",2) ranking
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid = t.fid)
WHERE t.visible='1'
AND t.closed NOT LIKE 'moved|%'
AND t.dateline >=UNIX_TIMESTAMP()-(86400*".$days.") ORDER BY ranking DESC
LIMIT 0,".$NumOfRows;

Any ideas what I could do solve the task problem?