Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Collapsable First Post using AJAX (or Last Post!) Details »»
Collapsable First Post using AJAX (or Last Post!)
Version: 1.2.1, by magnus magnus is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.6.8 Rating:
Released: 04-17-2007 Last Update: 04-26-2007 Installs: 412
Uses Plugins Auto-Templates
Additional Files  
No support by the author.

[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:
  1. Download and unzip the ajax_first_post.zip archive.
  2. Upload necessary files to their respective locations. (Attention custom style users! Be sure to upload the images to your custom image directory.)
  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, 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:
  • 1.0.0 - Initial release, here's to hoping...
  • 1.1.0
    • Fixed JavaScript errors when using search.
    • Resolved (known) cross browser compatibility issues.
  • 1.2.0
    • New AdminCP configuration options:
      • Ability to select first or last post to be displayed.
      • Ability to disable on a per forum basis.
      • Option to update thread views when expanded.
      • Option to disable automatic template editing with a single click.
    • Tweaked a couple plugins to prevent unnecessary checking.
    • Properly registers in Who's Online
  • 1.2.1
    • Will no longer show expand icon next to thread redirects.
    • Added ability to display first unread post.
    • Completely revamped the automatic template editing system. Should now be able to make template edits to even the most modified templates as well.
    • Fixed a couple non-breaking typos.
    • Included JavaScript in USERCP_SHELL to allow expand/collapse of subscribed threads.
    • Added a hover title to the expand icon to inform the user what they can expect when clicking it.

[hr]-[/hr]
Tips, Tricks and Modifications:

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
  #332  
Old 06-04-2007, 04:37 PM
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 anzo View Post
hmm... I've installed everything as it was instructed, but it doesn't work!
I don't even see the "+" signs...

http://latforums.lv/forum1.html

I'm using Aria skin and vBSEO,
maybe it has something to do with it?
No, I checked your site. It's working. You just haven't uploaded the images to the correct folders.

On your forum, it looks like they should be uploaded to the /17_lat/ directory.

Once done correctly, you should be able to access both images at:

http://latforums.lv/17_lat/expand.gif
http://latforums.lv/17_lat/expand_collapsed.gif
Reply With Quote
  #333  
Old 06-04-2007, 07:26 PM
anzo's Avatar
anzo anzo is offline
 
Join Date: Sep 2005
Location: Latvia
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default


Thank You!
Reply With Quote
  #334  
Old 06-04-2007, 10:25 PM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

best. picture. ever.

Reply With Quote
  #335  
Old 06-06-2007, 06:02 PM
Evaporate Evaporate is offline
 
Join Date: May 2007
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant.

Simple but effective. I haven't tried it with lots of traffic yet but should I guess actually reduce database load.
Reply With Quote
  #336  
Old 06-08-2007, 04:38 AM
SemperFideles's Avatar
SemperFideles SemperFideles is offline
 
Join Date: Oct 2006
Location: Northern VA
Posts: 223
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by magnus View Post
This is by design. The search results SQL doesn't contain all the necessary information to display anything other than the first post, so regardless of what you've selected within the AdminCP, anything involving the search results will always display first post.

It's something that may possibly be worked in later. If you wish to change the template layout, the template you're looking for is vbpost_postbit. As for trying to find changes made by the automatic template edits, you can't. They are done on-the-fly.
I'm sorry magnus to bother you if you covered it previously. I tried searching for the term I was using.

When I click on Today's Posts, the results display not only the title of all the threads (if I click on the thread titles I'm taken to the first post). But, each thread listing also contains a clickable icon to "View Last Post".

Thus, it seems that the search results are, in fact, returning the Thread ID and Post ID of bost the first and last posts for each thread in the list. I'm not sure I understand, then, when you say that it doesn't contain "necessary information" to display anything other than the first post.

When I click on a particular forum for instance, it seems like the only thing I see are the thread title (which I can click on for the first post) and a clickable icon to "View Last Post". Thus, like search results, the forum listing seems to contain thread id and post id for each thread.

Why, on the one hand, does the forum listing contain the information needed while, on the other, the search results do not?
Reply With Quote
  #337  
Old 06-08-2007, 01:57 PM
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 SemperFideles View Post
I'm sorry magnus to bother you if you covered it previously. I tried searching for the term I was using.

When I click on Today's Posts, the results display not only the title of all the threads (if I click on the thread titles I'm taken to the first post). But, each thread listing also contains a clickable icon to "View Last Post".

Thus, it seems that the search results are, in fact, returning the Thread ID and Post ID of bost the first and last posts for each thread in the list. I'm not sure I understand, then, when you say that it doesn't contain "necessary information" to display anything other than the first post.

When I click on a particular forum for instance, it seems like the only thing I see are the thread title (which I can click on for the first post) and a clickable icon to "View Last Post". Thus, like search results, the forum listing seems to contain thread id and post id for each thread.

Why, on the one hand, does the forum listing contain the information needed while, on the other, the search results do not?
There's no (easily) available way to pull the first unread postid within search. So, to prevent accidental breakage, search results were restricted to firstpostid. Yes, they can display lastpostid. It was just simpler, at the time, to just force forstpostid. My logic was that someone searching was looking for something specific, and generally, that information would be found in the first post.

If you want lastpostid results within search, edit the Make changes to 'threadbit' template plugin.

FIND:
PHP Code:
            if (THIS_SCRIPT == 'search')
            {
                
$postidtype 'firstpostid';
                
$titlephrase $vbphrase['first_post'];
            } 
REPLACE WITH:
PHP Code:
            if (THIS_SCRIPT == 'search')
            {
                
$postidtype 'lastpostid';
                
$titlephrase $vbphrase['last_post'];
            } 
This will only work for firstpostid and lastpostid. It will not work for the first unread post.
Reply With Quote
  #338  
Old 06-08-2007, 02:12 PM
Quickness Quickness is offline
 
Join Date: Oct 2006
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for this awesome mod -- clicks install
Reply With Quote
  #339  
Old 06-18-2007, 10:23 PM
macshrine macshrine is offline
 
Join Date: Dec 2003
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Love it, great job!
Reply With Quote
  #340  
Old 06-29-2007, 07:11 AM
Terrasoft Terrasoft is offline
 
Join Date: May 2007
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its weird, the hack works great but not in the search feature. The pluses are there, but when they are clicked on...nothing happens. I installed it and had to do the manual template edits and nothing...any suggestions?
Reply With Quote
  #341  
Old 06-29-2007, 10:37 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 Terrasoft View Post
Its weird, the hack works great but not in the search feature. The pluses are there, but when they are clicked on...nothing happens. I installed it and had to do the manual template edits and nothing...any suggestions?
You're using the latest version and you had to use manual template edits? That's weird..

Browse to your search page, click view source, and make sure the javascript is being loaded. That's the culprit 99.9% of the time, especially with manual edits.
Reply With Quote
Reply


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 07:56 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08585 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
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_php
  • (4)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
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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