The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Replace Word in Post - only HTML!
Hello!
I want to replace e.g. every xxx to yyy - but only in the HTML-Output. This means: If someone posts "We show you xxx." then the browser will show "We show you yyy.", but if he presses "Edit post" the Editor (WYSIWYG and Text) will still give him "We show you xxx." I tried different things, e.g. a Plug-In for bbcode_parse_complete: PHP Code:
How can I do this correct? => I don't need a plugin! This is a study for a more complex problem: Replace </br>-breaks with <p>-paragraphs which needs much more programming, since every [ code]...[ /code] needs his <p>...</p> etc. Of course, if there exists allready a br-to-p-solution I'm even happier . Thanks for any help! Bruno |
#2
|
||||
|
||||
I use a str_replace statement on my site that only effects the html output. I use the postbit_display_complete hook location to do it.
|
#3
|
|||
|
|||
This sounds good! Which var do I have to change? $text has no effect... (or how can I find out this myself. Is there any documentation about that?)
Thanks! Bruno |
#4
|
||||
|
||||
The best way to find out what variables are used in a plugin is to find the plugin in the code and look at how variables are used around it. In this case, you need to use $this->post['message'] to modify the message text.
|
#5
|
||||
|
||||
Also, make sure you use the _complete hook, and not the _start hook. The post is not parsed yet at the latter.
|
#6
|
|||
|
|||
Thanks for your help! This works fine .
Does this mean, that there exists almost no documentation about hooks, variables etc. and search & ask in this forum is the best way of research? I'm searching now for the correct hook and variable to do the same when pressing "preview". Thanks for any help! Bruno |
#7
|
||||
|
||||
There are many articles available here on vBulletin.org which cover some "common" tasks.
|
#8
|
|||
|
|||
Yes, I have seen them and more on vBulletin-german.org. But some Kind of Reference would habe been nice .
Do you know which hook is executed after parsing the "Preview"? Bruno (I'm trying the ones in editpost.php right now...) |
#9
|
||||
|
||||
Are you talking about the page you see after clicking "Preview Post" in newreply.php?
|
#10
|
|||
|
|||
Yes... There are multiple hooks there and since I'm also not sure which variable needs the search & replace, trial and error is difficult...
Bruno |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|