PDA

View Full Version : Board Optimization - vB AJAX Cron


Code Monkey
12 Aug 2006, 00:58
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. (http://www.vbulletin.org/forum/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 (http://www.vbulletin.org/forum/showthread.php?t=123720)







ekd12x0002w#rt2200cmvbm

alraqee
12 Aug 2006, 02:17
Oops

first replay

i will try it soon

ArabSQuad
12 Aug 2006, 04:41
didn't really get what does the hack do ......

but thnx anyway .... :/

Code Monkey
12 Aug 2006, 04:49
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
12 Aug 2006, 04:50
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
12 Aug 2006, 05:01
Great work, thanks! :)

bollie
12 Aug 2006, 05:52
where upload ajax_cron.php ?

Code Monkey
12 Aug 2006, 06:49
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
12 Aug 2006, 07:01
Thx ;)

Code Monkey
12 Aug 2006, 14:04
26 downloads and only 8 installs?

The button must be stuck! :D

Mohamed Ashraf
12 Aug 2006, 15:14
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
12 Aug 2006, 15:18
I dont understand?

Where is there any image used when using a cron? Crons are made to run automatic, aren't they?

redlabour
12 Aug 2006, 15:21
Thx - works great ! :D

Code Monkey
12 Aug 2006, 15:26
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
12 Aug 2006, 15:31
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
12 Aug 2006, 16:14
Installed
how do i make sure its working properly

Code Monkey
12 Aug 2006, 16:30
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
12 Aug 2006, 16:39
Thx for the Firebug ;)

Code Monkey
12 Aug 2006, 16:51
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
12 Aug 2006, 18:09
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
12 Aug 2006, 18:18
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
12 Aug 2006, 22:51
This is a great idea and working perfectly. Thanks for this Code Monkey

Code Monkey
13 Aug 2006, 00:13
You're welcome and thank you.

nicedreams
13 Aug 2006, 03:32
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
13 Aug 2006, 03:49
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
13 Aug 2006, 03:54
Actually, I think I see what you mean in number one. I think I have a way around that.

Code Monkey
13 Aug 2006, 04:08
I'm going to need a link to those pages.

nicedreams
13 Aug 2006, 04:31
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
13 Aug 2006, 04:35
But that will break it for many other sites so it is not a solution.

nicedreams
13 Aug 2006, 04:42
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
13 Aug 2006, 04:46
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
13 Aug 2006, 04:55
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
13 Aug 2006, 05:13
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
13 Aug 2006, 05:39
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
13 Aug 2006, 06:52
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
13 Aug 2006, 07:10
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
13 Aug 2006, 07:15
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
13 Aug 2006, 07:26
If you just downloaded the update you need to re-download. I put the wrong js file in. Time for bed.

redlabour
13 Aug 2006, 07:54
Thx again for Update !

nicedreams
13 Aug 2006, 14:18
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
13 Aug 2006, 15:19
Why don't you just update and be done with it? ;)

It's all done in the javascript now.

Code Monkey
13 Aug 2006, 16:32
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
13 Aug 2006, 18:10
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 &amp; 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
14 Aug 2006, 00:51
What am I supposed to do with that? Just look in your plugins and see if one is using cron_start.

Paul M
14 Aug 2006, 00:58
Brollie, you first posted that error over a week ago (here (http://www.vbulletin.org/forum/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
14 Aug 2006, 02:12
Ah, I see. No fishing in my mod thread Bollie. :D

ferrarislave
15 Aug 2006, 03:12
how do I import the feed?

Code Monkey
15 Aug 2006, 04:32
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
16 Aug 2006, 16:42
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
17 Aug 2006, 23:32
/me 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
18 Aug 2006, 00:22
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
18 Aug 2006, 00:39
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
18 Aug 2006, 04:07
Thanks for the update :)

Revan
18 Aug 2006, 11:03
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
18 Aug 2006, 14:18
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
19 Aug 2006, 00:03
Awesome. Installed.

Code Monkey
19 Aug 2006, 02:24
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
19 Aug 2006, 16:11
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
19 Aug 2006, 18:06
Nice hack Code Monkey :).

/me clicks install.

Code Monkey
19 Aug 2006, 21:53
Thank you very much.

Code Monkey
23 Aug 2006, 03:19
Anyone had any issues with this?

sickboy6ths
24 Aug 2006, 09:38
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
24 Aug 2006, 14:22
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
26 Aug 2006, 18:31
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
26 Aug 2006, 20:02
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
27 Aug 2006, 00:05
Yeah I seen the .js scripts and I wasn't for sure if it was or not.

Alcatraz

Code Monkey
27 Aug 2006, 05:09
You should have no problems. Thanks for posting and thanks for clicking install.

Brandon Sheley
30 Aug 2006, 22:06
thanks for the mod Code Monkey, I'll give it a try :)

/me clicks install

Code Monkey
31 Aug 2006, 05:30
I am sure you will find it useful and beneficial.

Enjoy

DementedMindz
04 Sep 2006, 08:52
Code Monkey thank you very much and once again nice work. installed

Code Monkey
05 Sep 2006, 02:37
I'm glad you like it and find it useful.

WritersBeat
05 Sep 2006, 07:41
I shall give this a try :)

Code Monkey
06 Sep 2006, 04:10
Hope it worked for you. :D

Exitilus
06 Sep 2006, 04:13
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
06 Sep 2006, 04:56
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
06 Sep 2006, 12:09
instead of a small piece of html to show an image, we now have?

A bigger piece.... nice!

Code Monkey
06 Sep 2006, 14:14
And where would that be?

Exitilus
06 Sep 2006, 18:57
I've done the fix. But the error sems to be coming from ajax_cron.php

Code Monkey
07 Sep 2006, 03:20
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
07 Sep 2006, 20:00
Nope :) I trust your judgement :)

I think I was half asleep when I made the previous reply *lol* :)

Master Nemesis
07 Sep 2006, 20:42
cheers will intall later

Code Monkey
08 Sep 2006, 02:50
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
11 Sep 2006, 23:14
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
12 Sep 2006, 02:20
Let me know how it works for you. :D

Axel Foley
13 Sep 2006, 21:14
No more cron.php errors with vBadvanced...;)

It's working fine...thank you very much for your work...

yessir
14 Sep 2006, 04:05
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
15 Sep 2006, 03:59
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
16 Sep 2006, 07:49
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
16 Sep 2006, 14:24
That is not caused by this mod. See this thread. http://www.vbulletin.com/forum/bugs36.php?do=view&bugid=639

iran.gs
20 Sep 2006, 15:28
so if its better why not vb do it ?

Code Monkey
20 Sep 2006, 16:48
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
15 Oct 2006, 21:47
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
16 Oct 2006, 05:17
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
17 Oct 2006, 02:41
Thanks, that's good to know. I haven't updated yet.

da420
17 Oct 2006, 21:10
Works for me too. :)

vbreal
13 Nov 2006, 22:17
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
14 Nov 2006, 06:51
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
15 Nov 2006, 03:06
Working smoothly on VB 3.6.3.

Great hack Code Monkey. Thanks a lot :) .

Clicked Install of course ;).

transitbus
15 Nov 2006, 03:51
Thanks! I was wondering about the whole cron thingy and this seems like a more efficient method.

kall
15 Nov 2006, 04:27
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
15 Nov 2006, 04:41
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
15 Nov 2006, 04:47
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.

kall
15 Nov 2006, 05:43
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
15 Nov 2006, 15:40
So you are saying zoints has it's own cron setup.

kall
17 Nov 2006, 04:29
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
18 Nov 2006, 05:36
Sounds like something maybe they need to know about. They most likely have no idea it can interfere with the running of crons.

Viper007Bond
02 Dec 2006, 09:52
Seems to be working fine in 3.6.4. :)

redlabour
04 Dec 2006, 04:34
Uninstalled after using it for Month get nothing that i did not realize without using this. Still do not know what this does.

Viper007Bond
04 Dec 2006, 06:20
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
04 Dec 2006, 12:43
What are we talking about?

0,00001 seconds ?

Tralala
16 Feb 2007, 13:28
/clicks install

Elegant, seamless and smart. The best kind of mod. :)

Tralala
16 Feb 2007, 13:32
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
27 Feb 2007, 05:06
would this be possible to utilize a cron task to repair databases and restart the mysql service?

cash7c3
27 Feb 2007, 05:08
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
27 Feb 2007, 19:07
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:

http://www.vbulletin.org/forum/showthread.php?t=126925
http://www.vbulletin.org/forum/showthread.php?t=105599
http://www.debianhelp.co.uk/mysqlscript.htm
http://www.vbhackers.com/f76/automatic-database-back-up-3013/index13.html

cash7c3
27 Feb 2007, 19:10
thanks

Xoligy
28 Feb 2007, 15:26
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
06 Apr 2007, 18:56
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
06 Apr 2007, 19:23
It works without any problem in 3.6.5

ultimo
06 Apr 2007, 19:36
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
07 Apr 2007, 02:29
Did you import the product xml file in your ACP?

ultimo
07 Apr 2007, 06:05
Yep i did.

Code Monkey
07 Apr 2007, 15:20
Without a website to look at there is not much anyone can do for you.

MAXpowerPXL
26 Apr 2007, 07:33
Sweet, thanks!

Installed on 3.6.5, works great.


Sometimes I feel real sorry for developers answering so many repeated/stupid questions.

vgevolution
05 Jun 2007, 22:44
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
10 Jun 2007, 23:32
Wow, is it me or did the pages load faster on my board?
Thanks for a great mod CM ;)

alessai
10 Jun 2007, 23:53
so dose it make the forum faster ? safer ? or lighter ?

cant understand all that punsh of words

993ti
10 Jun 2007, 23:56
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
19 Jun 2007, 05:15
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
19 Jun 2007, 05:17
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
27 Jun 2007, 08:41
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
29 Jun 2007, 17:15
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
09 Jul 2007, 11:39
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
13 Jul 2007, 15:42
If all your crons are being run then it works. Or you can get Firebug for Firefox and actually see it work.

Fenriz
01 Oct 2007, 04:25
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
01 Oct 2007, 16:46
Not enough info. I don't use vbdrupal so I would have no idea.

Fenriz
02 Oct 2007, 02:10
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
03 Jan 2008, 21:19
installed on 3.6.8 Patch Level 2 and appears to be working quite well.

joshbond
19 Jan 2008, 22:03
There seriously needs to be some kind of instructions on how to install this thing.
Whats that code for too?

redlabour
29 Jan 2008, 17:58
Does it work with 3.7 ?

Code Monkey
04 Feb 2008, 06:29
Does it work with 3.7 ?

Still working on my dev forum at 3.7 so yes it should work just fine.

ArnyVee
19 Apr 2008, 14:39
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
21 Apr 2008, 16:47
installed on 3.6.8 works fine.

ArnyVee
21 Apr 2008, 18:53
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
22 Apr 2008, 06:27
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
14 Sep 2008, 13:57
Is this still functional in 3.7?

dbembibre
14 Oct 2008, 14:03
Hey code_monkey, any diference (WRT performance) in execute vBCron with your script that execute vBCron with cron service available in the server ?

BigJohnny
07 Mar 2009, 04:10
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
13 Feb 2011, 23:41
Is this still functional in 4.1.1 ??! if no where I can found this hak work with vb 4.1.1 ?! pls !?

lukescotty
19 Apr 2012, 23:55
not working on my 4.1.1 i want a working on too. it just messes up my template

cheers

Max Taxable
13 Jan 2014, 02:21
Disregard - sorted.

pl804
15 Dec 2015, 16:20
Do I still need this, or has the issue of the hanging page loads gone away with more recent browser versions?