123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?php
- $LastRead = Forums::get_last_read($Forums);
- View::show_header('Forums');
- ?>
-
- <div class="header">
- <h2>Forums</h2>
- </div>
-
- <div class="forum_list">
- <?php
- $LastCategoryID = 0;
- $OpenTable = false;
-
- foreach ($Forums as $Forum) {
- list($ForumID, $CategoryID, $ForumName, $ForumDescription, $MinRead, $MinWrite, $MinCreate, $NumTopics, $NumPosts, $LastPostID, $LastAuthorID, $LastTopicID, $LastTime, $SpecificRules, $LastTopic, $Locked, $Sticky) = array_values($Forum);
-
- if (!Forums::check_forumperm($ForumID)) {
- continue;
- }
-
- $ForumDescription = display_str($ForumDescription);
-
- if ($CategoryID != $LastCategoryID) {
- $LastCategoryID = $CategoryID;
-
- if ($OpenTable) { ?>
- </table>
- <?php } ?>
-
- <h3>
- <?=$ForumCats[$CategoryID]?>
- </h3>
-
- <table class="forum_index alternate_rows">
- <tr class="colhead">
- <td style="width: 2%;"></td>
- <td style="max-width: 25%;">Forum</td>
- <td>Last Post</td>
- <td style="width: 7%;">Topics</td>
- <td style="width: 7%;">Posts</td>
- </tr>
- <?php
- $OpenTable = true;
- }
-
- $Read = Forums::is_unread($Locked, $Sticky, $LastPostID, $LastRead, $LastTopicID, $LastTime) ? 'unread' : 'read'; ?>
- <tr class="row">
- <td class="<?=$Read?> tooltip"
- title="<?=ucfirst($Read)?>">
- </td>
-
- <td>
- <h4>
- <a class="tooltip"
- href="forums.php?action=viewforum&forumid=<?=$ForumID?>"
- title="<?=display_str($ForumDescription)?>"><?=display_str($ForumName)?></a>
- </h4>
- </td>
-
- <?php if ($NumPosts === 0) { ?>
- <td>
- There are no topics here.
- <?= (($MinCreate <= $LoggedUser['Class'])
- ? ' <a href="forums.php?action=new&forumid='.$ForumID.'">Create one!</a>'
- : '') ?>
- </td>
-
- <td class="number_column">0</td>
- <td class="number_column">0</td>
- <?php } else { ?>
- <td>
- <span class="float_left last_topic">
- <a href="forums.php?action=viewthread&threadid=<?=$LastTopicID?>"
- class="tooltip"
- data-title-plain="<?=display_str($LastTopic)?>"><?=display_str(Format::cut_string($LastTopic, 50, 1))?></a>
- </span>
-
- <?php if (!empty($LastRead[$LastTopicID])) { ?>
- <a class="tooltip last_read" aria-label="Jump to last read" title="Jump to last read"
- href="forums.php?action=viewthread&threadid=<?=$LastTopicID?>&page=<?=$LastRead[$LastTopicID]['Page']?>#post<?=$LastRead[$LastTopicID]['PostID']?>">
- →
- </a>
- <?php } ?>
-
- <span class="float_right last_poster">
- by <?=Users::format_username($LastAuthorID, false, false, false)?>
- <?=time_diff($LastTime, 1)?>
- </span>
- </td>
-
- <td class="number_column">
- <?=number_format($NumTopics)?>
- </td>
-
- <td class="number_column">
- <?=number_format($NumPosts)?>
- </td>
- <?php } ?>
- </tr>
- <?php
- } ?>
- </table>
- </div>
-
- <div class="linkbox">
- <a href="forums.php?action=catchup&forumid=all&auth=<?=$LoggedUser['AuthKey']?>"
- class="brackets">Catch up</a>
- </div>
- <?php View::show_footer();
|