The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do I get a plugin to work that contains quotes in the replace string?
For example, say I have this:
Code:
$stuff="<a href="showthread.php">test</a>"; $lookfor='$thread[highlight]'; $replace='$stuff'; $vbulletin->templatecache['threadbit'] = str_replace($lookfor, $replace, $vbulletin->templatecache['threadbit']); |
#2
|
|||
|
|||
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
you rock, I'll go try that now.
--------------- Added [DATE]1213117994[/DATE] at [TIME]1213117994[/TIME] --------------- This is my actual code, it still doesn't load. Code:
$threadprefixstuff="<a href=\"showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]\" id=\"thread_title_$thread[realthreadid]\"<if condition=\"$show[gotonewpost]\"> style=\"font-weight:bold\"</if>>$thread[threadtitle]</a> $thread[movedprefix] $thread[typeprefix] $thread[moderatedprefix] $thread[prefix_rich]"; $threadprefixlookfor=" $thread[movedprefix] $thread[typeprefix] $thread[moderatedprefix] $thread[prefix_rich] <a href=\"showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]\" id=\"thread_title_$thread[realthreadid]\"<if condition=\"$show[gotonewpost]\"> style=\"font-weight:bold\"</if>>$thread[threadtitle]</a>"; $threadprefixreplace="$threadprefixstuff"; $vbulletin->templatecache[threadbit] = str_replace($threadprefixlookfor, $threadprefixreplace, $vbulletin->templatecache[threadbit]); |
#4
|
|||
|
|||
You need to use single quotes (instead of double quotes), to encapsulate your search and replace strings e.t.c. As single quotes do not parse variables.
|
#5
|
||||
|
||||
You can use single quotes - you just need to concatenate.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|