The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
preg_replace if condition in template
im trying to replace everything inside of an if condition in the quick reply template
my parse_template code is: Code:
$vbulletin->templatecache['showthread_quickreply'] = preg_replace("/<if condition=\"$show\['qr_require_click'\]\">(.*)<\/if>/",fetch_template('drc_ac'),$vbulletin->templatecache['showthread_quickreply']); Code:
$vbulletin->templatecache['showthread_quickreply'] = fetch_template('drc_ac'); |
#2
|
|||
|
|||
The problem is that what's in $vbulletin->templatecache[] is the compiled template, which is php code that prints out the html when it's eval()'d. That means you won't match the template <if tags because they aren't there. If you can match something that doesn't include the 'if' that might make it easier. Otherwise it's probably a good idea to look in the template table in the database where title='showthread_quickreply' (you want to look at the 'template' column), or just print out what's in the templatecache.
|
#3
|
||||
|
||||
thanks kev, im grabbing the <fieldset(.+?)<\/fieldset> now and its working great =) just got to be sure to include the if conditions in my template now which is no problem
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|