![]() |
Javascript and phpinclude Template?
Hi all Im working on a small customhack for my site and so far have the follwing code so that a user hits an optimize link with the url "?styleid=$userstyle"
Anyways ive been at this all day sadly with no ftp access and am now trying to get my variable $mystyle back out in the navbar template so I can apply it works with the above stated style link Ive added this to my php_include_start template Code:
<script language="Javascript"> |
Questions about modifying vBulletin's default behaviour and asking about modifications in general, should be posted in General vBulletin Questions. Please read the forum descriptions more carefully in future. I've moved your thread there for you :)
Thanks, - Dean |
Do you need <?'s in there if it's already set for php?
|
yes you do, else the variable $userstyle would be replaced in the code being included to whatever vbulletin set it prior to, else it sets empty()
|
For a start, we'd need to see the complete phpinclude tempalte as this may or may not be in contect of other scripting ...
Also, you should ALWAYS use Code:
<script type="text/javascript" ... > This alone may be causing your error (but I doubt it)... |
Quote:
|
It works, but it's not valid.
In this instance, some browsers will (if rendering in Standards Compatible mode) not render invalid scripts... |
if it's called phpinclude shouldn't be just php? i'll look into it later.
|
phpinclude_start just gets eval'd and the resulting output is sent to the page being built when the output is assembled.
Colicab, you have a javascript function there that is attempting to output php to be eval'd. That can not work. The javascript is not going to even see the opening and closing PHP tags. As far as the javascript is concerned, the if/else contains no code to be executed. You talk about a variable named '$mystyle' and a URL param named 'styleid'. Could you explain further what you are trying to do in your template/PHP-side? |
The phpinclude template is for PHP generaly
you cannot use <?php ?> because your already having your php parsed and it will just ignore them. |
All times are GMT. The time now is 07:55 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|