The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Collapsable First Post using AJAX for vB3.5 Details »» | |||||||||||||||||||||||||||
Collapsable First Post using AJAX for vB3.5
Developer Last Online: Feb 2012
[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! Show Your Support
|
Comments |
#2
|
||||
|
||||
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> [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]
<div>
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> |
#3
|
|||
|
|||
Thanks :up:
|
#4
|
||||
|
||||
Thanks man
|
#5
|
|||
|
|||
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?
|
#6
|
||||
|
||||
thats a crackin idea, installed and it works a treat!!!
|
#7
|
|||
|
|||
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: Invalid SQL: SELECT post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted, user.*, userfield.*, usertextfield.*, icon.title as icontitle, icon.iconpath, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid ,avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width AS avwidth,customavatar.height AS avheight , editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline, editlog.reason AS edit_reason, post_parsed.pagetext_html, post_parsed.hasimages FROM post AS post LEFT JOIN user AS user ON(user.userid = post.userid) LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid) LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid = user.userid) LEFT JOIN icon AS icon ON(icon.iconid = post.iconid) LEFT JOIN avatar AS avatar ON(avatar.avatarid = user.avatarid) LEFT JOIN customavatar AS customavatar ON(customavatar.userid = user.userid) LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid) LEFT JOIN post_parsed AS post_parsed ON(post_parsed.postid = post.postid AND post_parsed.styleid_code = -1 AND post_parsed.styleid_html = -1 AND post_parsed.styleid_php = -1 AND post_parsed.styleid_quote = -1) WHERE post.postid = 61; MySQL Error : Table 'noktric4_forum.post_parsed' doesn't exist Error Number : 1146 Date : Friday, May 4th 2007 @ 12:18:06 AM Script : http://www.nokturnalist.com/vbpost_ajax.php Referrer : http://www.nokturnalist.com/forumdisplay.php?f=2 In IE, it just gives the Database encountered an error. My site is www.nokturnalist.com if you want to check it yourself. |
#8
|
||||
|
||||
Quote:
|
#9
|
|||
|
|||
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.
|
#10
|
||||
|
||||
The error message you posted says your site runs vBulletin 3.6.5 -- not 3.5.4.
Quote:
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|