Unsupported scripts and control panel web app for a hosting company
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

announcements.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?PHP
  2. require_once('lib/profiler.php');
  3. require_once('lib/database.php');
  4. require_once('lib/common.php');
  5. ?>
  6. <div class="block">
  7. <h2>Announcements and messages</h2>
  8. <table class="innerblock">
  9. <tr>
  10. <th>&nbsp;</th>
  11. <th>Title</th>
  12. <th>View</th>
  13. <th>Type</th>
  14. <th>Date</th>
  15. </tr>
  16. <?PHP
  17. $sql = 'SELECT message_id, message_type, message_title, message_time FROM messages WHERE message_time > ' . strtotime('-6 months');
  18. if (!defined('ADMIN')) { $sql .= ' AND message_type <> \'admin\''; }
  19. $sql .= ' ORDER BY message_time LIMIT 0,5';
  20. $res = mq($sql) or mf(__FILE__, __LINE__, $sql);
  21. $i = 0;
  22. $n = 0;
  23. if (mysql_num_rows($res) == 0) {
  24. echo '<tr><td colspan="5" style="font-style: italic; text-align: center;">';
  25. echo 'There are no current announcements</td></tr>';
  26. }
  27. while ($row = mysql_fetch_array($res)) {
  28. $n++;
  29. ?>
  30. <tr<?PHP if ($i == 1) { echo ' class="odd"'; } ?>>
  31. <td><?PHP echo $n; ?>.</td>
  32. <td><?PHP echo $row['message_title']; ?></td>
  33. <td><a href="<?PHP echo CP_PATH; ?>viewmessage/<?PHP echo $row['message_id']; ?>">View</a></td>
  34. <td><?PHP echo ucfirst($row['message_type']); ?></td>
  35. <td><?PHP echo substr(gmdate('r', $row['message_time']),0,-6); ?></td>
  36. </tr>
  37. <?PHP
  38. $i = 1 - $i;
  39. }
  40. ?>
  41. </table>
  42. </div>