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 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. // No
  17. /*
  18. if ($ForumID == DONOR_FORUM) {
  19. $ForumDescription = Donations::get_forum_description();
  20. }
  21. $Tooltip = $ForumID == DONOR_FORUM ? 'tooltip_gold' : 'tooltip';
  22. */
  23. $Tooltip = 'tooltip';
  24. $ForumDescription = display_str($ForumDescription);
  25. if ($CategoryID != $LastCategoryID) {
  26. $LastCategoryID = $CategoryID;
  27. if ($OpenTable) { ?>
  28. </table>
  29. <? } ?>
  30. <h3><?=$ForumCats[$CategoryID]?></h3>
  31. <table class="forum_index">
  32. <tr class="colhead">
  33. <td style="width: 2%;"></td>
  34. <td style="width: 25%;">Forum</td>
  35. <td>Last Post</td>
  36. <td style="width: 7%;">Topics</td>
  37. <td style="width: 7%;">Posts</td>
  38. </tr>
  39. <?
  40. $OpenTable = true;
  41. }
  42. $Read = Forums::is_unread($Locked, $Sticky, $LastPostID, $LastRead, $LastTopicID, $LastTime) ? 'unread' : 'read';
  43. /* Removed per request, as distracting
  44. if ($Locked) {
  45. $Read .= '_locked';
  46. }
  47. if ($Sticky) {
  48. $Read .= '_sticky';
  49. }
  50. */
  51. ?>
  52. <tr class="row">
  53. <td class="<?=$Read?> <?=$Tooltip?>" title="<?=ucfirst($Read)?>"></td>
  54. <td>
  55. <h4 class="min_padding">
  56. <a class="<?=$Tooltip?>" href="forums.php?action=viewforum&amp;forumid=<?=$ForumID?>" title="<?=display_str($ForumDescription)?>"><?=display_str($ForumName)?></a>
  57. </h4>
  58. </td>
  59. <? if ($NumPosts == 0) { ?>
  60. <td>
  61. There are no topics here.<?=(($MinCreate <= $LoggedUser['Class']) ? ' <a href="forums.php?action=new&amp;forumid='.$ForumID.'">Create one!</a>' : '')?>
  62. </td>
  63. <td class="number_column">0</td>
  64. <td class="number_column">0</td>
  65. <? } else { ?>
  66. <td>
  67. <span style="float: left;" class="last_topic">
  68. <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>
  69. </span>
  70. <? if (!empty($LastRead[$LastTopicID])) { ?>
  71. <a class="<?=$Tooltip?> last_read" title="Jump to last read" href="forums.php?action=viewthread&amp;threadid=<?=$LastTopicID?>&amp;page=<?=$LastRead[$LastTopicID]['Page']?>#post<?=$LastRead[$LastTopicID]['PostID']?>">
  72. <svg width="15" height="11"><polygon points="0,3 0,8 8,8 8,11 15,5.5 8,0 8,3"/></svg>
  73. </a>
  74. <? } ?>
  75. <span style="float: right;" class="last_poster">by <?=Users::format_username($LastAuthorID, false, false, false)?> <?=time_diff($LastTime, 1)?></span>
  76. </td>
  77. <td class="number_column"><?=number_format($NumTopics)?></td>
  78. <td class="number_column"><?=number_format($NumPosts)?></td>
  79. <? } ?>
  80. </tr>
  81. <? } ?>
  82. </table>
  83. </div>
  84. <div class="linkbox"><a href="forums.php?action=catchup&amp;forumid=all&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Catch up</a></div>
  85. </div>
  86. <? View::show_footer(); ?>