Register Members List Search Today's Posts Mark Forums Read

Article Options
BBCode manager Suggestion: (Nested Spoiler Example)
Join Date: Sep 2009
Posts: 17

by techtir techtir is offline 29 Sep 2009

I was recently adding a spoiler BB code from the site here.

(Sadly I forget which thread I found it).

It didn't work as expected. I was using it to "fold Sections"

Examination suggested that using {option} or {param} in a javascript called function is simply not going to work sensibly if there are multiple instances in the same page. The BB Code will expand and put the javascript function multiple times. Any {option} or {param} in the last instance on the page will "fill in" the values when you click anywhere.

Also I realised that if a BB code has a Javascript function, it will be inserted N times on the page for N instances of the object.

So for now I put the function in headinclude

The BB code manager only has the instance code that calls it with {option} as a parameter to the javascript function.

My suggestions:
  1. NEVER use {option} or {param} in a function.
  2. A later version of BB manager should have an "include once in header" tag for a function.

For those interested here is the code.
(Make sure the <img src= paths match your install from root of web site, both in the javascript function and in the BB code definition that calls it.)
It allows nested folded sections/spoilers

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

In the BB code Manager

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

[ANS=Some suitable Title]Lots of body, inc BBcode for images, tables & video[/ANS]

Last edited by techtir; 24 Oct 2009 at 11:54.. Reason: Emphasis on nested, new URL
Views: 2943
Reply With Quote

Similar Article
Article Author Type Replies Last Post
Kill 1 Query In BBCode Manager (ACP) Zero Tolerance vBulletin 3.0 Full Releases 22 04 Aug 2005 18:07

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Article Options

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

New To Site? Need Help?

All times are GMT. The time now is 05:55.

Layout Options | Width: Wide Color: