The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
str_replace and custom template
What am I doing wrong? I would like to do a string replace on postbit/postbit_legacy template. Find specific code, insert my custom template after it. Here is what I have and its not working.
PHP Code:
I tried this in postbit_display_complete and it doesnt work either. PHP Code:
|
#2
|
|||
|
|||
I'm not sure, but I think maybe you need:
Code:
$parser = new vB_TemplateParser($templater->render()); (the ->render() added), since the vB_TemplateParser constructor takes a string. |
#3
|
||||
|
||||
in the current postbit_display_complete code I get this error
Catchable fatal error: Object of class vB_Template could not be converted to string I need to be able to get a custom template and convert it into a string/variable. --------------- Added [DATE]1333780042[/DATE] at [TIME]1333780042[/TIME] --------------- and for some reason $templater = vB_Template::create('my_custom_template'); doesnt work in parse_templates (the way I am using it) |
#4
|
|||
|
|||
Hmm...this thread has some code for doing a replace: www.vbulletin.org/forum/showthread.php?t=264690 Maybe it's fetch_template_raw() that you're looking for.
|
Благодарность от: | ||
LifesGreatestGift |
#5
|
||||
|
||||
AWESOME! That worked!
parse_templates PHP Code:
|
#6
|
|||
|
|||
Just as a side note here,
Notice how it's usually: $templater = vB_Template::create(); Then: print_output($templater->render()) The method create() returns an object. $repl_string, in your code, was an object- which explains your fatal error. |
Благодарность от: | ||
LifesGreatestGift |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|