PHP DReamwever - repeating 2 tables.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
neil
Forum Newbie
Posts: 3
Joined: Sat Jan 29, 2005 2:15 am

PHP DReamwever - repeating 2 tables.

Post by neil »

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.

Code: Select all

<?php do { ?>
<table width=&quote;830&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote;>
  <!--DWLayoutTable-->
  <? // date first
	$bits = explode(&quote;|&quote;,strftime(&quote;%d|%b|%y|%I:%M%p&quote;,$row_replysї'post_date']));
	if($bitsї0]{0} == &quote;0&quote;) $bitsї0] = substr($bitsї0],1);
	if($bitsї3]{0} == &quote;0&quote;) $bitsї3] = substr($bitsї3],1);
	$bitsї3] = strtolower($bitsї3]);
	$suffs = array(&quote;th&quote;,&quote;st&quote;,&quote;nd&quote;,&quote;rd&quote;);
	$left = $bitsї0] % 10;
	if($left < 4 && $bitsї0] != 11 && $bitsї0] != 12 && $bitsї0] != 13) {
		$su = $suffsї$left];
	} else {
		$su = &quote;th&quote;;
	}
	$row_replysї'post_date'] = $bitsї0].&quote;$su &quote;.$bitsї1].&quote; &quote;.$bitsї2].&quote; &quote;.$bitsї3];
?>
  <tr> 
    <td width=&quote;116&quote; valign=&quote;top&quote;> <p align=&quote;center&quote;> <a href=&quote;../home/?u=<?php echo $row_replysї'username']; ?>&quote;> 
        <?php if ($row_replysї'user_avatar'] ){  ?>
        <img src=&quote;../images/avatars/gallery/<?php echo $row_replysї'user_avatar']; ?>&quote; alt=&quote;&quote; name=&quote;icon&quote; width=&quote;50&quote; height=&quote;50&quote; border=&quote;0&quote;> 
        <?php } ?>
        </a><a href=&quote;../home/?u=<?php echo $row_replysї'username']; ?>&quote;> 
        <?php if (!$row_replysї'user_avatar'] ){  ?>
        <img src=&quote;../images/avatars/default.gif&quote; alt=&quote;&quote; name=&quote;icon&quote; width=&quote;50&quote; height=&quote;50&quote; border=&quote;0&quote;> 
        <?php }  ?>
        </a></p>
      <p align=&quote;center&quote;><a href=&quote;../home/?u=<?php echo $row_replysї'username']; ?>&quote;><?php echo $row_replysї'username']; ?></a> </p></td>
    <td width=&quote;29&quote; valign=&quote;top&quote; background=&quote;icons/reply/bubble_b.gif&quote;><img src=&quote;icons/reply/bubble_a.gif&quote; width=&quote;29&quote; height=&quote;17&quote;></td>
    <td width=&quote;683&quote; valign=&quote;top&quote; bgcolor=&quote;#FFCC00&quote; style=&quote;border-top:2px solid #010099;border-bottom:2px solid #010099;border-right:2px solid #010099&quote;> 
      <table width=&quote;158&quote; border=&quote;0&quote; align=&quote;right&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote;>
        <!--DWLayoutTable-->
        <tr bordercolor=&quote;#FFCC00&quote;> 
          <td width=&quote;168&quote; valign=&quote;top&quote; bgcolor=&quote;#FFCC00&quote; style=&quote;border-left:1px black solid;border-bottom:1px black solid&quote;> 
            <div align=&quote;right&quote;><font color=&quote;#000000&quote; size=&quote;2&quote;><?php echo $row_replysї'post_date']; ?></font></div></td>
        </tr>
        <tr bordercolor=&quote;#FFCC00&quote;> 
          <td valign=&quote;top&quote; bgcolor=&quote;#FFCC00&quote;> 
            <? if($can_mod) { ?>
            <div align=&quote;right&quote;><a href=&quote;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>&quote;><img src=&quote;../templates/subSilver/images/lang_english/icon_edit.gif&quote; border=&quote;0&quote;></a> 
              <a href=&quote;javascript:deletePost(<?php echo $row_replysї'post_id']; ?>)&quote;><img src=&quote;../templates/subSilver/images/icon_delete.gif&quote; border=&quote;0&quote;></a> 
              <? } ?>
              <? if($userdataї'user_type'] < 5 && $row_replysї'post_authorid'] === $userdataї'user_id']) { ?>
              <a href=&quote;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>&quote;> 
              <img src=&quote;../templates/subSilver/images/lang_english/icon_edit.gif&quote; border=&quote;0&quote;></a> 
              <? } ?>
            </div></td>
        </tr>
      </table>
      <?php print parseText($row_replysї'post_text']) ?> </td>
  </tr>
</table>
<table width=&quote;826&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote;>
  <!--DWLayoutTable-->
  <tr> 
    <td width=&quote;683&quote; valign=&quote;top&quote; bgcolor=&quote;#CCFF00&quote; style=&quote;border-top:2px solid #010099;border-bottom:2px solid #010099;border-left:2px solid #010099&quote;> 
      <table width=&quote;158&quote; border=&quote;0&quote; align=&quote;right&quote; cellpadding=&quote;0&quote; cellspacing=&quote;0&quote;>
        <!--DWLayoutTable-->
        <tr bordercolor=&quote;#FFCC00&quote;> 
          <td width=&quote;168&quote; valign=&quote;top&quote; bgcolor=&quote;#CCFF00&quote; style=&quote;border-left:1px black solid;border-bottom:1px black solid&quote;> 
            <div align=&quote;right&quote;><font color=&quote;#000000&quote; size=&quote;2&quote;><?php echo $row_replysї'post_date']; ?></font></div></td>
        </tr>
        <tr bordercolor=&quote;#FFCC00&quote;> 
          <td valign=&quote;top&quote; bordercolor=&quote;#FFCC00&quote; bgcolor=&quote;#CCFF00&quote;> 
            <? if($can_mod) { ?>
            <div align=&quote;right&quote;><a href=&quote;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>&quote;><img src=&quote;../templates/subSilver/images/lang_english/icon_edit.gif&quote; border=&quote;0&quote;></a> 
              <a href=&quote;javascript:deletePost(<?php echo $row_replysї'post_id']; ?>)&quote;><img src=&quote;../templates/subSilver/images/icon_delete.gif&quote; border=&quote;0&quote;></a> 
              <? } ?>
              <? if($userdataї'user_type'] < 5 && $row_replysї'post_authorid'] === $userdataї'user_id']) { ?>
              <a href=&quote;edit.php?post=<?php echo $row_replysї'post_id']; ?>&topic=<?php echo $row_topicї'topic_id']; ?>&quote;> 
              <img src=&quote;../templates/subSilver/images/lang_english/icon_edit.gif&quote; border=&quote;0&quote;></a> 
              <? } ?>
            </div></td>
        </tr>
      </table>
      <?php print parseText($row_replysї'post_text']) ?> </td>
    <td width=&quote;29&quote; valign=&quote;top&quote; background=&quote;icons/reply/bubble_3_b.gif&quote;><img src=&quote;icons/reply/bubble_3_a.gif&quote; width=&quote;29&quote; height=&quote;17&quote;></td>
    <td width=&quote;112&quote; valign=&quote;top&quote;> <p align=&quote;center&quote;><a href=&quote;../home/?u=<?php echo $row_replysї'username']; ?>&quote;> 
        <?php if ($row_replysї'user_avatar'] ){  ?>
        <img src=&quote;../images/avatars/gallery/<?php echo $row_replysї'user_avatar']; ?>&quote; alt=&quote;&quote; name=&quote;icon&quote; width=&quote;50&quote; height=&quote;50&quote; border=&quote;0&quote;> 
        <?php } ?>
        </a><a href=&quote;../home/?u=<?php echo $row_replysї'username']; ?>&quote;> 
        <?php if (!$row_replysї'user_avatar'] ){  ?>
        <img src=&quote;../images/avatars/default.gif&quote; alt=&quote;&quote; name=&quote;icon&quote; width=&quote;50&quote; height=&quote;50&quote; border=&quote;0&quote;> 
        <?php }  ?>
        </a></p>
      <p align=&quote;center&quote;><a href=&quote;../home/?u=<?php echo $row_replysї'username']; ?>&quote;><?php echo $row_replysї'username']; ?></a></p></td>
  </tr>
</table>

<?php } while ($row_replys = mysql_fetch_assoc($replys)); ?>
can some one please help?
anthony88guy
Forum Contributor
Posts: 246
Joined: Thu Jan 20, 2005 8:22 pm

Post by anthony88guy »

Just curious why don’t you get PhpBB. And configure that to your likings. Its open source so just use it as a base.
neil
Forum Newbie
Posts: 3
Joined: Sat Jan 29, 2005 2:15 am

Post by neil »

The Whole Site Is Based On PhpBB just that i wonted to change it. so i built my own forum area
User avatar
pleigh
Forum Contributor
Posts: 445
Joined: Wed Jan 19, 2005 4:26 am

Post by pleigh »

anthony88guy wrote:Just curious why don’t you get PhpBB. And configure that to your likings. Its open source so just use it as a base.
maybe he wanted to enhance more of his skills...phpbb is yes, opensource, but we cannot deny the fact that someone out there are looking forward to making their own version of a forum board, like in my case, i managed to finish my own forum board without looking the source code of phpbb, but with the help of some experts here in this forum..
Post Reply