PDA

View Full Version : PHP Code Removes NavBar? Help ASAP Please!


micky007
01-10-2008, 06:13 PM
Hey Guys,

Im trying to add a php code that will show up under the navigation bar and the php code is the following:


<?php

if ( isset($_GET['f']) )
{
if ( $_GET['f'] == 34 )
{
echo '<center>test</center>';
}
}

?>


Now for some reason it remove the navigation bar and when i add that code under all of the code thats in the template navbar i get this warning from VB.

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /srv/www/vhosts/forums.****.co.uk/httpdocs/includes/adminfunctions_template.php(3596) : eval()'d code on line 215

Can anyone help me please?

MoT3rror
01-10-2008, 07:21 PM
In the place you want to put it in the template use this code.
<if condition="$_GET['f'] == 34">
//text that is shown when the condition is meant
</if>

micky007
01-10-2008, 07:37 PM
Cheers !

but for some reason the background image on the table doesnt showup :(

ragtek
01-10-2008, 08:47 PM
instead of $_GET['f'] its nicer if you use <if condition="$forumid==34">
and what exactly have you written?

micky007
01-20-2008, 02:49 PM
thanks for the reply, but no images will show. this is the source i have put in.



<if condition="$forumid==44">
<head>
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>

<body>
<div align="center">

<table width="569" height="104" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="http://img237.imageshack.us/img237/5152/lottohk5.gif" valign="top"><table width="100%" height="98" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="47" colspan="3">&nbsp;</td>
<td colspan="4" valign="bottom"><div align="center"><span class="style1">Next Draw: Saturday 26th January </span></div></td>
</tr>
<tr>
<td width="20%"><div align="center"><strong>&nbsp;
</strong><span class="style1">Last Weeks<br />
Results:</span></div></td>
<td width="13%"> &nbsp;&nbsp;&nbsp;&nbsp;<strong>10</strong></td>
<td width="11%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>24</strong></td>
<td width="16%"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;28</strong></td>
<td width="13%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>37</strong></td>
<td width="13%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;39</strong></td>
<td width="14%">&nbsp;&nbsp;&nbsp;&nbsp;<strong>&nbsp;&nbsp;&nbsp;40</strong></td>
</tr>
</table></td>
</tr>
</table>

</div>
</body>
</if>


also its not Imageshack as iv also tried using my own host.

ragtek
01-20-2008, 03:06 PM
why are you using head&body in the code
and where exactly did you put this code in?

micky007
01-20-2008, 03:07 PM
i dont really know, im weird.

I put it at the very bottom of Navbar Template so it shows under the nav bar.

--------------- Added 1200850168 at 1200850168 ---------------

ok never mind sorted it by adding it to the CSS background