MyBB Tutorials

How to add "Too many quotes" - Spoiled Quotes

Submitted by Aoki, , Thread ID: 38

Thread Closed
15-01-2015, 07:06 AM
#1
Today I'm going to explain, how to put quoted replies in a spoiler.
It'll look like this:

Quote:
Quote:Reply #1


Quote:Reply #2


All you have to do is to put the code below in your headerinclude template. (AdminCP > Templates & Style > Templates > Your Themes Templates > Ungrouped Templates > headerinclude

Code:
<script type="text/javascript">

var quoteMsg = "View More";
var quotePop = "Too Many Quotes";

jQuery(function() {
   jQuery('blockquote:not(blockquote > blockquote)').each(function(a, b) {
       jQuery(this).children('blockquote').each(function() {
         jQuery(this).html("<div><div class=\"spoilerheader\">" + quoteMsg + " <a href=\"javascript:void(0);\" class=\"spoilerclick\">(" + quotePop + ")</a></div><div class=\"spoilerbody\" style=\"display: none;\">" + jQuery(this).html() + "</div></div>");
       });
    
   });
jQuery(".spoilerclick").click(function() {

   var spoiler = jQuery(this).parent().parent();
   jQuery(spoiler).children(".spoilerbody").show();
   jQuery(spoiler).children(".spoilerheader").hide();
})
});

</script>

All credits go to Cake for writing this little nice script.
Also credits to Unsuspicious for fixing it.

Users browsing this thread: 2 Guest(s)