![]() |
Collapsable First Post using AJAX for vB3.5
[hr]-[/hr]
NOTICE: This is for vBulletin v3.5 ONLY. You can find a v3.6 compatible version here. [hr]-[/hr]Keywords: FORUMDISPLAY, search, results, collapse, AJAX, collapsable, first, post Description: Allows you to expand/collapse the first post of a thread from FORUMDISPLAY and search results without the need to load the entire thread. Details: Upon perusing the wonderful deals over at slickdeals.net, I noticed this nifty feature which caught my eye. I found it quite useful as most people have a bad habit of not being very descriptive with their thread titles. This little trick made my browsing experience much more enjoyable, so naturally I had to borrow [read: shamelessly rip] the idea. Please note that no additional queries are added. The only queries performed are the same as those when a thread is normally viewed. The magic behind this modification is performed by jQuery: The Write Less, Do More, JavaScript Library. vB 3.5 Notes: Please note that this version is developed for vB3.5, and as such, there are limitations not found in vB3.6. Currently, this modification is restricted to displaying the first post only, as the necessary tables and PHP to display last post, and first unread post aren't (easily) available in vB3.5 without more in-depth hacking and additional queries. This extended features may be added at a later date, but until then, this is the meat and potatos. [hr]-[/hr] Usage: Simply click the expand icon [+] in front of the thread title to expand, and the collapse icon [-] to collapse. Rocket science, eh? [hr]-[/hr] Installation:
Notes: All template modifications are made automatically. They attach to pretty common text locations using an intuitive automatic template editing routine. Modified styles shouldn't* be a problem. Honestly, I would be suprised if anyone actually NEEDED to make manual edits. However, for those who wish (or need) to perform the edits manually, you can find that information here. [hr]-[/hr] Comments: As with all my hacks, this modification is provided free of charge. However, if you find this product useful and have money burning a hole in your pocket, feel free to make a small :up:donation:up:, I won't mind.. really. :) Version History:
Currently Known Bugs:
* Please note that this modification was developed on a forum with a userbase of 1 (myself). I've tested it for basic functionality but I cannot guarantee functionality or behavior on your forum. So, please -- make backups before installing this product! |
For those who have problems with the automatic template edits, or who just like to do things the hard way, here are the template edits required:
First, disable the automatic template edits:
Now perform the following template edits: In FORUMDISPLAY - FIND: HTML Code:
$headinclude HTML Code:
<script type="text/javascript" src="clientscript/jquery.js"></script> [hr]-[/hr] In threadbit - FIND: (should be the first line) HTML Code:
<tr> HTML Code:
<tr<if condition="empty($ajax_firstpost_excluded) || !in_array($forumid, $ajax_firstpost_excluded)"> id="vbpostrow_$thread[firstpostid]"</if>> FIND: HTML Code:
$thread[title_editable] HTML Code:
<if condition="empty($ajax_firstpost_excluded) || !in_array($forumid, $ajax_firstpost_excluded)"><img id="vbpostimg_$thread[firstpostid]" src="$stylevar[imgdir_button]/expand.gif" onclick="return vbpost_get($thread[firstpostid])" onMouseOver="this.style.cursor='pointer';" /></if> |
Thanks :up:
|
Thanks man :)
|
This is one neat hack! Nice job and all works just as advertised. Is there anyway ONLY Threads with no replies can show the plus sign?
|
thats a crackin idea, installed and it works a treat!!!
|
Not working for me but I think I know why.
I have in my root a folder that contains the default style for the site. Because of that could it be causing the errors I'm getting because the images are now in /style/images instead of /images? This is what I get in Firefox: Code:
Database error in vBulletin 3.6.5: In IE, it just gives the Database encountered an error. My site is www.nokturnalist.com if you want to check it yourself. |
Quote:
|
Well I installed the 3.6 without realizing my site uses 3.5.4 so I uninstalled it and removed the manual entries and then reinstalled it with 3.5. Maybe I'll do it again, I must have left something out. I did make a backup before I installed it so I can always revert to that.
|
The error message you posted says your site runs vBulletin 3.6.5 -- not 3.5.4.
Quote:
|
Any chance this will come for 3.6x? I really think this mod is useful.
|
Quote:
|
I've done everything here, tried both the manual and the auto. The only problem is that the + box doesn't open up at all. It's like the javascript isn't activating. I've double checked to make sure it's in the right folders, and it is...any suggestions?
|
Are you allowing AJAX
|
Is there an option for that somewhere? :D
*runs off to go check* |
Crap. Yes, I am. It's set to Enable All. Any suggestions?
|
All times are GMT. The time now is 04:54 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:
|