Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.php 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?
  2. $LastRead = Forums::get_last_read($Forums);
  3. View::show_header('Forums');
  4. ?>
  5. <div class="thin">
  6. <h2>Forums</h2>
  7. <div class="forum_list">
  8. <?
  9. $LastCategoryID = 0;
  10. $OpenTable = false;
  11. foreach ($Forums as $Forum) {
  12. list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
  13. if (!Forums::check_forumperm($ForumID)) {
  14. continue;
  15. }
  16. $ForumDescription = display_str($ForumDescription);
  17. if ($CategoryID != $LastCategoryID) {
  18. $LastCategoryID = $CategoryID;
  19. if ($OpenTable) { ?>
  20. </table>
  21. <? } ?>
  22. <h3><?=$ForumCats[$CategoryID]?></h3>
  23. <table class="forum_index alternate_rows">
  24. <tr class="colhead">
  25. <td style="width: 2%;"></td>
  26. <td style="max-width: 25%;">Forum</td>
  27. <td>Last Post</td>
  28. <td style="width: 7%;">Topics</td>
  29. <td style="width: 7%;">Posts</td>
  30. </tr>
  31. <?
  32. $OpenTable = true;
  33. }
  34. $Read = Forums::is_unread($Locked, $Sticky, $LastPostID, $LastRead, $LastTopicID, $LastTime) ? 'unread' : 'read';
  35. ?>
  36. <tr class="row">
  37. <td class="<?=$Read?> tooltip" title="<?=ucfirst($Read)?>"></td>
  38. <td>
  39. <h4 class="min_padding">
  40. <a class="tooltip" href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>" title="<?=display_str($ForumDescription)?>"><?=display_str($ForumName)?></a>
  41. </h4>
  42. </td>
  43. <? if ($NumPosts == 0) { ?>
  44. <td>
  45. There are no topics here.<?=(($MinCreate <= $LoggedUser['Class']) ? ' <a href="forums.php?action=new&amp;forumid='.$ForumID.'">Create one!</a>' : '')?>
  46. </td>
  47. <td class="number_column">0</td>
  48. <td class="number_column">0</td>
  49. <? } else { ?>
  50. <td>
  51. <span class="float_left last_topic">
  52. <a href="forums.php?action=viewthread&amp;threadid=<?=$LastTopicID?>" class="tooltip" data-title-plain="<?=display_str($LastTopic)?>"><?=display_str(Format::cut_string($LastTopic, 50, 1))?></a>
  53. </span>
  54. <? if (!empty($LastRead[$LastTopicID])) { ?>
  55. <a class="tooltip last_read" aria-label="Jump to last read" title="Jump to last read" href="forums.php?action=viewthread&amp;threadid=<?=$LastTopicID?>&amp;page=<?=$LastRead[$LastTopicID]['Page']?>#post<?=$LastRead[$LastTopicID]['PostID']?>">
  56. <svg width="15" height="11"><polygon points="0,3 0,8 8,8 8,11 15,5.5 8,0 8,3"/></svg>
  57. </a>
  58. <? } ?>
  59. <span class="float_right last_poster">by <?=Users::format_username($LastAuthorID, false, false, false)?> <?=time_diff($LastTime, 1)?></span>
  60. </td>
  61. <td class="number_column"><?=number_format($NumTopics)?></td>
  62. <td class="number_column"><?=number_format($NumPosts)?></td>
  63. <? } ?>
  64. </tr>
  65. <? } ?>
  66. </table>
  67. </div>
  68. <div class="linkbox"><a href="forums.php?action=catchup&amp;forumid=all&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Catch up</a></div>
  69. </div>
  70. <? View::show_footer(); ?>