forum-topic-list.tpl.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /**
  3. * @file
  4. * Displays a list of forum topics.
  5. *
  6. * Available variables:
  7. * - $header: The table header. This is pre-generated with click-sorting
  8. * information. If you need to change this, see
  9. * template_preprocess_forum_topic_list().
  10. * - $pager: The pager to display beneath the table.
  11. * - $topics: An array of topics to be displayed. Each $topic in $topics
  12. * contains:
  13. * - $topic->icon: The icon to display.
  14. * - $topic->moved: A flag to indicate whether the topic has been moved to
  15. * another forum.
  16. * - $topic->title: The title of the topic. Safe to output.
  17. * - $topic->message: If the topic has been moved, this contains an
  18. * explanation and a link.
  19. * - $topic->zebra: 'even' or 'odd' string used for row class.
  20. * - $topic->comment_count: The number of replies on this topic.
  21. * - $topic->new_replies: A flag to indicate whether there are unread
  22. * comments.
  23. * - $topic->new_url: If there are unread replies, this is a link to them.
  24. * - $topic->new_text: Text containing the translated, properly pluralized
  25. * count.
  26. * - $topic->created: A string representing when the topic was posted. Safe
  27. * to output.
  28. * - $topic->last_reply: An outputtable string representing when the topic was
  29. * last replied to.
  30. * - $topic->timestamp: The raw timestamp this topic was posted.
  31. * - $topic_id: Numeric ID for the current forum topic.
  32. *
  33. * @see template_preprocess_forum_topic_list()
  34. * @see theme_forum_topic_list()
  35. *
  36. * @ingroup themeable
  37. */
  38. ?>
  39. <table id="forum-topic-<?php print $topic_id; ?>">
  40. <thead>
  41. <tr><?php print $header; ?></tr>
  42. </thead>
  43. <tbody>
  44. <?php foreach ($topics as $topic): ?>
  45. <tr class="<?php print $topic->zebra;?>">
  46. <td class="icon"><?php print $topic->icon; ?></td>
  47. <td class="title">
  48. <div>
  49. <?php print $topic->title; ?>
  50. </div>
  51. <div>
  52. <?php print $topic->created; ?>
  53. </div>
  54. </td>
  55. <?php if ($topic->moved): ?>
  56. <td colspan="3"><?php print $topic->message; ?></td>
  57. <?php else: ?>
  58. <td class="replies">
  59. <?php print $topic->comment_count; ?>
  60. <?php if ($topic->new_replies): ?>
  61. <br />
  62. <a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a>
  63. <?php endif; ?>
  64. </td>
  65. <td class="last-reply"><?php print $topic->last_reply; ?></td>
  66. <?php endif; ?>
  67. </tr>
  68. <?php endforeach; ?>
  69. </tbody>
  70. </table>
  71. <?php print $pager; ?>