Hide content (spoiler)

APGvNext Sam
vNext Dev
  • Total Posts : 13229
  • Joined: 2001/05/23 00:00:00
  • Status: offline
2008/08/01 17:21:31 (permalink) PGDCode
5 (1)

Hide content (spoiler)

Here is a custom PGDCode you can put into the control panel that allows you to hide some content in a message for whatever purpose you want, for example, spoiler warning.

The PGDCode

\[(hidden)[\=\w]* title=([^\]\"\']+)\](.+?)\[\/\1\]

Replace With:
<div style="border-bottom: 1px #666 dotted; padding:12px 10px; background-color: #FAFAFA; margin: 0 0 10px;"><i class="icon-caret-down icon-large spoiler-hide"></i>
<a href="#" class="spoiler-hide" onclick="$(this).fadeOut('fast', function(){$(this).parent().find('.spoiler').slideDown('fast').end().find('.spoiler-hide').slideUp();}); return false;"> $2</a>
<div class="none spoiler">
<a href="#" class="none spoiler" onclick="$(this).parent().find('.spoiler-hide').show().end().find('.spoiler').slideUp(); return false;">close</a>

Purpose: Hide some content
Example: [hidden title=Click To Unhide]Content To hide[/hidden]
Begin Tag: [hidden title=Click me]
End Tag: [/hidden]
ECMAScript Compliant and Ignore Case checked.
The Replace With can be modified to fit your styling needs. Just remember to include the $2 (the link title to reveal the hidden content), and $3 (the content that is hidden) symbols.

The following is an example:

Click here to reveal the hidden content

ASPPlayground.NET Version 3 is a totally rewritten version that is based on the ASP.NET 2.0 framework and the ASP.NET AJAX framework. This version supports .NET framework 2.0, 3.0, and 3.5.
 This new version of software has several new features and enhancements over the 2.x version:
  • Integrated Spell Checker.
  • New Skin & Theme feature allows user to change the entire user interface.
  • AJAX enabled user action to improve user experience. Fewer full page reloads.
  • Reward point system & Mark as answer - user can assign certain points to a question to reward the best answer. Different user groups get different reward points.
  • Community moderation - users can now flag messages as inapproriate and automatically remove them without moderator intervention. Auto-ban offender for a period of time
  • Integrated Captcha to protect the system from spam attacks.
  • Forum Filter - users can now decide which forums to see on the user interface.
  • Daily & Weekly Digest for forum and topic subscription.
  • Totally improved Search Engine- producing more relevant and updated results
  • Pinned message priority levels - moderators can now pin a message and assign priority
  • Splitting / Joining threads
  • DHTML popup instead of regular popup window which does not trigger popup blockers.
  • Totally revamped Photo Gallery interface w/ AJAX to improve usability.
  • DHTML menu to make UI less cluttered.
  • Moderator Permissions - grant different permission for different moderators
  • Custom PGDCode allows admins to define PGDCode in the admin control panel without having to touch the code.
  • User Group Membership Expiration - Allows you to define length of group membership.
  • Additional Group Based settings and permissions.
  • Forum Management with Inheritance - making forum management a lot easier. Define setting and permission only once and sub forums automatically inherits parent's settings.
  • Seamless integration with the ASP.NET Default SQL Membership Provider.
  • Uses Forms Authentication - easier integration with external membership system (other than the Default SQL Membership Provider).
  • Custom Stats with auto update.
  • Database based error logger - detect intrusion and captures the offender's IP.
  • Asynchronous emailing - prevent CPU threads from blocking the web server request.
  • Software carefully designed to support the Medium Trust environment and the new IIS 7 Integrated Pipeline mode.
  • There are many other new features & enhancements which we will list on the site later.
ASPPlayground.NET Version 3 is the combination of comprehensive features, extreme performance, rock solid stability, and unsurpassed security.

post edited by APGvNext Sam - 2014/09/24 18:03:14
Lenny Nero
Starting Member
  • Total Posts : 40
  • Joined: 2013/12/10 07:31:50
  • Status: offline
Re: Hide content (spoiler) 2014/09/24 14:43:26 (permalink)
This is a very useful feature, but I was wondering if there's a way to add a hide button after a spoiler is revealed, so as to close it back up.
APGvNext Sam
vNext Dev
  • Total Posts : 13229
  • Joined: 2001/05/23 00:00:00
  • Status: offline
Re: Hide content (spoiler) 2014/09/24 18:04:09 (permalink)
Hi Lenny,
I made a bit of change in the code above to add a "close" link at the bottom of spoiler content. Take a look.
Lenny Nero
Starting Member
  • Total Posts : 40
  • Joined: 2013/12/10 07:31:50
  • Status: offline
Re: Hide content (spoiler) 2014/09/25 12:39:52 (permalink)
Hello Sam, great, that works perfectly, can hide back similar long texts or images after viewing, thank you very much! 
Jump to:
© 2020 APG vNext Commercial Version 5.5