Created
December 11, 2012 23:46
-
-
Save marc1706/4263460 to your computer and use it in GitHub Desktop.
Get rid of popup message and refresh the page after marking forums read.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php | |
index 7312980..ed3d1b0 100644 | |
--- a/phpBB/includes/functions_display.php | |
+++ b/phpBB/includes/functions_display.php | |
@@ -61,10 +61,13 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod | |
{ | |
markread('all', false, false, request_var('mark_time', 0)); | |
- trigger_error( | |
- $user->lang['FORUMS_MARKED'] . '<br /><br />' . | |
- sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>') | |
- ); | |
+ if (!$request->is_ajax()) | |
+ { | |
+ trigger_error( | |
+ $user->lang['FORUMS_MARKED'] . '<br /><br />' . | |
+ sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>') | |
+ ); | |
+ } | |
} | |
else | |
{ | |
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js | |
index fa31d32..c941b72 100644 | |
--- a/phpBB/styles/prosilver/template/ajax.js | |
+++ b/phpBB/styles/prosilver/template/ajax.js | |
@@ -2,6 +2,11 @@ | |
"use strict"; | |
+// This callback will quickly refresh the page without scrolling to the top | |
+phpbb.add_ajax_callback('quick_refresh', function() { | |
+ location.reload(); | |
+}); | |
+ | |
// This callback finds the post from the delete link, and removes it. | |
phpbb.add_ajax_callback('post_delete', function() { | |
var el = $(this), | |
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html | |
index 6babbf5..b7d9010 100644 | |
--- a/phpBB/styles/prosilver/template/index_body.html | |
+++ b/phpBB/styles/prosilver/template/index_body.html | |
@@ -8,7 +8,7 @@ | |
<!-- IF S_DISPLAY_SEARCH --> | |
<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> • <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> • <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> • <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li> | |
<!-- ENDIF --> | |
- <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="true">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF --> | |
+ <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="quick_refresh" data-overlay="false">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF --> | |
</ul> | |
<!-- ENDIF --> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment