Mauu
13 Sep 2006, 02:50
At YoungCoders (http://www.youngcoders.com), I recently wrote an ajax enabled recent posts widget, and I thought I would post it here. I do not recommended this for high traffic forums, as you'll be running a lot of queries.
I'm going to forget to check back here and update this with any changes. So, please see here (http://www.youngcoders.com/showthread.php?p=95288), which is where I will maintain and try to provide support.
I) Setting up the Feed
1) First, you need the improved external.php file from vBulletin.org. The link is here: http://www.vbulletin.org/forum/showthread.php?t=105008&highlight=fps_external
2) This new external file lacks some of the documented features, and the feature we need is the latest posts (not latest threads). The attached file resolves that and may only be used if you have a valid vBulletin license. The reason we may not use the built-in one is because it does not have support for permissions and will therefore treat every user as a guest. Credit for fps_external.php goes to the original authors; my revision was trivial.
3) Upload fps_external.php into your forum directory.
II) Setting up the Ajax
1) Our threads are going to appear in an unordered list. So, let's setup our default list:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
We have to throw in the please wait to make our page validate and also to notify our users that we're fetching the feed.
2) You then need some JavaScript. I'm not going to document this as it's pretty self-explanatory:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The above code will fetch the sidebar just once. To make it update, you must have it run through intervals:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Terms of Use: For each site you deploy this on, you must tell one friend about YoungCoders.com ;)
For a preview and more discussion: http://www.youngcoders.com/showthread.php?p=95288&styleid=19
I'm going to forget to check back here and update this with any changes. So, please see here (http://www.youngcoders.com/showthread.php?p=95288), which is where I will maintain and try to provide support.
I) Setting up the Feed
1) First, you need the improved external.php file from vBulletin.org. The link is here: http://www.vbulletin.org/forum/showthread.php?t=105008&highlight=fps_external
2) This new external file lacks some of the documented features, and the feature we need is the latest posts (not latest threads). The attached file resolves that and may only be used if you have a valid vBulletin license. The reason we may not use the built-in one is because it does not have support for permissions and will therefore treat every user as a guest. Credit for fps_external.php goes to the original authors; my revision was trivial.
3) Upload fps_external.php into your forum directory.
II) Setting up the Ajax
1) Our threads are going to appear in an unordered list. So, let's setup our default list:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
We have to throw in the please wait to make our page validate and also to notify our users that we're fetching the feed.
2) You then need some JavaScript. I'm not going to document this as it's pretty self-explanatory:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
The above code will fetch the sidebar just once. To make it update, you must have it run through intervals:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Terms of Use: For each site you deploy this on, you must tell one friend about YoungCoders.com ;)
For a preview and more discussion: http://www.youngcoders.com/showthread.php?p=95288&styleid=19