Quote:
Originally Posted by cellarius
Indeed, you can manipulate the already rendered template doing this. Also possible is str_replace:
PHP Code:
$search = "Terms of Service"; $replace = "Terms of Cooking Noodles"; $footer = str_replace($search,$replace,$footer);
Although this is a somewhat bad example, since "Terms of Service" is a phrase, of course, and will vary by language. Always make sure you use strings for replacement that are always present.
Attachment 106372
Using str_replace, you can also add stuff in the middle of the template like so:
PHP Code:
$search = "Terms of Service"; $replace = " and Terms of Cooking Noodles"; $footer = str_replace($search,$search.$replace,$footer);
Also can this be used on variables? ex: {vb:raw variable}
Attachment 106374
|
OK I'm trying to do the same thing but on showthread, from this example is $footer a var already being used of is this an additional variable made up int he plugin? Right now I'm using $vbulletin->templatecache['postbit'] with the <hookname>process_templates_complete, should this something diffrent?
<hookname>showthread_query</hookname>
$vbulletin->templatecache['postbit'] = str_replace($find, $replace, $vbulletin->templatecache['postbit']);
Also can this be used on variables? ex: {vb:raw variable}