Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 01-10-2008, 06:13 PM
micky007 micky007 is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PHP Code Removes NavBar? Help ASAP Please!

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 Code:
<?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.

Quote:
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?
Reply With Quote
  #2  
Old 01-10-2008, 07:21 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the place you want to put it in the template use this code.
Quote:
<if condition="$_GET['f'] == 34">
//text that is shown when the condition is meant
</if>
Reply With Quote
  #3  
Old 01-10-2008, 07:37 PM
micky007 micky007 is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Cheers !

but for some reason the background image on the table doesnt showup
Reply With Quote
  #4  
Old 01-10-2008, 08:47 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

instead of $_GET['f'] its nicer if you use <if condition="$forumid==34">
and what exactly have you written?
Reply With Quote
  #5  
Old 01-20-2008, 02:49 PM
micky007 micky007 is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for the reply, but no images will show. this is the source i have put in.

Code:
<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.
Reply With Quote
  #6  
Old 01-20-2008, 03:06 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

why are you using head&body in the code
and where exactly did you put this code in?
Reply With Quote
  #7  
Old 01-20-2008, 03:07 PM
micky007 micky007 is offline
 
Join Date: Jun 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i dont really know, im weird.

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

--------------- Added [DATE]1200850168[/DATE] at [TIME]1200850168[/TIME] ---------------

ok never mind sorted it by adding it to the CSS background
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04979 seconds
  • Memory Usage 2,220KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete