aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-08-02 16:39:02 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-08-02 16:39:02 +0000
commit74d60e4c1a2400d8f62966c6310decc40ed8f3b4 (patch)
treecedab5ede4ed94d4142341a430ef91282856e33f /phpBB
parent7d1f1b45963cc09b13a9a326ff11e904b95470e2 (diff)
downloadforums-74d60e4c1a2400d8f62966c6310decc40ed8f3b4.tar
forums-74d60e4c1a2400d8f62966c6310decc40ed8f3b4.tar.gz
forums-74d60e4c1a2400d8f62966c6310decc40ed8f3b4.tar.bz2
forums-74d60e4c1a2400d8f62966c6310decc40ed8f3b4.tar.xz
forums-74d60e4c1a2400d8f62966c6310decc40ed8f3b4.zip
Pagination updates ... new function for on_page
git-svn-id: file:///svn/phpbb/trunk@2810 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/functions.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index e932100724..365b9c2fe9 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -458,7 +458,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
$total_pages = ceil($num_items/$per_page);
- if ( $total_pages == 1 )
+ if ( $total_pages == 1 || !$num_items )
{
return '';
}
@@ -545,6 +545,13 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
return $page_string;
}
+function on_page($num_items, $per_page, $start)
+{
+ global $lang;
+
+ return sprintf($lang['Page_of'], floor( $start / $per_page ) + 1, max(ceil( $num_items / $per_page ), 1) );
+}
+
//
// Obtain list of naughty words and build preg style replacement arrays for use by the
// calling script, note that the vars are passed as references this just makes it easier
@@ -587,6 +594,13 @@ function message_die($msg_code, $msg_text = '', $msg_title = '', $display_header
switch ( $msg_code )
{
case MESSAGE:
+ if ( !$userdata )
+ {
+ $userdata = $session->start();
+ $acl = new auth('admin', $userdata);
+ $session->configure($userdata);
+ }
+
if ( !defined('HEADER_INC') )
{
$page = ( !defined('IN_ADMIN') ) ? 'includes/page_header.' : 'admin/page_header_admin.';