Home > Panele > Ostatnie komentarze

Ostatnie komentarze

Dodane przez: piciu
opis:
Ostatnie komentarze
Kod:
  1. opentable("Ostatnie Komentarze");
  2. $limit = 5;
  3. $result = dbquery("SELECT * FROM ".$db_prefix."comments LEFT JOIN ".$db_prefix."users ON comment_name = user_id ORDER BY comment_datestamp DESC LIMIT 0,$limit");
  4. if (dbrows($result)) {
  5. while ($data = dbarray($result)) {
  6. if ($data['comment_type'] == "U") {
  7. $place = BASEDIR."profile.php?lookup=".$data['comment_item_id'];
  8. } elseif ($data['comment_type'] == "N") {
  9. $place = BASEDIR."news.php?readmore=".$data['comment_item_id'];
  10. } elseif ($data['comment_type'] == "A") {
  11. $place = BASEDIR."readarticle.php?article_id=".$data['comment_item_id'];
  12. } elseif ($data['comment_type'] == "D") {
  13. $place = BASEDIR."downloads.php?d_id=".$data['comment_item_id'];
  14. } elseif ($data['comment_type'] == "P") {
  15. $place = BASEDIR."photogallery.php?photo_id=".$data['comment_item_id'];
  16. }
  17. echo "<table style='border:1px solid #000;' width='100%'>
  18. <tr>
  19. <td><img src='".THEME."images/bullet.gif'> <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a> ".(iADMIN && eregi("C",$userdata['user_rights']) ? " <b>IP:</b> ".$data['comment_ip'] : "")."</td>
  20. </tr>
  21. <tr>
  22. <td>".($data['comment_smileys'] == "1" ? parseubb(parsesmileys(nl2br($data['comment_message']))) : parseubb(nl2br($data['comment_message'])))."</td>
  23. </tr>
  24. <tr>
  25. <td>".(iADMIN && eregi("C",$userdata['user_rights']) ? "<a href='".ADMIN."comments.php$aidlink&step=delete&comment_id=".$data['comment_id']."&ctype=".$data['comment_type']."&cid=".$data['comment_item_id']."'>Trinti</a> - <a href='".ADMIN."comments.php$aidlink&step=edit&comment_id=".$data['comment_id']."&ctype=".$data['comment_type']."&cid=".$data['comment_item_id']."'>Taisyti</a> - " : "")."<a href='$place'>Skaityti</a></td>
  26. </tr>
  27. </table><br>\n";
  28. }
  29. } else {
  30. echo "<center>Komentarzy brak</center>\n";
  31. }
  32. closetable();

©