![]() |
vB AJAX Cron
This is such a small but useful mod that I decided to give it away free. This mod will replace your sheduled task image code at the bottom of your pages and run your sheduled tasks via an AJAX call. AJAX is asyncronous and offers true background running of sheduled tasks. This does not change anything with the actual tasks or the scripts that run them. It merely replaces the method that initiates the running of those scripts. There are no template edits of any kind. Simply upload the files to your forumhome directory and import the product xml file. This should work in any vb or custom script in any directory. Full support will only be given at vbmodder.com I will support it here as time permits. Enjoy Don't forget to click install if you use it. ****************************************** Do not use this with vb 3.5x! There is a difference in the cron table. The 3.5x version can be found here Code:
ekd12x0002w#rt2200cmvbm |
Oops
first replay i will try it soon |
didn't really get what does the hack do ......
but thnx anyway .... :/ |
Quote:
This mod replaces that with an asyncronous AJAX call to the cron script. The image code has served vb well but with the advent of AJAX type methods there is a cleaner way to do it. That's what this does. |
vBCron is run by a simple link to cron.php in an img tag. This link will activate cron and do updates, then output back to the img tags blank.gif. This mod eliminates that, and instead, uses AJAX processing to activate cron.
|
Great work, thanks! :)
|
where upload ajax_cron.php ?
|
Quote:
So just upload the contents of that, subdirectories intact, to your forumhome directory. |
Thx ;)
|
26 downloads and only 8 installs?
The button must be stuck! :D |
Installed but i didnt get what that mean " This works at vbModder.com with vba in a directory above forum home. Make sure you have your home and forumhome path info acp options filled in or it may not work on vba.
" thank you Regards, Mohamed Ashraf |
I dont understand?
Where is there any image used when using a cron? Crons are made to run automatic, aren't they? |
Thx - works great ! :D
|
Quote:
in vBulettin Options->Site Name / URL / Contact Details there are two settings. Forum Url and Homepage Url. These must both be set or it will not function on your vba home page if you have it in a different directory. The reason being is that AJAX (and for good security reasons) does not work on remote sites. It can only access files on the site your visiting. So the path has to be set to the file using /dir/dir/file type structure instead of http://site.ext/dir/dir/file. To accomplish this I had to compare the two settings above in order to change the path to cron.php when on a vba page that is in another directory. I hope that helps |
Quote:
In the footer of your page you should see this. Code:
<!-- Do not remove or your scheduled tasks will cease to function --> I should add that just as vb does not insert the image code when there is no task to run. Likewise, this script does nothing, and inserts nothing, not even the link to the javascript file, when there is no task to run. |
Installed
how do i make sure its working properly |
Quote:
There are several ways to view what is happening and if it is happening. Use Firefox, if you don't already, and get the wonderful Firebug extension. This extension allows you to see many things including all AJAX calls and their responces on any site you visit. Then if you are the lucky one that vb decides will cause the next cron to run, you will see it happen in Firebug. Another way is to go into your scheduled task log setting in your ACP and empty the log by deleting any logs over 0 days old. Then you can come back later and see if those crons that are set to record a log have run. Ultimately this is one of those mods that does a wonderful thing but it does it behind the scenes. It's not glamorous, it's functional. |
Thx for the Firebug ;)
|
Quote:
|
Quote:
|
Quote:
|
This is a great idea and working perfectly. Thanks for this Code Monkey
|
You're welcome and thank you.
|
Ok, 2 questions:
1 - How do you correct the link path to not get file not found errors on custom vb pages. File does not exist: /home/thep/public_html/goto/all_galleries/ajax_cron.php 2 - Why do you not have to edit the footer template to take out the cronimage? Jimmy |
1. That is most likely happening because your Homepage url and Forumpage url settings, in vBulettin Options->Site Name / URL / Contact Details, are wrong. Please post what those settings are.
2. Because this mod takes care of all template edits and disposal on the fly. |
Actually, I think I see what you mean in number one. I think I have a way around that.
|
I'm going to need a link to those pages.
|
Quote:
$_link = "/forums/ajax_cron.php"; And that works on all vb pages custom or not for my site. Jimmy |
But that will break it for many other sites so it is not a solution.
|
Quote:
It is looking for /home/thep/public_html/goto/all_galleries/ajax_cron.php from /home/thep/public_html/goto/all_galleries/index.php when it should be looking for /home/thep/public_html/forums/ajax_cron.php Something to do with your forumdir or string change functions. Jimmy |
Well, in your solution, when you are in the goto/all_galleries directory and the cron fires you are going to get the following error.
File does not exist: /home/thep/public_html/goto/all_galleries/forums/ajax_cron.php You haven't gotten it yet because there was most likely no cron to run at that time. |
Quote:
Jimmy |
No it won't be if you are in goto/galleries. The link code gets appended to the current working directory. But hey, do as you wish. I can't help you without a link so I will come up with a solution that best works for eveyone.
Have a nice day. |
One option I have is to just use the full link in $vbulletin->options['bburl']. The problem with that is the security measures of http and AJAX requests. If the url in $vbulletin->options['bburl'] has http://www.site.com and someone is on your site having typed in http://site.com without the www then it will give a no permision error. And visa versa. The domain must be the same.
I think I will just try that and see if I can detect the difference. |
Database error in vBulletin 3.6.0:
Invalid SQL: SELECT usergroupid FROM icon AS icon INNER JOIN imagecategorypermission USING (imagecategoryid) WHERE icon.iconid = 1 AND usergroupid IN (); MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 4 Error Number : 1064 Date : Saturday, August 12th 2006 @ 04:50:14 PM Script : http://www.xxxxxxxxx/forum/ajax_cron.php?rand=50548 Referrer : http://www.xxxxxxxxxx/forum/arcade.php?&act=Arcade IP Address : xxxxxxxxxxxxxxx Username : Niet geregistreerd Classname : vB_Database |
That has nothing to do with this mod. This mod doesn't change any of the crons that run. Nor does it use any mysql functions. Something is wrong on that page.
|
Updated. This should now work on any pages. The problem above should be fixed. The fix actually eliminated many lines of php code.
|
If you just downloaded the update you need to re-download. I put the wrong js file in. Time for bed.
|
Thx again for Update !
|
Quote:
Jimmy |
All times are GMT. The time now is 07:14 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|