The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Custom BBCode for this?
What would be the best way to implement this suggestion?
[removed] The parameter needs underscores between each letter, as shown in the example. Thanks. |
#2
|
|||
|
|||
You could try this: create a new plugin using hook location bbcode_create and this code:
Code:
if (!function_exists('handle_bbcode_alg')) { function handle_bbcode_alg(&$parser, $code, $option='') { $param = str_replace(array(' ', '"', "'"), array('_', '', ''), $code); return '<a href="http://alg.garron.us/?alg='.$param.'">'.$code.'</a>'; } } $this->tag_list['no_option']['alg'] = array( 'callback' => 'handle_external', 'strip_empty' => true, 'stop_parse' => true, 'disable_smilies' => true, 'disable_wordwrap' => true, 'strip_space_after' => 1, 'external_callback' => 'handle_bbcode_alg' ); if you want to add a button in the editor for that code, you can go to the bbcode manager and create a bbcode with code alg. Set "Use {option}" to No and enter your button image, but you can put in whatever you want for the html replacement and the other settings, since they won't be used. |
#3
|
|||
|
|||
Another way might be to installl this mod: https://vborg.vbsupport.ru/showthread.php?t=264896 (a very cool mod which I'm surprised has gotten more attention), then just use the bbcode manager to create a new bbcode, and put the php in the html replacement box, like:
PHP Code:
BTW, I haven't test this, so if you decide to try this way and it doesn't work, let us know. |
#4
|
|||
|
|||
Quote:
Quote:
Thanks guys. Further help would be much appreciated. |
#5
|
|||
|
|||
Yeah, I got thinking about removing quotes and forgot that a single quote was part of the "code". So anyway, try this:
Code:
if (!function_exists('handle_bbcode_alg')) { function handle_bbcode_alg(&$parser, $code, $option='') { $param = str_replace(array(' ', "'"), array('_', '-'), $code); return '<a href="http://alg.garron.us/?alg='.$param.'">'.$code.'</a>'; } } $this->tag_list['no_option']['alg'] = array( 'callback' => 'handle_external', 'strip_empty' => true, 'stop_parse' => true, 'disable_smilies' => true, 'disable_wordwrap' => true, 'strip_space_after' => 1, 'external_callback' => 'handle_bbcode_alg' ); |
#6
|
|||
|
|||
That worked, many thanks.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|