Back to vBulletin 3.5 Add-ons

Collapsable First Post using AJAX for vB3.5
Mod Version: 1.2.2, by magnus

This modification is in the archives.
vB Version: 3.5.8 Rating: (1 vote - 5.00 average) Installs: 7
Released: 26 Apr 2007 Last Update: 26 Apr 2007 Downloads: 49
Not Supported Uses Plugins Template Edits Additional Files  


NOTICE: This is for vBulletin v3.5 ONLY. You can find a v3.6 compatible version here.



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 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. 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/.

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.



Usage:
Simply click the expand icon [+] in front of the thread title to expand, and the collapse icon [-] to collapse. Rocket science, eh?



Installation:
  1. Download and unzip the ajax_first_post_vB3.5.zip archive.
  2. Upload necessary files to their respective locations.
  3. Import the product-ajax_first_post.xml via the Product Manager.
  4. Make any desired configuration changes via AdminCP > vBulletin Options > Collapsable First Post using AJAX
  5. ???
  6. Profit!

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

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:
  • Browse to AdminCP > vBulletin Options > Collapsable First Post Using AJAX Options
  • Select No for Enable Automatic Template Editing

Now perform the following template edits:

In FORUMDISPLAY -

FIND:
HTML Code:
$headinclude
ADD AFTER:
HTML Code:
<script type="text/javascript" src="clientscript/jquery.js"></script>
<script type="text/javascript" src="clientscript/vbulletin_vbpost.js"></script>



In threadbit -

FIND: (should be the first line)
HTML Code:
<tr>
REPLACE WITH:
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]
		<div>
ADD AFTER:
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>

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&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8, I won't mind.. really.

Version History:
  • 1.2.2
    • First vB3.5 release.

Currently Known Bugs:
  • None

* 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 and cannot be downloaded.

Screenshots

   

Similar Mods

Forum Display Enhancements Collapsable First Post using AJAX (or Last Post!) vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024