Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Collapsable First Post using AJAX for vB3.5 Details »»
Collapsable First Post using AJAX for vB3.5
Version: 1.2.2, by magnus magnus is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 04-25-2007 Last Update: 04-25-2007 Installs: 7
Uses Plugins Template Edits
Additional Files  
No support by the author.

[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:
  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.

[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:
  • 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!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 04-26-2007, 01:02 PM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>

[hr]-[/hr]
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>
Reply With Quote
  #3  
Old 04-26-2007, 07:00 PM
apdcanari apdcanari is offline
 
Join Date: May 2005
Location: Belgique
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks :up:
Reply With Quote
  #4  
Old 04-29-2007, 08:36 PM
letsjoy's Avatar
letsjoy letsjoy is offline
 
Join Date: Jun 2006
Location: Dhump State
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man
Reply With Quote
  #5  
Old 04-30-2007, 12:31 AM
Dave Hawley Dave Hawley is offline
 
Join Date: Jun 2004
Location: Australia
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #6  
Old 05-03-2007, 01:04 PM
Gizmo5h1t3's Avatar
Gizmo5h1t3 Gizmo5h1t3 is offline
 
Join Date: Aug 2005
Location: ROCHDALE LANCS UK
Posts: 650
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thats a crackin idea, installed and it works a treat!!!
Reply With Quote
  #7  
Old 05-04-2007, 03:22 AM
skooby skooby is offline
 
Join Date: May 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 05-04-2007, 10:39 AM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by skooby View Post
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:
You're trying to run the vB3.5 version on vB3.6. Click here for the vB3.6 version
Reply With Quote
  #9  
Old 05-04-2007, 12:39 PM
skooby skooby is offline
 
Join Date: May 2006
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 05-04-2007, 01:31 PM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The error message you posted says your site runs vBulletin 3.6.5 -- not 3.5.4.

Quote:
Database error in vBulletin 3.6.5:
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05567 seconds
  • Memory Usage 2,303KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (6)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete