PDA

View Full Version : Need help with a cron job


AHealthForum
03-16-2009, 03:04 AM
Ok, i've got a Twitter application made up and integrated with vBulletin and an AdminCP interface and everything.

This modification will let you choose a forum that when a new post is made its automatically sent to your twitter account. I've got that working and everything good, the only problem is I want to do it via a cron job to run only once every 15 -30 minutes so its not constantly spamming Twitter

Is there a way to make a cron job via the adminCP and export it with the product when its released?

Lynne
03-16-2009, 03:33 AM
I would just include the cron job file in your release and the user can upload it and create their own cron job to run it however often they want.

AHealthForum
03-16-2009, 03:44 AM
I actually found the spot in AdminCP that would let me create the cron task, and assign it to my product which was easy enough.

But when trying to run the cron I get

Fatal error: Call to a member function query_first_slave() on a non-object in /home/obamanews/ahealthforum.com/global.php on line 242

Is there any way around that?

Lynne
03-16-2009, 03:53 AM
When you use vb's scheduled tasks, you don't need to include global.php in the cron script. That error sometimes occurs when you've include global.php inside a function when you've already included it.

Actually, do a search on that error and you'll see threads like this also - Fatal error: Call to a member function query_first_slave() on a non-object (https://vborg.vbsupport.ru/showthread.php?t=205765&highlight=Call+to+a+member+function+query_first_sl ave%28%29+on+a+non-object)

AHealthForum
03-16-2009, 04:07 AM
I would just include the cron job file in your release and the user can upload it and create their own cron job to run it however often they want.

Yep, they're on their own for setting the cron up :D

Thanks for the help any way.

--------------- Added 1237180762 at 1237180762 ---------------

Cancel that, I finally figured it out!

Thanks Lynne

Dismounted
03-16-2009, 04:49 AM
Note that vBulletin Scheduled Tasks do not work exactly like an actual Unix cronjob does - it does not run precisely every X minutes.