The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello.
I have some problem. I want to create custom bbcode, that will link to something. Lets say user types [mybb]something[/mybb] and it is converted to <a href="http://example.com/?param=something">something</a> Everything works fine if i simply add custom bb code, but when {param} have ' or ", because it closes href in link and it does not work anymore as expected. Is there any way to fix this without modding? Or if it need mod, can anyone give me small example or link to some mod, that i could use as example to create my own? |
#2
|
|||
|
|||
![]()
What are the values you entered when creating this bb-code?
|
#3
|
|||
|
|||
![]()
here's the exactly replacement i have for my bbcode
Code:
<a href="http://tibiaspy.com/index2.php?p=item&itemname={param}" onmouseover="ajax_showTooltip('ajax_item.php?itemname={param} ',this);return false" onmouseout="ajax_hideTooltip()">{param}</a> thise ajax_xxxx functions are JS scripts i've found somewhere. Can i in easy way replace ' and " to something else? it can be anyrhing, i'll parse it on my script as needed. |
#4
|
|||
|
|||
![]()
Try escaping them with a \.
|
#5
|
|||
|
|||
![]()
Sure, but i can't tell my users to escape parameters. Some people will not understand it or simply will not remember about it, and 95% will not read my instruction :P. I have to do this while converting bbcode to link, and i don't know how to do it.
|
#6
|
|||
|
|||
![]()
You should escape the replacement text, not ask your users to escape strings.
|
#7
|
|||
|
|||
![]()
i know that, and i'm asking from first post how to do it.
I'm not vB guru, i don't know how to make vB mods, and also i don't know Javascript, so I can't make script to do this. I know PHP, but i can't use PHP in BBCode replacement, or at least i don't know how to do this. |
#8
|
|||
|
|||
![]()
Try changing your replacement code to:
HTML Code:
<a href=\"http://tibiaspy.com/index2.php?p=item&itemname={param}\" onmouseover=\"ajax_showTooltip(\'ajax_item.php?itemname={param} \',this);return false\" onmouseout=\"ajax_hideTooltip()\">{param}</a> |
#9
|
|||
|
|||
![]()
I've copied Your code, but now forum does not convert it at all, like it didn't know that bbcode.
And when I use my bbcode, as [item]Ravager's Axe[/item] it is converted to HTML Code:
<a href="http://tibiaspy.com/index2.php?p=item&itemname=Ravager%27s%20Axe" onmouseover="ajax_showTooltip('ajax_item.php?itemname=Ravager's Axe ',this);return false" onmouseout="ajax_hideTooltip()">Ravager's Axe</a> |
#10
|
|||
|
|||
![]()
Please post a screen shot of this BB-Code setting page.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|