Location: PHPKode > projects > Private Movie Database > pmdb_V_B_0.3.0/code/pmdb/forum/thread.inc
<?
/* filename: thread.inc
 * project: movie database
 * author: lex alexander
 * originally coded: 10.07.2003
 * last modified: 14.07.2003
 * version V0.2
 * usage: display postings
 */

if(REGISTER_GLOBALS == "off");
{
  $tid = $_GET["tid"];
  $fid = $_GET["fid"];
}

$get_forum_name="SELECT forum FROM tb_forum WHERE fid = '$fid'";
//print_r($get_forum_name);
$result_forum = doQuery($get_forum_name);
extract(mysql_fetch_array($result_forum));

$get_thread_title="SELECT ptitle from tb_post WHERE r_tid = '$tid' AND pnr = 1";
$result_thread_title = doQuery($get_thread_title);
extract(mysql_fetch_array($result_thread_title));
?>
<h1><?=PMDB_FORUM;?></h1>
<p><a href = "index.php?page=fhome">Forum</a> >
   <a href = "index.php?page=forum&amp;fid=<?=$fid;?>"> <?=$forum;?></a> >
   <a href = "index.php?page=thread&amp;fid=<?=$fid;?>&amp;tid=<?=$tid;?>"><?=$ptitle;?></a></p>
<?
$get_max_pnr="SELECT MAX(pnr) as pnr FROM tb_post WHERE r_tid = '$tid'";
$result_max_pnr = doQuery($get_max_pnr);
extract(mysql_fetch_array($result_max_pnr));
?>
<p><a href = "index.php?page=newpost&amp;fid=<?=$fid;?>&amp;tid=false"><?=POST_NEW;?></a> <a href = "index.php?page=newpost&amp;fid=<?=$fid;?>&amp;tid=<?=$tid;?>&amp;pnr=<?=$pnr;?>"><?=POST_REPLY;?></a></p>
<?
$get_post = "SELECT * FROM tb_post as p, tb_user as u WHERE p.r_tid = '$tid' and p.r_uid = u.uid order by pnr";
$result_post = mysql_query($get_post)
  or die(QUERY_FAIL);

$rows_post = mysql_num_rows($result_post);
?>
<table>
<tr>
  <td class = "movie-head"><?=POST_AUTHOR;?></td>
  <td class = "movie-head"><?=THREAD;?></td>
</tr>

<?
while($rows_post = mysql_fetch_array($result_post))
{
  if($data_count % 2 == 0)
  {
    $data = "movie-data1";
    $data_title = "movie-title1";
  }
  else
  {
    $data = "movie-data2";
    $data_title = "movie-title2";
  }
  $data_count++;
  ?>
  <tr>
    <td class = "<?=$data;?>">

       <?=$rows_post["uname"];?>

    </td>
    <td class = "<?=$data;?>">

    <h3><?=$rows_post["ptitle"];?></h3>
    <?=$rows_post["ptext"];?>

    </td>
    <td class = "<?=$data;?>"><?=$avg ;?></td>
  </tr>
  <tr>
    <td class = "<?=$data;?>"><?=$rows_post["time"];?></td>
    <td class = "<?=$data;?>">Userlinks,
    <?
    if($rows_post["uid"] == $_COOKIE["pmdb_uid"])
    {
      ?>
      <a href = "index.php?page=newpost&amp;fid=<?=$fid;?>&amp;tid=<?=$tid;?>&amp;pnr=<?=$pnr;?>&amp;pid=<?=$rows_post["pid"];?>&amp;edit=true"><?=EDIT;?></a>
      <?
    }
    ?>
    </td>
  </tr>

  <?
}
?>
<tr>
  <td></td>
  <td><a href = "index.php?page=newpost&amp;fid=<?=$fid;?>&amp;tid=false"><?=POST_NEW;?></a> <a href = "index.php?page=newpost&amp;fid=<?=$fid;?>&amp;tid=<?=$tid;?>&amp;pnr=<?=$pnr;?>"><?=POST_REPLY;?></a></td>
</tr>
</table>
Return current item: Private Movie Database