Collapsable First Post using AJAX (or Last Post!)
This modification is in the archives.
NOTICE: This is for vBulletin v3.6 ONLY. You can find a v3.5 compatible version here. *** Confirmed working on ALL vBulletin 3.6.x versions! *** Keywords: FORUMDISPLAY, search, results, collapse, AJAX, collapsable, first, last, unread, post Description: Allows you to expand/collapse the first, last or first unread 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 http://www.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, unless using the 'First Unread Post' option. Otherwise, the only queries performed are the same as those when a thread is normally viewed. The magic behind this modification is performed by http://jquery.com/. Usage: Simply click the expand icon [+] in front of the thread title to expand, and the collapse icon [-] to collapse. Rocket science, eh? Installation:
Notes: All template modifications are made automatically. They attach to pretty common text locations, so modified styles shouldn't* be a problem. However, for those who wish (or need) to perform the edits manually, you can find that information here Spoiler (click to open)
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> <script type="text/javascript" src="clientscript/vbulletin_vbpost.js"></script> In search_results - FIND: HTML Code:
$headinclude HTML Code:
<script type="text/javascript" src="clientscript/jquery.js"></script> <script type="text/javascript" src="clientscript/vbulletin_vbpost.js"></script> [CHANGED IN 1.2] 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)"> <if condition="$vbulletin->options['ajax_firstpost_firstlast']">id="vbpostrow_$thread[lastpostid]"<else />id="vbpostrow_$thread[firstpostid]"</if></if>> FIND: HTML Code:
$thread[title_editable]
<div>
HTML Code:
<if condition="empty($ajax_firstpost_excluded) || !in_array($forumid, $ajax_firstpost_excluded)"><img id="vbpostimg_<if condition="$vbulletin->options['ajax_firstpost_firstlast']">$thread[lastpostid]<else />$thread[firstpostid]</if>" src="$stylevar[imgdir_button]/expand.gif" onclick="return vbpost_get(<if condition="$vbulletin->options['ajax_firstpost_firstlast']">$thread[lastpostid]<else />$thread[firstpostid]</if>)" onMouseOver="this.style.cursor='pointer';" /></if> Close
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 https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=magn2o%40comcast%2enet&no_shipping=0&no_note=1&tax=0¤cy_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8, I won't mind.. really. Version History:
Tips, Tricks and Modifications:
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! Download
This modification is archived, downloads are still allowed. Screenshots |
Similar Mods
Collapsable First Post using AJAX for vB3.5 | vBulletin 3.5 Add-ons |