![]() |
Collapsable First Post using AJAX (or Last Post!)
[hr]-[/hr]
NOTICE: This is for vBulletin v3.6 ONLY. You can find a v3.5 compatible version here. [hr]-[/hr]*** Confirmed working on ALL vBulletin 3.6.x versions! *** [hr]-[/hr] 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 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 jQuery: The Write Less, Do More, JavaScript Library. [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, 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. [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 donation, I won't mind.. really. :) Version History:
[hr]-[/hr] 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! |
wow man nice hack thanx for this i just love ajax
|
will be installing this when i get home. awesome mod!
|
<a href="http://www.4x4mecca.com/forum/forumdisplay.php?f=36" target="_blank">http://www.4x4mecca.com/forum/forumdisplay.php?f=36</a>
I get an error message when I try. The plus sign is there, but what I see is "There was an error. Please try again." |
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 search_results - FIND: HTML Code:
$headinclude HTML Code:
<script type="text/javascript" src="clientscript/jquery.js"></script> [hr]-[/hr] [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] 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> |
Quote:
Let me nose around a bit. |
@4x4 Mecca:
Redownload the archive and upload/overwrite your existing vbpost_ajax.php with the new one. Let me know if that fixes it. |
Thanks! I just edited the teplates manually just incase that was the problem. It still isn't working.
|
Error is still there. Any idea what might be interfering?
|
Quote:
|
Ok, I removed the download link for a second while I try and track this down. My apologies.
|
I have a few (read maybe a lot) hacks installed, but I don't know which one could be messing with it. Anyone else recreate this on their own site?
|
THANKS M8 nice work :)
|
this is also giving a javascript error in newposts
|
Wait, you get an error when trying to write a new post? I don't see how this could affect that. What's the error?
|
no i get the error like the poster above me and also in do=getnew
|
I didn't get an error when making a new post or new reply.
|
and also in do=getdaily
|
where is the new file ?
|
uploaded
|
Still not working, and errors on get new posts too.
|
sorry, nothing changed
|
Do me a favor, check to see if you have a vbpost_postbit template..
|
Yes, I do.
|
I do
|
This is odd.. for some reason or another, it's not being displayed. I installed a fresh vB and imported this product and it worked fine. There has to be a hack conflict somewhere.
|
Is there any way another mod could be creating this problem?
|
Nice addon, great job!
|
Question.
When a user hits the (+), does it add to the thread view count? Because I don't see it adding in your screenshots. |
Quote:
|
Hm, can you please add an option that allows that?
|
done, uploaded again.
|
still the same for me
|
still errors :(
|
This is so hard to do remotely.. lol.
|
I am using vbseo if that means something
|
I developed this on a forum using vBSEO. That shouldn't be a problem.
|
the image code I had to add manually in templates because of vbplaza
|
Ok, upload this file. This isn't going to fix it, it's to give me more information. I'm going to need you to delete it as soon as I'm done.
|
after giving the alert, the image ajaxsmall.gif still displays and i must refresh to stop it
|
All times are GMT. The time now is 07:14 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:
|