Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Quote Expander / Collapse - By Technidev Details »»
Quote Expander / Collapse - By Technidev
Version: 1.00, by Dave Dave is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Category: Show Thread Enhancements - Version: 4.x.x Rating:
Released: 02-07-2016 Last Update: Never Installs: 35
Template Edits
Re-useable Code  
No support by the author.

Mark as installed = get support.

If you're tired of people quoting long posts and having to scroll past it, then this modification is definitely something you want to use.

This template modification will make it possible to resize quote containers and add an "Expand" button to it which can be clicked to view the whole quote.

This modification should work on pretty much all vBulletin 4 versions.

Installation
  1. Open the "showthread" template and paste the following above </body>
    HTML Code:
    <script>window.jQuery||document.write(unescape("%3Cscript src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js' type='text/javascript'%3E%3C/script%3E"));</script>
    <script>
    $(function(){
       $(".quote_container").each(function(index){
          if($(this).height() > 250){
             $(this).css({
                'height': '250px',
                'overflow': 'hidden'
             });
    
             $(this).parent().append('<div class="quote_expander"><a href="">Expand</a></div>'); 
          }
       });
    
       $(".quote_expander").click(function(){
          $(this).parent().find('.quote_container').css({'height': 'initial', 'overflow': 'initial'});
          $(this).remove();
          return false;
       });
    });
    </script>
  2. Now open the additional.css template under "CSS Templates" and add the following:
    HTML Code:
    .quote_expander{
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      -ms-box-sizing: border-box;
      box-sizing: border-box;
      font-size: 11px;
      text-align: center;
      color: rgb(63, 63, 63);
      cursor: pointer;
      padding-top: 65px;
      background: -webkit-linear-gradient(top, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      background: -moz-linear-gradient(top, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      background: -o-linear-gradient(top, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      background: linear-gradient(to bottom, rgba(45, 45, 45, 0) 0%, #C2CAD2 80%);
      width: 100%;
      position: absolute;
      bottom: 0;
    }
  3. Done.

How to change the height of when the quote should be resized?
Change the 2 occurences of the number "250" in the showthread template to whatever height you want.

How to change the background color of the expander?
Change all occurences of the color "#C2CAD2" in the additional.css template to the hex code of the color you want.

Screenshots

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
9 благодарности(ей) от:
Alan_SP, babyv0x, BrettC Frontier, Hostboard, izenberg, MarkFL, Techno Cowboy, TheLastSuperman, X-or

Comments
  #2  
Old 02-08-2016, 10:14 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice work, Dave!

I had to do something similar at the site I help admin (we have many users who will lazily quote an entire huge post to address one point), but I had to also account for LaTeX by MathJax making quotes grow after the DOM was in place. Fortunately they provide a script queue that will allow javascript to execute only after the LaTeX is done rendering.
Reply With Quote
  #3  
Old 02-08-2016, 10:32 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
Nice work, Dave!

I had to do something similar at the site I help admin (we have many users who will lazily quote an entire huge post to address one point), but I had to also account for LaTeX by MathJax making quotes grow after the DOM was in place. Fortunately they provide a script queue that will allow javascript to execute only after the LaTeX is done rendering.
Yeah I'm surprised vBulletin didn't create something like this themselves and that no one else released something like this before. Long quotes are the most annoying thing on forum boards.
Reply With Quote
  #4  
Old 02-09-2016, 10:04 AM
Alan_SP's Avatar
Alan_SP Alan_SP is offline
 
Join Date: Nov 2009
Posts: 1,122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Only thing I would add, if it is possible, that users choose if they want their quotes expanded or collapsed.
Reply With Quote
  #5  
Old 02-09-2016, 11:11 AM
ArcadeSyndicate's Avatar
ArcadeSyndicate ArcadeSyndicate is offline
 
Join Date: Oct 2008
Location: Germany
Posts: 298
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice, looks like xenforo
Reply With Quote
  #6  
Old 02-09-2016, 09:48 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ArcadeSyndicate View Post
very nice, looks like xenforo
Yep, that's where I got the idea from.
Reply With Quote
  #7  
Old 02-22-2016, 11:23 AM
Techno Cowboy's Avatar
Techno Cowboy Techno Cowboy is offline
 
Join Date: May 2014
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed & Thanks!
Reply With Quote
Благодарность от:
mysimsek
  #8  
Old 08-05-2016, 01:20 PM
X-or X-or is offline
 
Join Date: Nov 2005
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it's very nice, and working in 4.2.3 PL2
wish you could make this into a plugin for easy install
wish also you could re-collapse after expansion
it can be improved but very useful nonetheless
Reply With Quote
  #9  
Old 10-29-2016, 10:57 AM
Bulent Tekcan Bulent Tekcan is offline
 
Join Date: Oct 2003
Location: TURKEY - Istanbul
Posts: 437
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not work on 4.2.3 version, mesage not expand. When I press Expand button no any action. Can you check this problem ? Is it possible to make expand and collapse again function ?
Reply With Quote
  #10  
Old 06-07-2017, 10:58 AM
Flipfloptrader Flipfloptrader is offline
 
Join Date: Jan 2011
Location: Gold Coast
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works nicely on Avenger Fluid also on 4.2.5.
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 11:28 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.04754 seconds
  • Memory Usage 2,322KB
  • Queries Executed 24 (?)
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_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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