Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Collapsable Quotes Details »»
Collapsable Quotes
Version: 1.02, by Hellcat Hellcat is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: 3.5.3 Rating:
Released: 01-31-2006 Last Update: 02-02-2006 Installs: 38
Template Edits
 
No support by the author.

As requested in this thread

Collapsable Quote Mod

What does it do?
==================

Sometimes, when others post lots of quotes, or very long ones, you might get the wish to hide the quoted text and only read the new posted message.
Now you can
This little mod makes the quotes collapsable, like the categories on the forumhome or other areas of vBulletin.


Installation
==============

To apply this go to:
AdminCP -> Style Manager -> Edit templates -> "BB Code Layout Templates" group -> Template: "bbcode_quote"

Edit that template, cut out (=delete) EVERYTHING that's in there and paste this back in:


Code:
<div style="margin:20px; margin-top:5px; <if condition="$show['iewidthfix']">width: 100%;</if>">
<table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">

<if condition="$show[quoteid]=$show[quoteid] + 1 + $vbulletin->userinfo[lastactivity]"></if>

  <tr>
    <td class="tcat">
      <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('quote_$show[quoteid]')"><img 

id="collapseimg_quote_$show[quoteid]" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
      <div class="smallfont" style="margin-bottom:2px">
        <a href="#top" onclick="return toggle_collapse('quote_$show[quoteid]')">$vbphrase[quote]
        <if condition="$show['username']">($username)</if>: <em>(click to expand/collapse)</em></a>
      </div>
    </td>
  </tr>

<tbody id="collapseobj_quote_$show[quoteid]" style="{$collapseobj_forumid}">
  <tr>
    <td class="alt2" style="border:1px inset">
      <if condition="$show['username']">
        <div><phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase></div>
        <div style="font-style:italic">$message</div>
      <else />
        $message
      </if>
    </td>
  </tr>
</tbody>


</table>
</div>

<script type="text/javascript"> <!--
toggle_collapse('quote_$show[quoteid]');
--> </script>

Hit "SAVE" and you're done


*** If you are one of the lucky folks that have the "Template Manager" installed: ***
You can simply take the template .XML also supplied as download and import it via the template manager -> even faster and more easy done
(you might have to check "overwrite templates" when importing)


What else?
============

By default this collapsable quotes start up collapsed!
So if a user wants to read the quoted text he has to uncollapse it.

If you want it the other way round, users can collapse quotes they do not want to waste space for the moment:
Remove (or leave out at install) the last three lines of the template:

Code:
<script type="text/javascript"> <!--
toggle_collapse('quote_$show[quoteid]');
--> </script>
If that part is removed/left out all quotes start up uncollapsed and visible.


That's it.

Have fun

Show Your Support

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

Comments
  #32  
Old 02-03-2006, 08:23 AM
Hellcat Hellcat is offline
 
Join Date: May 2003
Location: Germany
Posts: 560
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gizmo999
Is that the post caching in admin Cp>server settings/optimisation ??
Yes, it's the "Cached Posts Lifespan" setting.
On my live board I have that set to "0", my board isn't that huge that I need the cache to pull load off the server....


Quote:
Originally Posted by Gizmo999
sorry, I'm new to all this
Hey,no problem!
The only stupid question is the one not asked
We all started at square one and had to ask our way through
Reply With Quote
  #33  
Old 02-03-2006, 09:06 AM
Gizmo999 Gizmo999 is offline
 
Join Date: Dec 2005
Location: In my own virtual world
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Hellcat
Yes, it's the "Cached Posts Lifespan" setting.
On my live board I have that set to "0", my board isn't that huge that I need the cache to pull load off the server....
Thanks for the help, I tried editing a post with a specific users quote and all my subsequent posts using that users quotes work fine. Switching off cache made no difference to existing quoted posts/threads. We'll see how it goes on new posts/quoted posts.

Quote:
Originally Posted by Hellcat

Hey,no problem!
The only stupid question is the one not asked
We all started at square one and had to ask our way through
I do try and ask and learn but its hard, I do marketing and have a little computer knowledge but maybe that is more dangerous than having none
Reply With Quote
  #34  
Old 02-03-2006, 04:50 PM
Gizmo999 Gizmo999 is offline
 
Join Date: Dec 2005
Location: In my own virtual world
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One quick question, the phrase Quote(user):click to expand /contract isn't showing up as the font colour is the same as the background (red), from the code it looks like the font style is smallfont yet my smallfont in my style is white. How do i change that colour please??
Reply With Quote
  #35  
Old 02-03-2006, 04:56 PM
TosaInu's Avatar
TosaInu TosaInu is offline
 
Join Date: Jul 2004
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We have a spoiler code and I modified that one to make collapsable quotes. Nesting and Cache proof.

Same template bbcode_quote, replace the whole content:
Code:
<div style="margin:5px 20px 20px 20px">

<div class="smallfont" style="margin-bottom:2px">

<input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }">

<if condition="$show['username']">
	<phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase>: click show to read.
     <else />
         Quote: click show to read.
     </if> 

</div>

<div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;">

<div style="display: none;">

	<class="alt2" style="border:1px inset">
		<if condition="$show['username']">				           <div style="font-style:italic">$message</div>
		<else />
		    $message
		</if>

</div>

</div>

</div>
Thanks to Hellcat.
Reply With Quote
  #36  
Old 02-03-2006, 05:22 PM
IrPr IrPr is offline
 
Join Date: Mar 2005
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Updated Today?
Reply With Quote
  #37  
Old 02-28-2006, 11:04 AM
djwins djwins is offline
 
Join Date: Jan 2005
Posts: 167
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would be great if it would check to see how many lines where in the quote before collapsing it.

Maybe 4 lines or less and the quote isn't collapsed.
Reply With Quote
  #38  
Old 03-02-2006, 12:39 AM
LEAD_WEIGHT LEAD_WEIGHT is offline
 
Join Date: Feb 2005
Location: Canada
Posts: 369
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would it be possible to create a collapse field, but still be still be open with scrollbar. I do not know if select all can be made without file editing. see image below and follow link to site that has this a functional one. I notice it requires files edits to make for that brand of message board.



Demo
http://forums.phpmix.org/viewtopic.php?p=1164#1164
http://forums.phpmix.org/viewtopic.php?p=1165#1165
Reply With Quote
  #39  
Old 03-02-2006, 02:25 AM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In order to remove the redundant attribution...

From this:
Quote (Max): (click to expand/collapse)
Originally Posted by Max
This is a test...

to this:
Quote (Max):
This is a test...

Here's the code I modified.

Code:
<div style="margin:20px; margin-top:5px; <if condition="$show['iewidthfix']">width: 100%;</if>">
<table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">

<if condition="$show[quoteid]=$show[quoteid] + 1 + $vbulletin->userinfo[lastactivity]"></if>

  <tr>
    <td class="tcat">
      <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('quote_$show[quoteid]')"><img 

id="collapseimg_quote_$show[quoteid]" src="$stylevar[imgdir_button]/collapse_tcat{$collapseimg_forumid}.gif" alt="" border="0" /></a>
      <div class="smallfont" style="margin-bottom:2px">
        <a href="#top" onclick="return toggle_collapse('quote_$show[quoteid]')">$vbphrase[quote]
        <if condition="$show['username']">($username)</if></a>
      </div>
    </td>
  </tr>

<tbody id="collapseobj_quote_$show[quoteid]" style="{$collapseobj_forumid}">
  <tr>
    <td class="alt2" style="border:1px inset">
      <if condition="$show['username']">
        <div style="font-style:italic">$message</div>
      <else />
        $message
      </if>
    </td>
  </tr>
</tbody>


</table>
</div>
Yes, I removed the "click to expand/collapse" text; I found it too wordy and unnecessary.

Thanks for a great hack!
Reply With Quote
  #40  
Old 03-02-2006, 04:14 AM
Tralala's Avatar
Tralala Tralala is offline
 
Join Date: Jan 2006
Posts: 1,207
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I make the "banner" a bit thinner? Users are complaining that it's distracting.


Actually, some users really don't like this change, and don't see why you'd want to collapse a quote in the first place at all.

And of course, others love it.


Like your Quoted IMG->URL hack, can this be made a user preference, Hellcat?

Allow each user to choose, in UserCP -> Edit Options:

Quoting:
Old style vs. new style
If new style, Default to collapsed vs. Default to expanded
Reply With Quote
  #41  
Old 03-12-2006, 08:11 AM
ElForro ElForro is offline
 
Join Date: Mar 2006
Posts: 123
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi.... One simple question.... I would love to use this but as a NEW BBCode.... I mean: [ spoiler ]something[ /spoiler ]

But i need something to replace the "quote_$show[quoteid]" in order to work as a separate BBCode...

Here's what i've got.. It works when only is a single "quote", but it doesn't when there ara more than one...

Code:
<div style="margin:20px; margin-top:5px;">

<table class="tborder" border="0" width="100%">

  <tr>

    <td class="thead">

      <div class="smallfont" style="margin-bottom:2px">

        <a href="#top" onclick="return toggle_collapse('quote_$show[quoteid]')"><b>Spoiler</b> | Hace click para ver / ocultar</a>

      </div>

    </td>

  </tr>

<tbody id="collapseobj_quote_$show[quoteid]" style="{$collapseobj_forumid}">

  <tr>

    <td class="alt2">

      {param}

    </td>

  </tr>

</tbody>

</table>

</div>

<script type="text/javascript"> <!--

toggle_collapse('quote_$show[quoteid]');

--> </script>
Thanks!! And sorry about my english!
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:34 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.07212 seconds
  • Memory Usage 2,324KB
  • 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
  • (5)bbcode_code
  • (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
  • (3)pagenav_pagelink
  • (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