The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Template Problem
Hello, I'm attempting to port a mod (someone else's) to VB4 and I'm having a problem with one of the templates.
The mod has a main templates and calls the other templates using variables. I modified the main template and the php file so that the variables are now registered and the sub templates are called using the {vb:raw } syntax. The problem is in one of the sub templates I need to pass variables to it as well but as soon as I try to specify a {vb: } type variable (even stylevars) it won't let me save the template. I get the following error: Code:
Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3332 Any any ideas where the problem might be? Thanks. EDIT: I checked and as far as I'm aware of there are no if statements in the template. |
#2
|
||||
|
||||
What is the code you are adding that seems to be causing the problem?
|
#3
|
|||
|
|||
Quote:
I found a work around though. There was some javascript in the template so I pulled all of it out and put it into a new template then called IT from the main template and now I can save the original template without error. EDIT: The problem is definitely in the javascript somewhere. The javascript is needing variables from the PHP file but when I try to reference the variable using {vb:raw variablename} i get the same error when I save the template. I poked through the javascript and everything LOOKS ok but I'm no expert. Is there anything I should keep an eye out for? |
#4
|
||||
|
||||
I had a similar error pop up not so long ago. Check that the "<vb:if condition>" tags are all written correctly, since that's what caused the same error when I was porting templates and had missed one.
In vB3 it's: <if condition="...."><else /></if> In vB4 it's: <vb:if condition="...."><vb:else /></vb:if> |
#5
|
|||
|
|||
Quote:
I'm not using HTML <if> statements though. The template in question consists entirely of javascript (with the addition of the <script></script> tags). How would that apply? |
#6
|
||||
|
||||
You might wanna post the template here then (or the offending part) otherwise we can't help much.
|
#7
|
|||
|
|||
Ok this is enough to generate the issue
Code:
<script type="text/javascript"> //<![CDATA[ window.onload=Load_Map function get_icon(type) { var color; if ((typeof(type)=="undefined") || (type==null)) { color = "red" } else { color = type } var icon = new GIcon(); icon.image = "$bburl/images/googlemapme/mm_20_"+ color +".png"; icon.shadow = "$bburl/images/googlemapme/mm_20_shadow.png"; icon.iconSize = new GSize(12, 20); icon.shadowSize = new GSize(22, 20); icon.iconAnchor = new GLatLng(20, 2); icon.infoWindowAnchor = new GLatLng(1, 5); return icon; } //]] </script> |
#8
|
||||
|
||||
put <vb:literal> and </vb:literal> around your javascript.
|
#9
|
|||
|
|||
Lynne, That seems to have fixed it. Thanks a bunch.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|