View Full Version : Board Optimization - vB AJAX Cron
Code Monkey
08-11-2006, 10:00 PM
vB AJAX Cron From vBModder.com (http://vbmodder.com)
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 (http://vbmodder.com)
I will support it here as time permits.
Enjoy
Don't forget to click install if you use it. (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=123719)
******************************************
Do not use this with vb 3.5x! There is a difference in the cron table.
The 3.5x version can be found here (https://vborg.vbsupport.ru/showthread.php?t=123720)
ekd12x0002w#rt2200cmvbm
alraqee
08-12-2006, 01:17 AM
Oops
first replay
i will try it soon
ArabSQuad
08-12-2006, 03:41 AM
didn't really get what does the hack do ......
but thnx anyway .... :/
Code Monkey
08-12-2006, 03:49 AM
didn't really get what does the hack do ......
but thnx anyway .... :/
Currently, when vb needs to run a sheduled task, it loads image code at the bottom of your forum page. Except it has a php file as the src of the img tag. This causes the php file to run which in turn runs the next scheduled task. This can, depending on the cron to run and the size of the site, cause a browser to seemingly hang until the script is finished running. This happens because this is a syncronous event. Meaning, it's waiting for the page to finish loading the image.
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.
Cole2026
08-12-2006, 03:50 AM
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.
x3sphere
08-12-2006, 04:01 AM
Great work, thanks! :)
bollie
08-12-2006, 04:52 AM
where upload ajax_cron.php ?
Code Monkey
08-12-2006, 05:49 AM
where upload ajax_cron.php ?
Notice that it's in a directory called "upload_the_contents_of_this_directory_to_forumhome".
So just upload the contents of that, subdirectories intact, to your forumhome directory.
bollie
08-12-2006, 06:01 AM
Thx ;)
Code Monkey
08-12-2006, 01:04 PM
26 downloads and only 8 installs?
The button must be stuck! :D
Mohamed Ashraf
08-12-2006, 02:14 PM
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
Eagle Creek
08-12-2006, 02:18 PM
I dont understand?
Where is there any image used when using a cron? Crons are made to run automatic, aren't they?
redlabour
08-12-2006, 02:21 PM
Thx - works great ! :D
Code Monkey
08-12-2006, 02:26 PM
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
On my site my vbadvanced is in the root directory and vBulletin is in the /forums directory below that.
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
Code Monkey
08-12-2006, 02:31 PM
I dont understand?
Where is there any image used when using a cron? Crons are made to run automatic, aren't they?
It's only there if a cron is scheduled to run at time of page load.
In the footer of your page you should see this.
<!-- Do not remove or your scheduled tasks will cease to function -->
<!-- Do not remove or your scheduled tasks will cease to function -->
When vb needs to run a task it inserts the image code there. When it does not need to run a task it leaves it blank. This mod elimates that mess and runs the task in the background with an XHR (AJAX) call to the file. Much cleaner.
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.
unitedpunjab
08-12-2006, 03:14 PM
Installed
how do i make sure its working properly
Code Monkey
08-12-2006, 03:30 PM
Installed
how do i make sure its working properly
If your site is busy it is unlikely that you will often win the "load the cron" lottery. :D
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.
unitedpunjab
08-12-2006, 03:39 PM
Thx for the Firebug ;)
Code Monkey
08-12-2006, 03:51 PM
Thx for the Firebug ;)
Use that baby on a site that missuses AJAX to auto refresh data, such as AJAX chat, and you will see why they are a resource hog. That is if you can keep up with the scrolling.
Floris
08-12-2006, 05:09 PM
26 downloads and only 8 installs?
The button must be stuck! :D
This is common - no need to plug users to go and click it.
Code Monkey
08-12-2006, 05:18 PM
This is common - no need to plug users to go and click it.
I'm quite familiar with what is common around here. I was mocking the faulty system. Was a joke. Lighten up ;)
Lizard King
08-12-2006, 09:51 PM
This is a great idea and working perfectly. Thanks for this Code Monkey
Code Monkey
08-12-2006, 11:13 PM
You're welcome and thank you.
nicedreams
08-13-2006, 02:32 AM
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
Code Monkey
08-13-2006, 02:49 AM
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.
Code Monkey
08-13-2006, 02:54 AM
Actually, I think I see what you mean in number one. I think I have a way around that.
Code Monkey
08-13-2006, 03:08 AM
I'm going to need a link to those pages.
nicedreams
08-13-2006, 03:31 AM
Actually, I think I see what you mean in number one. I think I have a way around that.
I dropped some code for the link and forumdir and changed the link to:
$_link = "/forums/ajax_cron.php";
And that works on all vb pages custom or not for my site.
Jimmy
Code Monkey
08-13-2006, 03:35 AM
But that will break it for many other sites so it is not a solution.
nicedreams
08-13-2006, 03:42 AM
But that will break it for many other sites so it is not a solution.
Well, it shouldn't be too hard to figure out based on what I said.
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
Code Monkey
08-13-2006, 03:46 AM
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.
nicedreams
08-13-2006, 03:55 AM
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.
No, I changed the code so the final $_link is $_link = "/forums/ajax_cron.php"; which would be /home/thep/public_html/forums/ajax_cron.php
Jimmy
Code Monkey
08-13-2006, 04:13 AM
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.
Code Monkey
08-13-2006, 04:39 AM
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.
bollie
08-13-2006, 05:52 AM
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
Code Monkey
08-13-2006, 06:10 AM
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.
Code Monkey
08-13-2006, 06:15 AM
Updated. This should now work on any pages. The problem above should be fixed. The fix actually eliminated many lines of php code.
Code Monkey
08-13-2006, 06:26 AM
If you just downloaded the update you need to re-download. I put the wrong js file in. Time for bed.
redlabour
08-13-2006, 06:54 AM
Thx again for Update !
nicedreams
08-13-2006, 01:18 PM
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.
No, I changed the code like you just did for the update. Starting a link with a / puts it in the home html dir, it does not append it to the current dir.
Jimmy
Code Monkey
08-13-2006, 02:19 PM
Why don't you just update and be done with it? ;)
It's all done in the javascript now.
Code Monkey
08-13-2006, 03:32 PM
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
Do you have any mods that have a plugin for the cron_start hook? I have never seen one that uses this hook but you never know.
bollie
08-13-2006, 05:10 PM
vBulletin 3.6.0
Add Banner 1.6 Add banner on each forum.
Advanced Userbar Picture Hack for vB 1.0
DownloadsII 5.0.2 A Download Database for vB
Geek Auto
Google Bottom 1.0
ibProArcade for vBulletin 2.5.6 ibProArcade
inferno News Views 1.00
Last Seen Online (Postbit) (Brad) 1.6
Members who have read a thread. 3.13 Display members who have recently read a thread - Version 3.
Members who have visited the forum 4.21 Display members who have visited the forum.
Moderation Auto-PM 2.0.1 Automaticly PMs a user when their thread is moderated
Post Thank You Hack 5.0 Post Thank You Hack
psiStats 2006 1.3.2 Sophisticated forum statistics for your vBulletin board.
Reported post creates new thread 2.01 Disables the sending of e-mails when a post is reported, and instead creates a new thread of the report in a specified forum.
vB Category Icons 1.0.1 This will allow you to setup a icon to display by the title of each forum you have. The look of the icon depends on how you want to set it up in the templates. This will work for all levels of sub-forums.
VB image hosting 1.3.1a Image hosting sloution for VB
vBadvanced CMPS 2.1.0 vBadvanced Content Management & Portal System
vBSEO :: Sitemap Generator 1.6.1 Generate a Google & Yahoo Sitemap for your Forums
vBShout 2.0 AJAX Shoutbox for vBulletin
vBulletin AJAX Cron 1.1.1 This will change your vb cron to run using AJAX instead of an image link.
Code Monkey
08-13-2006, 11:51 PM
What am I supposed to do with that? Just look in your plugins and see if one is using cron_start.
Paul M
08-13-2006, 11:58 PM
Brollie, you first posted that error over a week ago (here (https://vborg.vbsupport.ru/showthread.php?p=1045670#post1045670)) - long before this was even released. Please do not cross post and clutter up peoples modification threads with unrelated errors that clearly do not belong. Thanks.
Code Monkey
08-14-2006, 01:12 AM
Ah, I see. No fishing in my mod thread Bollie. :D
ferrarislave
08-15-2006, 02:12 AM
how do I import the feed?
Code Monkey
08-15-2006, 03:32 AM
Import the feed?
You mean the product xml?
Just go into your plugin manager and click on products (not plugins) and then at the bottom of the product list click the add product link. Then use the browse button to find the file on your hard drive then click install/import or whatever its called.
Code Monkey
08-16-2006, 03:42 PM
If anyone is using a plugin that needs the cron_start hook (I have never seen one) please let me know. This mod will break it if it does since it's not using cron.php where the hook exists. If this is a problem for anyone I will have to come up with a work around. I doubt it but you never know.
Revan
08-17-2006, 10:32 PM
* Revan clicks Install.
Thank you very much, not only is this cool in its own, but it also solved a problem I had to deal with which vBulletin Support was not able to figure out; why cron jobs didn't run on my particular setup.
This, however, runs them perfectly. Im going to vBulletin.com to petition this becoming a stock vB feature.
Edit: http://www.vbulletin.com/forum/showthread.php?t=196660
Code Monkey
08-17-2006, 11:22 PM
Well, it only breaks the cron_start hook because I am using a different script than cron.php. I could always add my own hook.
I wonder if there is a way to divert vb to look there for cron_start. hmmm...
Code Monkey
08-17-2006, 11:39 PM
New version 1.1.2
Added ajax_cron_start hook. Now if you should ever have a plugin that uses the cron_start hook simply change it to use the ajax_cron_start hook.
briansol
08-18-2006, 03:07 AM
Thanks for the update :)
Revan
08-18-2006, 10:03 AM
Well, it only breaks the cron_start hook because I am using a different script than cron.php. I could always add my own hook.
I wonder if there is a way to divert vb to look there for cron_start. hmmm...If that's the problem, why not just add cron_start instead of ajax_cron_start in your ajax_cron.php? :confused:
Since you are rendering the vB default cron.php useless, whatever code would be executed in cron_start would be executed in your file instead.
Or am I missing something?
Code Monkey
08-18-2006, 01:18 PM
Is it that easy? I have never looked at how vb knows where the hooks are so I have no idea. I was planning on researching that this weekend.
libertylounge
08-18-2006, 11:03 PM
Awesome. Installed.
Code Monkey
08-19-2006, 01:24 AM
New Version 1.1.3
Now it will just use cron_start hook if you have a plugin that uses it. Aparently vb doesn't actually care where the hook is located.
Live and learn.
Code Monkey
Thanks go to Revan for the heads up.
Code Monkey
08-19-2006, 03:11 PM
New Version 1.1.4
This will now degrade gracefully when browsers have javascript turned off. When a browser has javascript turned off the default vb method will be implemented to ensure the cron runs.
Code Monkey
derekivey
08-19-2006, 05:06 PM
Nice hack Code Monkey :).
* derekivey clicks install.
Code Monkey
08-19-2006, 08:53 PM
Thank you very much.
Code Monkey
08-23-2006, 02:19 AM
Anyone had any issues with this?
sickboy6ths
08-24-2006, 08:38 AM
Somehow... my cron stopped working since a while...
I have tried everything, even tried using the default style with no template additions, but no luck...
Now, after installing your mod, my cron is working properly again. So big thanks..
altough I of coarse would've loved to figure out why the default cron image didnt work anymore :S
Code Monkey
08-24-2006, 01:22 PM
I'm wondering if you had the same problem as Revan. I'm glad this fixed it for you. It is a better way to call the cron anyway.
Alcatraz
08-26-2006, 05:31 PM
Currently, when vb needs to run a sheduled task, it loads image code at the bottom of your forum page. Except it has a php file as the src of the img tag. This causes the php file to run which in turn runs the next scheduled task. This can, depending on the cron to run and the size of the site, cause a browser to seemingly hang until the script is finished running. This happens because this is a syncronous event. Meaning, it's waiting for the page to finish loading the image.
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.
What about the other hacks that require cron? does this turn the reular cron off. I have RPG Inferno v3 and it requires over 3 cron scripts. To run to keep everything running ok. Do I have to know how to write java script to my it work or does it pick it off the cron task tabel and run it via ajax?
Thanks for the program though :-) I installed!
Alcatraz
Code Monkey
08-26-2006, 07:02 PM
No. This runs all crons that are in your scheduled task list in your admincp.
As stated above. This does not change any internal cron functions whatesover. It only improves the method that runs the scripts on page load.
Alcatraz
08-26-2006, 11:05 PM
Yeah I seen the .js scripts and I wasn't for sure if it was or not.
Alcatraz
Code Monkey
08-27-2006, 04:09 AM
You should have no problems. Thanks for posting and thanks for clicking install.
Brandon Sheley
08-30-2006, 09:06 PM
thanks for the mod Code Monkey, I'll give it a try :)
* Brandon Sheley clicks install
Code Monkey
08-31-2006, 04:30 AM
I am sure you will find it useful and beneficial.
Enjoy
DementedMindz
09-04-2006, 07:52 AM
Code Monkey thank you very much and once again nice work. installed
Code Monkey
09-05-2006, 01:37 AM
I'm glad you like it and find it useful.
WritersBeat
09-05-2006, 06:41 AM
I shall give this a try :)
Code Monkey
09-06-2006, 03:10 AM
Hope it worked for you. :D
Exitilus
09-06-2006, 03:13 AM
There may be a bug with your ajax_cron.php ... I was getting a Database Error with the Cron. I contacted vbulletin support and they told me the error is actually a known bug in the /includes/cron/activate.php.
Can read about it here http://www.vbulletin.com/forum/bugs36.php?do=view&bugid=639
Well I found out that the error is actually coming from ajax_cron.php .... So I thought I'd come here and let you know. The error I'm getting is
Database error in vBulletin 3.6.0:
Invalid SQL:
INSERT INTO useractivation
VALUES
(NULL , 945, 1157515374, 22491926, 0, 2);
MySQL Error : Column count doesn't match value count at row 1 Error Number : 1136
Date : Wednesday, September 6th 2006 @ 12:02:54 AM
Script : http://myforumlocation.com/ajax_cron.php?rand=711753
Referrer :
IP Address : xxx.xx.xxx.xx
Username : Unregistered
Classname : vb_database
I'm guessing this is related. Atleast I hope ..... :-s
(I did omit my site link and the ip address)
Code Monkey
09-06-2006, 03:56 AM
No. vB AJAX Cron merely initiates the runing of the scripts. You would have gotten this error the old way too
As they said, it's a bug in activate.php
Do the fix they recomended.
rob30UK
09-06-2006, 11:09 AM
instead of a small piece of html to show an image, we now have?
A bigger piece.... nice!
Code Monkey
09-06-2006, 01:14 PM
And where would that be?
Exitilus
09-06-2006, 05:57 PM
I've done the fix. But the error sems to be coming from ajax_cron.php
Code Monkey
09-07-2006, 02:20 AM
That is just the main script that is including the one with the error. It is not coming from ajax_cron.php. You can have another coder look at it if you don't trust my judgement.
Exitilus
09-07-2006, 07:00 PM
Nope :) I trust your judgement :)
I think I was half asleep when I made the previous reply *lol* :)
Master Nemesis
09-07-2006, 07:42 PM
cheers will intall later
Code Monkey
09-08-2006, 01:50 AM
Nope :) I trust your judgement :)
I think I was half asleep when I made the previous reply *lol* :)
Did their proposed fix not work on that other script?
Axel Foley
09-11-2006, 10:14 PM
Thank you very much...
I'm going to try it now...I use vBadvanced and I hated seeing cron.php generating errors on my homepage...:)
Code Monkey
09-12-2006, 01:20 AM
Let me know how it works for you. :D
Axel Foley
09-13-2006, 08:14 PM
No more cron.php errors with vBadvanced...;)
It's working fine...thank you very much for your work...
yessir
09-14-2006, 03:05 AM
This mod works flawlessly with no stuttered page loads. It's works so well, most folks probably don't even know it is working.
Code Monkey
09-15-2006, 02:59 AM
No more cron.php errors with vBadvanced...;)
It's working fine...thank you very much for your work...
Thank you very much for the testimonial. I am glad it fixes problems for people.
This mod works flawlessly with no stuttered page loads. It's works so well, most folks probably don't even know it is working.
That's probably why it doesn't get many installs either. They don't know they need itr. :D
soulface
09-16-2006, 06:49 AM
Getting this kind of db error...
Database error in vBulletin 3.6.0:
Invalid SQL:
REPLACE INTO useractivation
VALUES
(NULL , 2077, 1157440817, 10613041, 0, 2);
MySQL Error : Column count doesn't match value count at row 1
Error Number : 1136
Date : Tuesday, September 5th 2006 @ 03:20:18 AM
Script : http://*******/ajax_cron.php?rand=409550
Referrer : http://*******/misc/bbcode/
IP Address : 212.138.47.22
Username : Unregistered
Classname : vb_database
Code Monkey
09-16-2006, 01:24 PM
That is not caused by this mod. See this thread. http://www.vbulletin.com/forum/bugs36.php?do=view&bugid=639
iran.gs
09-20-2006, 02:28 PM
so if its better why not vb do it ?
Code Monkey
09-20-2006, 03:48 PM
Because they didn't think of it?
That is what this entire site and a zillion other mod sites exist for. To supply options and improvements that vBulletin doesn't have.
Code Monkey
10-15-2006, 08:47 PM
Just checking in. I'm going to assume from the continued installs and silence that this is continuing to work in vBulletin 3.62? If not please let me know.
NeutralizeR
10-16-2006, 04:17 AM
Just checking in. I'm going to assume from the continued installs and silence that this is continuing to work in vBulletin 3.62? If not please let me know.
It's ok with vb 3.6.2
Code Monkey
10-17-2006, 01:41 AM
Thanks, that's good to know. I haven't updated yet.
da420
10-17-2006, 08:10 PM
Works for me too. :)
vbreal
11-13-2006, 09:17 PM
i have a php file that i need to run. i have to run it manually at the moment. the cron scheduler in my cpanel did not work. will this be able to execute a php file as if it was entered into the url bar or clicked.
Code Monkey
11-14-2006, 05:51 AM
This runs the cron scheduler, so no. If you want to runs something in the sheduler it needs to be file that is setup for vBulletin.
Tacama
11-15-2006, 02:06 AM
Working smoothly on VB 3.6.3.
Great hack Code Monkey. Thanks a lot :) .
Clicked Install of course ;).
transitbus
11-15-2006, 02:51 AM
Thanks! I was wondering about the whole cron thingy and this seems like a more efficient method.
3.6.3 .. I installed this to combat the fact that zoints tags look in /tags/*tagname*/ for cron.php .. but it doesn't appear to have done anything.
:(
Don't get me wrong, I love the idea, and have had no issues with other things calling cron.php, but the Zoint Tags thing is driving me mad! :)
Code Monkey
11-15-2006, 03:41 AM
I don't understand the problem Kall. Are you saying the Zoints tag system breaks the scheduled task system somehow? I am not familiar with that mod so I am not sure what it does other than create a tag system.
Code Monkey
11-15-2006, 03:47 AM
I see you are using a page compressor. It may be removing empty comment tags. In which case it will remove the vBulletin default code marker and this, and possibly default cron, won't be able to work.
Yeah.. the vBSEO Content Cleaner is what I am using.
Hmm.. well, what appears to be happening is: Zoints tags looks in its own (mod_rewrited) directory for cron.php. It's not there, and I get error messages.
Cron works everywhere else (and still does, since installing this Modification), but I am still seeing the error from the Zoints Tags looking for cron in the wrong place.
Code Monkey
11-15-2006, 02:40 PM
So you are saying zoints has it's own cron setup.
Not at all, it just tries to call $cronimage from /forum/tags/cron.php instead of /forum/cron.php...because that's the "directory" the viewer is in at the time.
*edit* /forum/tags/*tag name/cron.php is also called.
Code Monkey
11-18-2006, 04:36 AM
Sounds like something maybe they need to know about. They most likely have no idea it can interfere with the running of crons.
Viper007Bond
12-02-2006, 08:52 AM
Seems to be working fine in 3.6.4. :)
redlabour
12-04-2006, 03:34 AM
Uninstalled after using it for Month get nothing that i did not realize without using this. Still do not know what this does.
Viper007Bond
12-04-2006, 05:20 AM
Uninstalled after using it for Month get nothing that i did not realize without using this. Still do not know what this does.
As stated, default makes it not run as a background task. The user's page sits there and loads the "image" while the cron task is completed (the default cron script is called from within an <img> tag). This can take a little while, so the user keep seeing a "busy loading the page" icon or whatever until the cron is done and the "image" loads.
AJAX is Javascript, so the call to run the cron file is done truly in the background. ;)
redlabour
12-04-2006, 11:43 AM
What are we talking about?
0,00001 seconds ?
Tralala
02-16-2007, 12:28 PM
/clicks install
Elegant, seamless and smart. The best kind of mod. :)
Tralala
02-16-2007, 12:32 PM
What are we talking about?
0,00001 seconds ?
It depends on the size of your site, and the specific cron that's running at the time...
I have quite a few cron jobs scheduled, one being a nightly backup, and when those kick in, I can tell the site feels sluggish when loading pages. This mod fixes that.
cash7c3
02-27-2007, 04:06 AM
would this be possible to utilize a cron task to repair databases and restart the mysql service?
cash7c3
02-27-2007, 04:08 AM
It depends on the size of your site, and the specific cron that's running at the time...
I have quite a few cron jobs scheduled, one being a nightly backup, and when those kick in, I can tell the site feels sluggish when loading pages. This mod fixes that.
nightly backup for a accounts on my server? is this really possible with ajax? would you mind telling me more on how you have that working?
Tralala
02-27-2007, 06:07 PM
nightly backup for a accounts on my server? is this really possible with ajax? would you mind telling me more on how you have that working?
To clarify, it's possible with cron... this mod though initiates those (cron) sheduled tasks via an asyncronous AJAX call, allowing them to run in the background.
As far as how to get the nightly backup cron going in the first place, there are quite a few solutions... search and read and pick the one you like best... here are a few I've seen:
https://vborg.vbsupport.ru/showthread.php?t=126925
https://vborg.vbsupport.ru/showthread.php?t=105599
http://www.debianhelp.co.uk/mysqlscript.htm
http://www.vbhackers.com/f76/automatic-database-back-up-3013/index13.html
cash7c3
02-27-2007, 06:10 PM
thanks
Xoligy
02-28-2007, 02:26 PM
Wouldn't simpler method be to have window.stop at the bottom of your footer and then have ignore_user_abort(true); in the PHP file? For MSIE you could just evoke the escape key (27)
This will (in theory) effectively stop the page from continuing to load, but the php script will ignore the request and continue processing until it has finished.
Just an idea.
ultimo
04-06-2007, 05:56 PM
Ok this mod doesnt work on 3.6.5. Any more support for this mod? I have followed all instructions but the scheduled tasks are not running...:)
mhc1576
04-06-2007, 06:23 PM
It works without any problem in 3.6.5
ultimo
04-06-2007, 06:36 PM
Hmm I followed all the instructions. Funny thing is the original cron seems to be still working. Schedueld tasks runs when i load the forum page, but does not run when its not loaded. Any thoughts about something i am missing?
I uploaded the files to my forum directory, that is correct no?
Code Monkey
04-07-2007, 01:29 AM
Did you import the product xml file in your ACP?
ultimo
04-07-2007, 05:05 AM
Yep i did.
Code Monkey
04-07-2007, 02:20 PM
Without a website to look at there is not much anyone can do for you.
MAXpowerPXL
04-26-2007, 06:33 AM
Sweet, thanks!
Installed on 3.6.5, works great.
Sometimes I feel real sorry for developers answering so many repeated/stupid questions.
vgevolution
06-05-2007, 09:44 PM
Awesome! Working fine in 3.6.7 PL1. I can tell my pages are loading faster, plus it fixed a nagging cron not found bug in a couple of hacks I have. Thanks for this! :D
993ti
06-10-2007, 10:32 PM
Wow, is it me or did the pages load faster on my board?
Thanks for a great mod CM ;)
alessai
06-10-2007, 10:53 PM
so dose it make the forum faster ? safer ? or lighter ?
cant understand all that punsh of words
993ti
06-10-2007, 10:56 PM
Currently, when vb needs to run a sheduled task, it loads image code at the bottom of your forum page. Except it has a php file as the src of the img tag. This causes the php file to run which in turn runs the next scheduled task. This can, depending on the cron to run and the size of the site, cause a browser to seemingly hang until the script is finished running. This happens because this is a syncronous event. Meaning, it's waiting for the page to finish loading the image.
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.
And it did make my board faster.
Btw, does this also work if there are no users browsing the board?
The standard VBcron doesn't work without users browsing the site :(
Code Monkey
06-19-2007, 04:15 AM
And it did make my board faster.
Btw, does this also work if there are no users browsing the board?
The standard vBcron doesn't work without users browsing the site :(
It should work with any guest viewing that has javascript enabled. Other than that there has been a request for years for server cron versions of all the default scheduled task at vBulletin.com.
Code Monkey
06-19-2007, 04:17 AM
so dose it make the forum faster ? safer ? or lighter ?
cant understand all that punsh of words
It makes a background task asynchronous rather than synchronous which will return the visitors control of their browser sooner and therefor be seemingly faster to the user.
talenak
06-27-2007, 07:41 AM
My members often post in help that they post and it hangs, then they get tired of waiting, click go advanced, and everything processes.
I'm taking a leap of faith and guessing that this might help that situation a little because your description of the page hanging is exactly what they describe.
Do I have the right idea or am I off track? I don't really "get" it, I'm just curious if I'm at least guessing in the right direction. lol
Thanks!
Code Monkey
06-29-2007, 04:15 PM
A lot of things can cause that. I can tell you that it is unlikely that this mod will cause new problems and if that is the problem it will be fixed. It could also be hosting issues, the end users connection and b/w.
Mecho
07-09-2007, 10:39 AM
hi , sorry for my dum question .. i installed this one but would u plz tell me how can i be sure that it works in my site ?
thx
Edit : Top Process %CPU 14.0 httpd [www.domain.com] [/forum/clientscript/vb_ajax_cron.js]
!!! any idea ??
Code Monkey
07-13-2007, 02:42 PM
If all your crons are being run then it works. Or you can get Firebug for Firefox and actually see it work.
Fenriz
10-01-2007, 03:25 AM
With this hack I have a java script error on vbdrupal pages (IE 6,7 browser). Code Monkey, could you resolve this issue please.
Code Monkey
10-01-2007, 03:46 PM
Not enough info. I don't use vbdrupal so I would have no idea.
Fenriz
10-02-2007, 01:10 AM
It seems just need to comment the execution of this hack on vbdrupal pages (like <if condition="!(THIS_SCRIPT == 'drupal')"> ... </if>). But what exactly?
ewelin
01-03-2008, 08:19 PM
installed on 3.6.8 Patch Level 2 and appears to be working quite well.
joshbond
01-19-2008, 09:03 PM
There seriously needs to be some kind of instructions on how to install this thing.
Whats that code for too?
redlabour
01-29-2008, 04:58 PM
Does it work with 3.7 ?
Code Monkey
02-04-2008, 05:29 AM
Does it work with 3.7 ?
Still working on my dev forum at 3.7 so yes it should work just fine.
ArnyVee
04-19-2008, 01:39 PM
I just need a little direction to make sure that I'm doing this right.
Do I upload the ajax_cron.php file into the folder that includes the ajax.php and cron.php files? Do I then upload the clientscript folder into the same area? What if there's another folder with clientscript already? Or, do I put the contents (vb_ajax_cron.js) of the folder into the same clientscript folder that already exists?
I'm a newb, only been around code for about a month. :)
ru55ian
04-21-2008, 03:47 PM
installed on 3.6.8 works fine.
ArnyVee
04-21-2008, 05:53 PM
I'd really like to have this working on my site. Can anyone help me with the info two posts ago (Post #142) of this thread?
I appreciate it.
Code Monkey
04-22-2008, 05:27 AM
Just unzip the files to your local hard drive with the directories intact. Then open the folder that says it's contents need to be uploaded to your forum home. Highlight all the contents including the clientscript directory and drag them to your forum home directory in your ftp program. That's your forums home directory not your front page directory if you have one and it's different. Directories that are uploaded will merely merge their files with any directories that already exist in that path with the same name.
Hope that helps
ArnyVee
09-14-2008, 12:57 PM
Is this still functional in 3.7?
dbembibre
10-14-2008, 01:03 PM
Hey code_monkey, any diference (WRT performance) in execute vBCron with your script that execute vBCron with cron service available in the server ?
BigJohnny
03-07-2009, 03:10 AM
It doesnt seem to be working correctly in 3.8.1 . Ive checked my scheduled tasks log and the last things run were on the 1st of march when I installed it.
I dont have any entries since then.
I dont really know whats going on.
J11089A792A0
02-13-2011, 10:41 PM
Is this still functional in 4.1.1 ??! if no where I can found this hak work with vb 4.1.1 ?! pls !?
lukescotty
04-19-2012, 10:55 PM
not working on my 4.1.1 i want a working on too. it just messes up my template
cheers
Max Taxable
01-13-2014, 02:21 AM
Disregard - sorted.
pl804
12-15-2015, 03:20 PM
Do I still need this, or has the issue of the hanging page loads gone away with more recent browser versions?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.