The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Unexpected T_VARIABLE in str_replace
Hey guys,
Ran into an issue earlier, I have debugged this as far as I can and I can't get why I'm having issues. Mind taking a look at it? I'm trying to replace the postbit template with <if condition="$post['noattachdisplay']"> and apparently I'm not doing something right. Thanks in advance. Parse error: syntax error, unexpected T_VARIABLE in /home/www/f/includes/class_postbit.php(304) : eval()'d code on line 108 PHP Code:
|
#2
|
||||
|
||||
Do the condition in the plugin then just spit out the output. Don't put the condition into the template like you are trying to do.
|
#3
|
|||
|
|||
Quote:
i.e. $find = '$var[\'key\']'; $replace = '$var[\'key\'] . $var2'; str_replace... |
#4
|
||||
|
||||
If you are worried about apostophes in something, then try something like this before the str_replace:
PHP Code:
But, if you are doing something like what you are saying in your post, then no need for a str_replace, just do something like: PHP Code:
|
#5
|
|||
|
|||
Quote:
PHP Code:
|
#6
|
||||
|
||||
You can't have all those conditions and phrases in there and line breaks. Try taking a look at what the template cache looks like in the database. *That* is what you are trying to look at and it doesn't look like what you have above. Why don't you just remove that code from the postbit(_legacy)? What is wrong with that?
|
#7
|
|||
|
|||
Quote:
Last question though... now I really don't understand. I'm replacing a small template with an extra line of HTML and it's giving me another error? Parse error: syntax error, unexpected T_STRING in /home/www/f/includes/functions_editor.php(583) : eval()'d code on line 1 PHP Code:
I'm trying to replace the last </div> with one more option, then end the div, and it's not seeming to work... I'm using the hook newreply_form_start. Do I need a different location? Nevermind. Easy fix for this is escape all the double quotes. \" Oops. =p |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|