|
@@ -19,6 +19,7 @@
|
|
|
function RecentPosts2() {
|
|
|
global $board, $txt, $scripturl, $sourcedir, $user_info, $context, $settings, $modSettings, $smcFunc, $options;
|
|
|
|
|
|
+ $context['showing_all_topics'] = false;
|
|
|
// Prefetching + lots of MySQL work = bad mojo.
|
|
|
if (isset($_SERVER['HTTP_X_MOZ']) && $_SERVER['HTTP_X_MOZ'] == 'prefetch') {
|
|
|
ob_end_clean();
|
|
@@ -30,12 +31,12 @@ function RecentPosts2() {
|
|
|
$context['topics_per_page'] = empty($modSettings['disableCustomPerPage']) && !empty($options['topics_per_page']) && !WIRELESS ? $options['topics_per_page'] : $modSettings['defaultMaxTopics'];
|
|
|
$context['page_title'] = $txt['recent_posts'];
|
|
|
|
|
|
- if ($context['showing_all_topics'] && !empty($context['load_average']) && !empty($modSettings['loadavg_allunread']) && $context['load_average'] >= $modSettings['loadavg_allunread'])
|
|
|
- fatal_lang_error('loadavg_allunread_disabled', false);
|
|
|
- elseif ($_REQUEST['action'] != 'unread' && !empty($context['load_average']) && !empty($modSettings['loadavg_unreadreplies']) && $context['load_average'] >= $modSettings['loadavg_unreadreplies'])
|
|
|
- fatal_lang_error('loadavg_unreadreplies_disabled', false);
|
|
|
- elseif (!$context['showing_all_topics'] && $_REQUEST['action'] == 'unread' && !empty($context['load_average']) && !empty($modSettings['loadavg_unread']) && $context['load_average'] >= $modSettings['loadavg_unread'])
|
|
|
- fatal_lang_error('loadavg_unread_disabled', false);
|
|
|
+// if ($context['showing_all_topics'] && !empty($context['load_average']) && !empty($modSettings['loadavg_allunread']) && $context['load_average'] >= $modSettings['loadavg_allunread'])
|
|
|
+// fatal_lang_error('loadavg_allunread_disabled', false);
|
|
|
+// elseif ($_REQUEST['action'] != 'unread' && !empty($context['load_average']) && !empty($modSettings['loadavg_unreadreplies']) && $context['load_average'] >= $modSettings['loadavg_unreadreplies'])
|
|
|
+// fatal_lang_error('loadavg_unreadreplies_disabled', false);
|
|
|
+// elseif (!$context['showing_all_topics'] && $_REQUEST['action'] == 'unread' && !empty($context['load_average']) && !empty($modSettings['loadavg_unread']) && $context['load_average'] >= $modSettings['loadavg_unread'])
|
|
|
+// fatal_lang_error('loadavg_unread_disabled', false);
|
|
|
|
|
|
// Parameters for the main query.
|
|
|
$query_parameters = array();
|
|
@@ -199,15 +200,15 @@ function RecentPosts2() {
|
|
|
|
|
|
$context['linktree'][] = array(
|
|
|
'url' => $scripturl . '?action=' . $_REQUEST['action'] . sprintf($context['querystring_board_limits'], 0) . $context['querystring_sort_limits'],
|
|
|
- 'name' => $_REQUEST['action'] == 'recent3' ? $txt['unread_topics_visit'] : $txt['unread_replies']
|
|
|
+ 'name' => $_REQUEST['action'] == 'recent' ? $txt['unread_topics_visit'] : $txt['unread_replies']
|
|
|
);
|
|
|
|
|
|
- if ($context['showing_all_topics'])
|
|
|
- $context['linktree'][] = array(
|
|
|
- 'url' => $scripturl . '?action=' . $_REQUEST['action'] . ';all' . sprintf($context['querystring_board_limits'], 0) . $context['querystring_sort_limits'],
|
|
|
- 'name' => $txt['unread_topics_all']
|
|
|
- );
|
|
|
- else
|
|
|
+// if ($context['showing_all_topics'])
|
|
|
+// $context['linktree'][] = array(
|
|
|
+// 'url' => $scripturl . '?action=' . $_REQUEST['action'] . ';all' . sprintf($context['querystring_board_limits'], 0) . $context['querystring_sort_limits'],
|
|
|
+// 'name' => $txt['unread_topics_all']
|
|
|
+// );
|
|
|
+// else
|
|
|
$txt['unread_topics_visit_none'] = strtr($txt['unread_topics_visit_none'], array('?action=unread;all' => '?action=unread;all' . sprintf($context['querystring_board_limits'], 0) . $context['querystring_sort_limits']));
|
|
|
|
|
|
if (WIRELESS)
|
|
@@ -456,7 +457,7 @@ function RecentPosts2() {
|
|
|
determineTopicClass($context['topics'][$row['id_topic']]);
|
|
|
}
|
|
|
$smcFunc['db_free_result']($request);
|
|
|
-
|
|
|
+ $is_topics = false;
|
|
|
if ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids)) {
|
|
|
$result = $smcFunc['db_query']('', '
|
|
|
SELECT id_topic
|
|
@@ -541,17 +542,17 @@ function template_recent() {
|
|
|
<tr class="catbg">
|
|
|
<th scope="col" class="first_th" width="8%" colspan="2"> </th>
|
|
|
<th scope="col">
|
|
|
- <a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
+ <a href="', $scripturl, '?action=recent', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
</th>
|
|
|
<th scope="col" width="14%" align="center">
|
|
|
- <a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
+ <a href="', $scripturl, '?action=recent', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=replies', $context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['replies'], $context['sort_by'] == 'replies' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
</th>';
|
|
|
|
|
|
// Show a "select all" box for quick moderation?
|
|
|
if ($showCheckboxes)
|
|
|
echo '
|
|
|
<th scope="col" width="22%">
|
|
|
- <a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
+ <a href="', $scripturl, '?action=recent', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
</th>
|
|
|
<th class="last_th">
|
|
|
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="input_check" />
|
|
@@ -559,7 +560,7 @@ function template_recent() {
|
|
|
else
|
|
|
echo '
|
|
|
<th scope="col" class="smalltext last_th" width="22%">
|
|
|
- <a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
+ <a href="', $scripturl, '?action=recent', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt['last_post'], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
|
|
|
</th>';
|
|
|
echo '
|
|
|
</tr>
|