The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Problem with str_replace function when removal apart of the template
Hello ,
i need to removal apart of the template SHOWTHREAD , i use str_replace function , every thing is okay and function working good , but my problem with "Escaping special characters and conditional execution of code" this the code i want removal it from a template PHP Code:
PHP Code:
|
#2
|
||||
|
||||
Why not just make a plugin in showthread_complete or something with:
PHP Code:
|
#3
|
|||
|
|||
If you still want to do the str_replace, I think you'd also need to escape the dollar sign ($) with a backslash. Or it might be easier to make it a single-quoted string and just escape the single quote characters.
|
#4
|
|||
|
|||
This is a nicer way:
PHP Code:
Also much easier to read. |
#5
|
|||
|
|||
Quote:
But that won't work the same. You want to avoid having the variables evaluated because you're trying to match the string that's in the template cache. |
#6
|
|||
|
|||
Oh in that case I misunderstood OP.
|
#7
|
||||
|
||||
Quote:
Quote:
{escape the dollar sign ($) + escape double quote } : not working PHP Code:
escape only single quote i try it already : not working PHP Code:
But this working single-quoted string and escape the double quote characters like that : PHP Code:
replace <td> Is this enough ? it removed the popup of Thread Rating as well , and i think a problem in Escaping conditional , and this line PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|