The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Multiple options in custom bbcode
I have a story archive associated with my site and I am trying to set up some bbcode that can easily link to those stories and to chapters within those stories.
story urls are http://stories.mysite.net/viewstory.php?sid=Story ID and chapter urls are http://stories.mysite.net/viewstory.php?sid=Story ID&chapter=Chapter number I know I can get the first to work simply with: Code:
[story={option}]{param}[/story] <a href="http://stories.mysite.net/viewstory.php?sid={option}">{param}</a> Code:
[chapter={option1},{option2}]{param}[/chapter] <a href="http://stories.mysite.net/viewstory.php?sid={option1}&chapter={option2}">{param}</a> (I'm on 3.5.4 if that's any help) |
#2
|
|||
|
|||
It is possible but...
From class_bbcode.php: Code:
/** * Allows extension of the class functionality at run time by calling an * external function. To use this, your tag must have a callback of * 'handle_external' and define an additional 'external_callback' entry. * Your function will receive 3 parameters: * A reference to this BB code parser * The value for the tag * The option for the tag * Ensure that you accept at least the first parameter by reference! * * @param string Value for the tag * @param string Option for the tag (if it has one) * * @return string HTML representation of the tag */ function handle_external($value, $option = null).... Something like that Code:
<a href="http://stories.mysite.net/viewstory.php?sid=explode_option({option})[0]&chapter=explode_option({option})[1]">{param}</a> Optionally, the bbcode parser does parse javascript so you could make do with a javascript function that returned the proper URL kk, found a mod that taught me how to call "handle external" procedures for bbcodes. vB Code [table] Using the xml file it is pretty straight forward. All you need is to import the plugin and create a bbcode for [chapter] with a blank replacement string |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|