1 Replies - 1288 Views - Last Post: 09 September 2009 - 01:58 AM

#1 King8654   User is offline

  • D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 120
  • Joined: 04-March 08

Opening/Closing of php brackets in .tpl file making page go blank

Posted 08 September 2009 - 12:18 PM

Hey everyone,

In the process of building a new control panel for my auction site, and coming across some issues. The filename is myauction.php, and it requires the top.tpl, myauction_inc.php(most of php query's), myauction.tpl, and obviously the footer.

Im having problems in myauction.tpl, trying to have the menu when clicked bring in this case the feedback info in the main page box instead of the old menu bringin you to a separate page(feedback.php)

I took the php from feedback.php, added it to the main myauction_inc.php, and then moved on to transferring of feedback.tpl's contents. Unfortunately i must not be closing the proper amount of brackets, for when i add this code to the myauction.tpl, the middle of the screen just shows the background, and when i remove it, all fixed.

If anyone could locate the issue in this it would be much appreciated, as im still trying to wrap my head around it. A short explanation would be fantastic :)

Everything else ive gotten to work, but this is just not working out. Thanks again everyone!!

<?
if($mode=="feedback")
{
?>

<div id="myauctiontable">
<table width="958" cellpadding="0" cellspacing="0" border=0 align="center">
<tr width=100>
<td colspan=2 background="images/productsbgfeedbackmember.png" height="32">
<font class="detail3txt"><div align="right" style="padding-right:14px;">

<?= $user[user_name];  ?>   (  <?= $feed_pos_tot[feedbacktotal]; ?> 

<?php 
if(!empty($feedback_img))
{
?>

<img src="images/<?= $feedback_img ?>"  align="top">

<?php
}
?> 

</div></font></td></tr>


<table cellpadding="5" cellspacing="2"  width=100%> 
	<tr height=40 >   
	  <td>
	 
<table border=0 width="70%" align="center">
	<tr>
	  <td class="detail9txt">
  
<b>Total Feedback Received:</b>
  </td>

<td align="left" class="detail8txt"><?= $feed_tot[feedbacktotal]; ?>
</td>
  </tr>

  <tr>
	<td class="detail9txt">
  <b> FeedBack Score:</b>
  </td>

<td align="left" class="detail8txt"><?= $feed_pos_tot[feedbacktotal]; ?></td>
  </tr>
  
<tr><td class="detail9txt"><b>Positive Feedback %:</b></td><td align="left" class="detail8txt">
<?= round($positive_percentage); ?>%</td></tr>
  
<tr><td class="detail9txt">No. of positive feedback received:</td><td align="left" class="detail8txt">
<?if(!empty($positive_tot[positive_total])){?><?= $positive_tot[positive_total]; ?><?}else { echo "-";}?>
</td>
</tr>x
</table>
</td>

<td>
  <table align="center">x<tr height="30px"><td bgcolor="#d8ecff" class="detail9txt" align="center"><b>Recent Ratings</b></td></tr>
  <tr>x
	<td>x
  
<table cellpadding="5" cellspacing="0">x
  <tr class="tr_botborder">
	<td> </td>
	  <td class="detail9txt">Past Month  <font size="4">|</font>  </td>
	  <td class="detail9txt">Past 6 Months  <font size="4">|</font>  </td>
	  <td class="detail9txt">  Past 12 Months  </td></tr>

  <tr class="tr_botborder">
   <td>
	<img src="images/iconPos_16x16.gif"></td>
	<td class="detail9txt"><?if(!empty($pos_lastmon_record[pos_mon])){?><?= $pos_lastmon_record[pos_mon]; ?><?}else echo "-";?></td>
	<td class="detail9txt"><?if(!empty($pos_last6_record[pos_6mon])){?><?= $pos_last6_record[pos_6mon];?><?}else echo "-";?></td>
	<td class="detail9txt"><?if(!empty($pos_last12mon_record[pos_last12mon])){?><?= $pos_last12mon_record[pos_last12mon]; ?><?}else echo "-";?></td></tr>

  <tr class="tr_botborder">
   <td><img src="images/iconNeu_16x16.gif"></td>
   <td class="detail9txt"><?if(!empty($neu_lastmon_record[neu_mon])){?><?= $neu_lastmon_record[neu_mon]; ?><?}else echo "-";?></td>
   <td class="detail9txt"><?if(!empty($neu_last6_record[neu_6mon])){?><?= $neu_last6_record[neu_6mon];?><?}else echo "-";?></td>
   <td class="detail9txt"><?if(!empty($neu_last12mon_record[neu_last12mon])){?><?= $neu_last12mon_record[neu_last12mon]; ?><?}else echo "-";?>
</td></tr>

  <tr class="tr_botborder">
   <td><img src="images/iconNeg_16x16.gif"></td>
   <td class="detail9txt"><?if(!empty($neg_lastmon_record[neg_mon])){?><?= $neg_lastmon_record[neg_mon]; ?><?}else echo "-";?></td>
   <td class="detail9txt"><?if(!empty($neg_last6_record[neg_6mon])){?><?= $neg_last6_record[neg_6mon];?><?}else echo "-";?></td class="detail9txt">
   <td class="detail9txt"><?if(!empty($neg_last12mon_record[neg_last12mon])){?><?= $neg_last12mon_record[neg_last12mon]; ?><?}else echo "-";?>
</td></tr>
  
</table>
   </td>
	 </tr>
	   </table>
	  </td>
 <br>
  
<tr>
 <td colspan="2" style="border-top:2px solid #e4dfa8; border-bottom:2px solid #e4dfa8;" background="images/productsbgfeedbackrec.png" width="958" height="32"><font class="detail3txt">
</td>
</tr> 

<? if($msg)
  {
?>
<tr>
  <td height="20"> </td>
</tr>

<tr colspan="2"><td align="center">
<font color="red" class="errormsg"><b>

<? 
{
  echo $msg;
}
?>
  
<tr><td height="20"> </td></tr>

</b></font></td></tr>
</table>
</td></tr></table>

<?
}
?>

</div>
  <tr><td colspan="2">
  <table cellpadding="5" cellspacing="0" width="100%"> 
  <tr class="detail6txt"><td></td><td width=36%><b>Comment</b></td>
  <td><b>From</b></td><td><b>Date</b></td><td><b>Item#</b></td></tr>
<?
  $com_sql="select * from feedback where  feedback_to=$user_id order by f_id desc";
  $com_recordset=mysql_query($com_sql);
  $color=1;
  while($com_record=mysql_fetch_array($com_recordset))
  {
  //if()
   $user="select * from user_registration where user_id=$com_record[buyer_id] || user_id=$com_record[seller_id]";
  //else 
  // $user="select * from user_registration where user_id=$com_record[seller_id]";
  $user_recordset=mysql_query($user);
  $user_record=mysql_fetch_array($user_recordset);
  if($color==1)
  {
  $color=2;
?>
  <tr bgcolor="#E6E6E6" class="detail9txt">
<?
}
else
{ 
$color=1;
?>
  <tr bgcolor="#FFFFFF" class="detail9txt">
<?
}
?>
<?
  if($com_record[feedback_type]=='Positive')
   $imgtype="iconPos_16x16.gif";
	else if($com_record[feedback_type]=='Negative')
	$imgtype="iconNeg_16x16.gif";
	else
	$imgtype="iconNeu_16x16.gif";
	$item_sql="select * from placing_item_bid where item_id=".$com_record['item_id'];
	$item_sqlqry=mysql_query($item_sql);
	$item_rows=mysql_num_rows($item_sqlqry);
?>
  
  <td width=6% class="feedback">  <img src="images/<?= $imgtype ?>"> </td>
  <td width=34%> <?= nl2br($com_record['feedback']);?></td>
  <td width=24%><?= $user_record['user_name'];?></td>
  <td width=13%><?= $com_record['date'];?></td>
<?
  if($item_rows!=0)
  {
?>
  <td width=23%><a href="detail.html?item_id=<?= $com_record['item_id'];?>" class="header_text2">
  <?= $com_record['item_id'];?></a></td>
<?
  }
?>
<?
  if($item_rows==0)
  {
?>
  <td width=23%>
  <?= $com_record['item_id'];?></td>

  </tr>

  </table></td></tr></table>
<?
}
?>

</div>
<?
}
?>

....and begins another if statement

 

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Opening/Closing of php brackets in .tpl file making page go blank

#2 neit   User is offline

  • D.I.C Head

Reputation: 15
  • View blog
  • Posts: 187
  • Joined: 13-February 09

Re: Opening/Closing of php brackets in .tpl file making page go blank

Posted 09 September 2009 - 01:58 AM

Its sounds like you have an error in the code is error reporting turned on?


<?php = $user[user_name];  ?>   (  <?= $feed_pos_tot[feedbacktotal]; ?>


What is the braket in the middle for?




<? if($msg) { ?>
<tr>
  <td height="20"> </td>
</tr>

<tr colspan="2"><td align="center">
<font color="red" class="errormsg"><b>

<? {echo $msg; } ?>
 
<tr><td height="20"> </td></tr>

</b></font></td></tr>
</table>
</td></tr></table>

<? } ?>



There appears to be an extra bracket here.



<td class="detail9txt"><?if(!empty($pos_lastmon_record[pos_mon])){?><?= $pos_lastmon_record[pos_mon]; ?><?}else echo "-";?></td>


All these are not showing up as php code ensure that is a space between <?php /<?.





You will need to look through the code again.
Comment out stuff and see if it works as expected, then comment in a new bit at a time.
If it does not work you will then know what part needs fixed.
thread should be moved to the php forum.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1