Advertisement
StevenG89

Untitled

May 27th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.66 KB | None | 0 0
  1. <?php
  2. echo "
  3. <table width='90%' cellspacing='1' class='table'>
  4.     <tr style='background:grey'>
  5.         <th colspan='3'>Users Comments <a href='comments.php?ID={$r['userid']}'>[Add Comment]</a></th>";
  6.         if($ir['user_level'] == 2 || $ir['user_level == 3) {
  7.             echo "<th width='10%'>Delete</th>";
  8.         }
  9.         if($ir['userid'] == $r['userid']) {
  10.             echo "<th width='10%'>Block</th>";
  11.         }
  12.         echo "</tr>";
  13.         $query = $db->query("SELECT `cmtTIME`,`cmtTO`,`cmtFROM`,`cmtTEXT` FROM `comments`
  14.         WHERE `cmtTO` = {$r['userid']} ORDER BY `cmtTIME` DESC LIMIT 5");
  15.         while($q=$db->fetch_row($query)) {
  16.             $they = $db->query("SELECT `username`,`userid` FROM `users` WHERE `userid` = {$q['cmtFROM']}");
  17.             $them = $db->fetch_row($they);
  18.             $sent = date('F j, Y, g:i:s a',$q['cmtTIME']);  
  19.             if($them['display_pic']) {
  20.                 echo "
  21.                 <td width='50'>
  22.                     <img src='{$them['display_pic']}' width='50'
  23.                     height='50' alt='User Display Pic' title='User Display Pic' />
  24.                 </td>";
  25.             }
  26.             else {
  27.                 echo "
  28.                 <td width='50'>
  29.                     <img src='images/default.jpg' width='50' height='50'
  30.                     alt='User Display Pic' title='User Display Pic' />
  31.                 </td>";
  32.             }
  33.         }
  34.         echo "
  35.         <td><a href='viewuser.php?u={$them['userid']}'>{$them['username']} [{$them['userid']}]</a></br></br>$sent</td>
  36.         <td>{$q['cmtTEXT']}</td>";
  37.         if($ir['user_level'] == 2 || $ir['user_level'] == 3) {
  38.             echo "
  39.             <td width='10%'><a href='comments.php?action=delete&ID={$q['cmtID']}'>Delete</a></td>";
  40.         }
  41.         if($ir['userid'] == $r['userid']) {
  42.             echo "
  43.             <td width='10%'><a href='comments_block.php?action=add&ID={$them['userid']}'>Block</a></td>";
  44.         }
  45.         echo "</tr>";
  46. }
  47. echo "</table><hr width='90%'>";
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement