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
  #12  
Old 12-17-2017, 06:35 AM
iamme_meisi iamme_meisi is offline
 
Join Date: Dec 2017
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working great!
Reply With Quote
  #13  
Old 01-23-2018, 12:16 PM
iyihost iyihost is offline
 
Join Date: Feb 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

l want to 3.8.x
who can hep me ?
Reply With Quote
  #14  
Old 03-16-2018, 07:33 AM
ramesh_umk3 ramesh_umk3 is offline
 
Join Date: Jul 2010
Location: Earth
Posts: 194
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by iyihost View Post
l want to 3.8.x
who can hep me ?
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").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').css({'height': 'initial', 'overflow': 'initial'});
      $(this).remove();
      return false;
   });
});
</script>
Should Work with vB 3.8

Try once.

Thanks.
Reply With Quote
  #15  
Old 04-12-2018, 11:32 AM
Mellow's Avatar
Mellow Mellow is offline
 
Join Date: Nov 2003
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice, works great thanks... would be nice to have a contract on the expanded quote but this is nice enough.
Reply With Quote
  #16  
Old 09-24-2020, 04:21 PM
Hostboard's Avatar
Hostboard Hostboard is offline
 
Join Date: May 2002
Location: CT
Posts: 843
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Vbulletin 4 has a "Use Remote jQuery" with; Google, jQuery, and Microsoft. being listed.
Your using CloudFlare jQuery 2.2.0
Any reason why you did not default to one of the built in selections? Are there any performance enhancements between any of these? Would it be worth while to add Cloudflare to the available default configuration list? Could not be too difficult... Will vBulletin 4.2.x run under jQuery 2.2.0?

Would be nice to have a collapse option once expanded
Reply With Quote
Благодарность от:
formentera
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 06:08 PM.


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.06896 seconds
  • Memory Usage 2,292KB
  • 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
  • (1)bbcode_code
  • (2)bbcode_html
  • (1)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
  • (6)post_thanks_box
  • (10)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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