BioTorrents.de’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.1KB

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