Guest User

Untitled

a guest
Jun 24th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.96 KB | None | 0 0
  1. $id = $_GET['id'];
  2.    
  3.     $query = "SELECT * FROM thread ORDER BY id ASC";
  4.     $result = mysql_query($query) or die(mysql_error());
  5.     $thrd = mysql_fetch_array($result);
  6.     //--------------
  7.     $query_for = "SELECT * FROM `forum` WHERE `id` = {$id}";
  8.     $result_for = mysql_query($query_for) or dir(mysql_error());
  9.     $for = mysql_fetch_array($result_for);
  10.  
  11.     if((mysql_num_rows($result) == 0) || ($for['id'] != $thrd['id'])) {
  12.         echo 'There are no Threads in this section.! <a href="#">Create One?</a>';
  13.     } else {
  14.         $output_head = '
  15.                 <table class="tborder">
  16.                     <thead class="tborder">
  17.                         <tr>
  18.                             <td class="theadm" align="center" colspan="5"><p>' . $for['for_name'] . '</p></td>             
  19.                         </tr>
  20.                     </thead>
  21.                     <thead class="tborder">
  22.                         <tr>
  23.                             <td colspan="5"></td>          
  24.                         </tr>
  25.                     </thead>
  26.                     <tbody class="tborder">
  27.                         <tr>
  28.                             <td class="thead">&nbsp;</td>
  29.                             <td class="thead" align="left">Thread/Thread Starter</td>
  30.                             <td class="thead">Last post</td>
  31.                             <td class="thead">Replies</td>
  32.                             <td class="thead">Views</td>
  33.                         </tr>
  34.                     </tbody>
  35.             ';
  36.         echo $output_head;
  37.         while ($thrd = mysql_fetch_array($result)) {
  38.             if($id == $thrd['for_id']) {
  39.                 $output = '
  40.                     <tbody class="tborder">
  41.                         <tr>
  42.                             <td class="logo"><img src="images/status.png" rel="status" /></td>
  43.                             <td width="100%" align="left">
  44.                                 <a href="viewthread.php?id=' . $thrd['id'] . '">' . $thrd['thread_name'] . '</a>&nbsp;-<span style="font-size:11px">Admin</span>
  45.                                 <br />
  46.                                 <div>
  47.                                     <span style="font-size:13px;text-decoration:underline">' . $thrd['thread_description'] . '</span>
  48.                                 </div>
  49.                             </td>
  50.                             <td class="alt1">' . $thrd['last_post'] . '</td>
  51.                             <td class="alt1">' . $thrd['num_reply'] . '</td>
  52.                             <td class="alt1">' . $thrd['num_view'] . '</td>
  53.                         </tr>
  54.                     </tbody>
  55.                 ';
  56.                 echo $output;
  57.             }
  58.         } //end while loop
  59.     } //end of else1 statement
  60. ?> 
  61.         </table>
Add Comment
Please, Sign In to add comment