forum-topic-list.tpl.php

  1. 7.x drupal-7.x/modules/forum/forum-topic-list.tpl.php
  2. 6.x drupal-6.x/modules/forum/forum-topic-list.tpl.php

forum-topic-list.tpl.php Theme implementation to display a list of forum topics.

Available variables:

  • $header: The table header. This is pre-generated with click-sorting information. If you need to change this, - $pager: The pager to display beneath the table.
  • $topics: An array of topics to be displayed.
  • $topic_id: Numeric id for the current forum topic.

Each $topic in $topics contains:

  • $topic->icon: The icon to display.
  • $topic->moved: A flag to indicate whether the topic has been moved to another forum.
  • $topic->title: The title of the topic. Safe to output.
  • $topic->message: If the topic has been moved, this contains an explanation and a link.
  • $topic->zebra: 'even' or 'odd' string used for row class.
  • $topic->num_comments: The number of replies on this topic.
  • $topic->new_replies: A flag to indicate whether there are unread comments.
  • $topic->new_url: If there are unread replies, this is a link to them.
  • $topic->new_text: Text containing the translated, properly pluralized count.
  • $topic->created: An outputtable string represented when the topic was posted.
  • $topic->last_reply: An outputtable string representing when the topic was last replied to.
  • $topic->timestamp: The raw timestamp this topic was posted.

See also

template_preprocess_forum_topic_list().

template_preprocess_forum_topic_list()

theme_forum_topic_list()

1 theme call to forum-topic-list.tpl.php
template_preprocess_forums in drupal-6.x/modules/forum/forum.module
Process variables for forums.tpl.php

File

drupal-6.x/modules/forum/forum-topic-list.tpl.php
View source
  1. <?php
  2. /**
  3. * @file forum-topic-list.tpl.php
  4. * Theme implementation to display 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 template_preprocess_forum_topic_list().
  9. * - $pager: The pager to display beneath the table.
  10. * - $topics: An array of topics to be displayed.
  11. * - $topic_id: Numeric id for the current forum topic.
  12. *
  13. * Each $topic in $topics contains:
  14. * - $topic->icon: The icon to display.
  15. * - $topic->moved: A flag to indicate whether the topic has been moved to
  16. * another forum.
  17. * - $topic->title: The title of the topic. Safe to output.
  18. * - $topic->message: If the topic has been moved, this contains an
  19. * explanation and a link.
  20. * - $topic->zebra: 'even' or 'odd' string used for row class.
  21. * - $topic->num_comments: The number of replies on this topic.
  22. * - $topic->new_replies: A flag to indicate whether there are unread 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 count.
  25. * - $topic->created: An outputtable string represented when the topic was posted.
  26. * - $topic->last_reply: An outputtable string representing when the topic was
  27. * last replied to.
  28. * - $topic->timestamp: The raw timestamp this topic was posted.
  29. *
  30. * @see template_preprocess_forum_topic_list()
  31. * @see theme_forum_topic_list()
  32. */
  33. ?>
  34. <table id="forum-topic-<?php print $topic_id; ?>">
  35. <thead>
  36. <tr><?php print $header; ?></tr>
  37. </thead>
  38. <tbody>
  39. <?php foreach ($topics as $topic): ?>
  40. <tr class="<?php print $topic->zebra;?>">
  41. <td class="icon"><?php print $topic->icon; ?></td>
  42. <td class="title"><?php print $topic->title; ?></td>
  43. <?php if ($topic->moved): ?>
  44. <td colspan="3"><?php print $topic->message; ?></td>
  45. <?php else: ?>
  46. <td class="replies">
  47. <?php print $topic->num_comments; ?>
  48. <?php if ($topic->new_replies): ?>
  49. <br />
  50. <a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a>
  51. <?php endif; ?>
  52. </td>
  53. <td class="created"><?php print $topic->created; ?></td>
  54. <td class="last-reply"><?php print $topic->last_reply; ?></td>
  55. <?php endif; ?>
  56. </tr>
  57. <?php endforeach; ?>
  58. </tbody>
  59. </table>
  60. <?php print $pager; ?>