The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Calling PHP in BBCode
I wrote a script that will output a stock quote and I want to make it work with vB's BBcode system. The problem is I cannot make [stock]MSFT[/stock] replace to some PHP as it only allows HTML.
I can see other developers have gotten around this somehow as they are including javascript etc in their BBcode replacements. I plan to release this mod to the public. Can anyone offer some help? |
#2
|
||||
|
||||
Look in class_bbcode.php, more specifically, at the end of this file. You will see a hook that allows you to "create" a BB code handler and define your own callback.
|
#3
|
|||
|
|||
Sorry I do not see this hook. What is its name?
|
#4
|
||||
|
||||
I did not mean literally "at the end"... bbcode_fetch_tags
|
#5
|
|||
|
|||
Hmmm... I just wanted to insert a new bbcode calling some php functions but it won't parse.
I created a new plugin at bbcode_fetch_tags PHP Code:
[hwelt]Dieter[/hwelt] won't parse that way. So I also added a second plugin at bbcode_create: PHP Code:
Any idea what's wrong with it? cu Gargi |
#6
|
||||
|
||||
The BB code parser is expecting an "option" (e.g. [TAG=OPTION]), instead of $tag_list['option']['hwelt'], try $tag_list['no_option']['hwelt'].
|
#7
|
|||
|
|||
The same thing. Activating or not activating (no matter what) the bbcode_create it also will result into an error while clicking onto the submut reply button. A created tag befor activating the pluging and refreshing the post will make the whole string disappear in the posting. Also if I will only parse
echo $value; Still something wrong with it but I can't see what. cu Gargi Edit: Next try PHP Code:
[hwelt]Dieter[/hwelt] just Hallo Welt The Tag itself is parsing, but no php parsing I guess and the missing value. cu Gargi --------------- Added [DATE]1247654019[/DATE] at [TIME]1247654019[/TIME] --------------- One step further: PHP Code:
Hello world, my name is Dieter! So far so good. But how to integrate the php code? As I see the echo comand won't work but the return. So I think I have to place the php code elsewhere. But where? cu Gargi |
#8
|
||||
|
||||
Wait a sec - I don't think I understand the problem you are having. Could you explain a little clearer? You seem you have it outputting correctly...
|
#9
|
|||
|
|||
I want to parse some php code using a bbcode tag. Maybe another example with options:
Tag: count Parameter a Name, Option a number. e.g: [count="3"]Gargi[/count] While parsing the number should be added to another value. Output maybe: Hello this is Gargi, my number is 10 So I try it with a plugin bbcode_fetch_tags: PHP Code:
Hello this is Gargi, and nothing more. I also only added this plugin and nothing more. Is there anything else to do for it (another plugin) or where do I have to place the php code to be executed correctly? cu Gargi |
#10
|
||||
|
||||
Once a function has returned something, the function stops executing and the script continues from there. Thus, the two returns below the first do nothing as they will never be executed.
Use this: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|