The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Messing with $post[message] in functions_newpost.php-The quest continues! Form vars?
I want to add a snippet of code to each $post[message]. It's for a modification I'm working on. How can I add, say, a conditional clause to it? I tried editing the postbit template and it didn't work...
|
#2
|
||||
|
||||
As you mentioned, editing the postbit(_legacy) template should be sufficient. What exactly did you do?
|
#3
|
|||
|
|||
What I'm trying to do is, again, set up this automatic BBCode thing that I've been looking for.
I tried setting it up like this: Code:
<if condition="$post[field11] AND $post[field12]">$post[field11]</if> $post[message] <if condition="$post[field11] AND $post[field12]">$post[field12]</if> |
#4
|
||||
|
||||
You need to convert the BB Code into HTML (called "parsing"). This needs to be done inside a plugin. (There are articles describing how to parse BB code.)
|
#5
|
|||
|
|||
https://vborg.vbsupport.ru/showthrea...ghlight=bbcode
I'm not quite sure what I'm doing here. I started out on this code: Code:
<if condition="$post[field11] AND $post[field12]"> $text = $post[field11] $post[field12] $do_html = false $do_smilies = true $do_bbcode = true $do_imgcode = true $do_nl2br = true $cachable = false </if> $parsed_text $post[message] <if condition="$post[field11] AND $post[field12]">$post[field12]</if> --------------- Added [DATE]1235735146[/DATE] at [TIME]1235735146[/TIME] --------------- Is there any way to just modify what goes in to $post[message]? |
#6
|
||||
|
||||
You cannot do php in a template. You will have to write a plugin to do that.
|
#7
|
|||
|
|||
Can't I just fiddle with the $post[message] instead? Wouldn't that be simpler?
|
#8
|
||||
|
||||
If you are going to 'fiddle' with $post[message] before it is spit out in the template, you must do so using a plugin.
|
#9
|
|||
|
|||
Oooh... I see. And which plugin hook? I'm guessing Postdata_Start, but I really don't know where all these hooks go to.
|
#10
|
||||
|
||||
If you are in debug mode, there is a list of all the plugins called for the page on the bottom. I think I usually use postbit_display_start when I want to change something that is going into the postbit. But, you can certainly try different locations.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|