About This Page: This is a discussion on vBulletin AJAX Cron within the vBulletin Add-ons forums, part of the Free vBulletin Modification Releases category, at vBulletin Modification Discussions. 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.
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 vBulletin or custom script in any directory. Though it may fail in subdomains. Not a big deal and rare for vBulletin sites.
I have always found the vbcron bit to be annoying. So I fixed it.
Give it a try.
Just import the product xml and upload the files. One xml is included for both 3.5x and 3.6x.
It's just a cleaner way to do it. It's asyncronous so the page viewer will get control of their browser without having to wait for the cron to finish. It will now truly be in the backround.
I don't know why you would be leary to try it. It is still going to run the exact same scripts and the same intervals. It just eliminates it from the surface level of the browsers experience. It is running here now. Though, that is the next version that uses a replacement cron.php script. The default one redirects to clear.gif which is useless with this one.
If you are using Firefox I would suggest you get the Firbug extension. Then you can view any AJAX callls and their returns on any site you visit.
Re-reading your post I am thinking you are under the impresion this is some sort of interval refresh mechanism. IT IS NOT. If you have read any of my responses to those on the other sites you would know I am extremely positioned against such nonsence. That is not within the scope of what AJAX is designed for. Those kinds of apps are not good for anyone.
This still only makes a single call when the user loads the page, if and only if, there is a cron to be run. Same as now but a cleaner experience for the end user.
If fact, currently, when no cron is to be run, the image code doesn't even get loaded in the html. Likewise, with this, when there is no cron to run, the code is not loaded and even the link to the javascript page is not inserted.
Last edited by Code Monkey : 08-10-2006 at 08:31 AM.
Sounds good.! You mentioned the next version using a replacement cron.php script because the default one redirects to clear.gif? Do you plan on releasing that soon, and could I potentially run into any issues by running the current release?
Thanks.
---EDIT---
*points to typo in plugins*
Code:
$vbulletin->settings['disalbe_ajax']
Last edited by Oblivion Knight : 08-10-2006 at 09:55 AM.
No there are no issues currently. It just returns the clear.gif code instead of something like "Attachment Views Completed."
means nothing and the script doesn't even use the return data. I just can't sleep at night knowing it returns image code instead of useful-useless info.
Like I said Nothing is inserted when there is no cron to run. So that is what you see when there is no cron to run. The default vBulletin template code. Whether it be with the default vBulletin image or this one. I just threw the notice in there for curious minds like me.
Basically I don't even use that area at all. There would be no need to remove it so there it is.
<!-- Do not remove <!-- vBulletin Cron replaced by vBulletin AJAX Cron from http://vbmodder.com --> or your scheduled tasks will cease to function -->
<!-- vBulletin Cron replaced by vB AJAX Cron from http://vbmodder.com -->
<!-- Do not remove <!-- vBulletin Cron replaced by vB AJAX Cron from http://vbmodder.com --> or your scheduled tasks will cease to function -->
I wonder if it's an IE thing for you.
As far as running on every page load. That would mean you have several crons ready to go.
Last edited by Code Monkey : 08-10-2006 at 03:59 PM.
<!-- Do not remove <!-- vBulletin Cron replaced by vBulletin AJAX Cron from http://vbmodder.com --> or your scheduled tasks will cease to function -->
<!-- vBulletin Cron replaced by vB AJAX Cron from http://vbmodder.com -->
<!-- Do not remove <!-- vBulletin Cron replaced by vB AJAX Cron from http://vbmodder.com --> or your scheduled tasks will cease to function -->
I wonder if it's an IE thing for you.
Probably.. I just removed $cronimage from the 2 comments.
Quote:
Originally Posted by Code Monkey
As far as running on every page load. That would mean you have several crons ready to go.
It doesn't seem to be, when I disable the product there's a blank line between the 2 default comments.
When I enable it, the additional "vBulletin AJAX Cron" comment is always there.
Ahh, you mean the comment. Yes, that is always there. THe crons however only run when they need to. Maybe I will just dump the comment bit since it seems to cause issues.
You should really use Firefox for web dev. It has so many extensions that help you see what's going on in the background.
The problem with the $cronimage bit is that it puts in in both hidden and non hidden code. So it has to be hidden so it doesn't show up on page and then may cause problems for certain browsers.
I have decided that since this is such a tiny but useful mod, that it will be available for free to non-subscribers. I will post it on other mod sites. However, support will only be offered here.