PHP DReamwever - repeating 2 tables.
Posted: Mon Apr 25, 2005 1:57 pm
Hi iam making a forum system and ive got this page what shows all the posts,
and what i have is 2 tables which are repeated together using repeat region, there is 2 tables becuase how i need it to lay out. but the problem is that its laying out how i wont but its dubbleing each of the posts eg.
the first table shows the right stuff but the second table shows the same data as the first 1 when it should show the next post insted!.
and it shows all the posts thats right! but has dublle each 1!.
Here Is The Code: of that section.
can some one please help?
and what i have is 2 tables which are repeated together using repeat region, there is 2 tables becuase how i need it to lay out. but the problem is that its laying out how i wont but its dubbleing each of the posts eg.
the first table shows the right stuff but the second table shows the same data as the first 1 when it should show the next post insted!.
and it shows all the posts thats right! but has dublle each 1!.
Here Is The Code: of that section.
Code: Select all
<?php do { ?>
<table width="e;830"e; cellpadding="e;0"e; cellspacing="e;0"e;>
<!--DWLayoutTable-->
<? // date first
$bits = explode("e;|"e;,strftime("e;%d|%b|%y|%I:%M%p"e;,$row_replysї'post_date']));
if($bitsї0]{0} == "e;0"e;) $bitsї0] = substr($bitsї0],1);
if($bitsї3]{0} == "e;0"e;) $bitsї3] = substr($bitsї3],1);
$bitsї3] = strtolower($bitsї3]);
$suffs = array("e;th"e;,"e;st"e;,"e;nd"e;,"e;rd"e;);
$left = $bitsї0] % 10;
if($left < 4 && $bitsї0] != 11 && $bitsї0] != 12 && $bitsї0] != 13) {
$su = $suffsї$left];
} else {
$su = "e;th"e;;
}
$row_replysї'post_date'] = $bitsї0]."e;$su "e;.$bitsї1]."e; "e;.$bitsї2]."e; "e;.$bitsї3];
?>
<tr>
<td width="e;116"e; valign="e;top"e;> <p align="e;center"e;> <a href="e;../home/?u=<?php echo $row_replysї'username']; ?>"e;>
<?php if ($row_replysї'user_avatar'] ){ ?>
<img src="e;../images/avatars/gallery/<?php echo $row_replysї'user_avatar']; ?>"e; alt="e;"e; name="e;icon"e; width="e;50"e; height="e;50"e; border="e;0"e;>
<?php } ?>
</a><a href="e;../home/?u=<?php echo $row_replysї'username']; ?>"e;>
<?php if (!$row_replysї'user_avatar'] ){ ?>
<img src="e;../images/avatars/default.gif"e; alt="e;"e; name="e;icon"e; width="e;50"e; height="e;50"e; border="e;0"e;>
<?php } ?>
</a></p>
<p align="e;center"e;><a href="e;../home/?u=<?php echo $row_replysї'username']; ?>"e;><?php echo $row_replysї'username']; ?></a> </p></td>
<td width="e;29"e; valign="e;top"e; background="e;icons/reply/bubble_b.gif"e;><img src="e;icons/reply/bubble_a.gif"e; width="e;29"e; height="e;17"e;></td>
<td width="e;683"e; valign="e;top"e; bgcolor="e;#FFCC00"e; style="e;border-top:2px solid #010099;border-bottom:2px solid #010099;border-right:2px solid #010099"e;>
<table width="e;158"e; border="e;0"e; align="e;right"e; cellpadding="e;0"e; cellspacing="e;0"e;>
<!--DWLayoutTable-->
<tr bordercolor="e;#FFCC00"e;>
<td width="e;168"e; valign="e;top"e; bgcolor="e;#FFCC00"e; style="e;border-left:1px black solid;border-bottom:1px black solid"e;>
<div align="e;right"e;><font color="e;#000000"e; size="e;2"e;><?php echo $row_replysї'post_date']; ?></font></div></td>
</tr>
<tr bordercolor="e;#FFCC00"e;>
<td valign="e;top"e; bgcolor="e;#FFCC00"e;>
<? if($can_mod) { ?>
<div align="e;right"e;><a href="e;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>"e;><img src="e;../templates/subSilver/images/lang_english/icon_edit.gif"e; border="e;0"e;></a>
<a href="e;javascript:deletePost(<?php echo $row_replysї'post_id']; ?>)"e;><img src="e;../templates/subSilver/images/icon_delete.gif"e; border="e;0"e;></a>
<? } ?>
<? if($userdataї'user_type'] < 5 && $row_replysї'post_authorid'] === $userdataї'user_id']) { ?>
<a href="e;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>"e;>
<img src="e;../templates/subSilver/images/lang_english/icon_edit.gif"e; border="e;0"e;></a>
<? } ?>
</div></td>
</tr>
</table>
<?php print parseText($row_replysї'post_text']) ?> </td>
</tr>
</table>
<table width="e;826"e; cellpadding="e;0"e; cellspacing="e;0"e;>
<!--DWLayoutTable-->
<tr>
<td width="e;683"e; valign="e;top"e; bgcolor="e;#CCFF00"e; style="e;border-top:2px solid #010099;border-bottom:2px solid #010099;border-left:2px solid #010099"e;>
<table width="e;158"e; border="e;0"e; align="e;right"e; cellpadding="e;0"e; cellspacing="e;0"e;>
<!--DWLayoutTable-->
<tr bordercolor="e;#FFCC00"e;>
<td width="e;168"e; valign="e;top"e; bgcolor="e;#CCFF00"e; style="e;border-left:1px black solid;border-bottom:1px black solid"e;>
<div align="e;right"e;><font color="e;#000000"e; size="e;2"e;><?php echo $row_replysї'post_date']; ?></font></div></td>
</tr>
<tr bordercolor="e;#FFCC00"e;>
<td valign="e;top"e; bordercolor="e;#FFCC00"e; bgcolor="e;#CCFF00"e;>
<? if($can_mod) { ?>
<div align="e;right"e;><a href="e;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>"e;><img src="e;../templates/subSilver/images/lang_english/icon_edit.gif"e; border="e;0"e;></a>
<a href="e;javascript:deletePost(<?php echo $row_replysї'post_id']; ?>)"e;><img src="e;../templates/subSilver/images/icon_delete.gif"e; border="e;0"e;></a>
<? } ?>
<? if($userdataї'user_type'] < 5 && $row_replysї'post_authorid'] === $userdataї'user_id']) { ?>
<a href="e;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>"e;>
<img src="e;../templates/subSilver/images/lang_english/icon_edit.gif"e; border="e;0"e;></a>
<? } ?>
</div></td>
</tr>
</table>
<?php print parseText($row_replysї'post_text']) ?> </td>
<td width="e;29"e; valign="e;top"e; background="e;icons/reply/bubble_3_b.gif"e;><img src="e;icons/reply/bubble_3_a.gif"e; width="e;29"e; height="e;17"e;></td>
<td width="e;112"e; valign="e;top"e;> <p align="e;center"e;><a href="e;../home/?u=<?php echo $row_replysї'username']; ?>"e;>
<?php if ($row_replysї'user_avatar'] ){ ?>
<img src="e;../images/avatars/gallery/<?php echo $row_replysї'user_avatar']; ?>"e; alt="e;"e; name="e;icon"e; width="e;50"e; height="e;50"e; border="e;0"e;>
<?php } ?>
</a><a href="e;../home/?u=<?php echo $row_replysї'username']; ?>"e;>
<?php if (!$row_replysї'user_avatar'] ){ ?>
<img src="e;../images/avatars/default.gif"e; alt="e;"e; name="e;icon"e; width="e;50"e; height="e;50"e; border="e;0"e;>
<?php } ?>
</a></p>
<p align="e;center"e;><a href="e;../home/?u=<?php echo $row_replysї'username']; ?>"e;><?php echo $row_replysї'username']; ?></a></p></td>
</tr>
</table>
<?php } while ($row_replys = mysql_fetch_assoc($replys)); ?>