diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-02-06 00:09:17 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-02-06 00:09:17 +0000 |
| commit | 5642e269f24cd8b84251e35e702ab7f0d7f93dd4 (patch) | |
| tree | 3cbf338e1162dca035f8b377cb7b52260ead781c | |
| parent | 73eca628174b201f139ed6b7698f28f6a603a0bc (diff) | |
| download | messages-5642e269f24cd8b84251e35e702ab7f0d7f93dd4.tar.gz messages-5642e269f24cd8b84251e35e702ab7f0d7f93dd4.tar.bz2 messages-5642e269f24cd8b84251e35e702ab7f0d7f93dd4.zip | |
more preference standardisation
| -rw-r--r-- | message_box.php | 16 | ||||
| -rw-r--r-- | messages_lib.php | 6 | ||||
| -rw-r--r-- | templates/messages_preferences_inc.tpl | 18 |
3 files changed, 20 insertions, 20 deletions
diff --git a/message_box.php b/message_box.php index 4623440..6498dfb 100644 --- a/message_box.php +++ b/message_box.php @@ -3,7 +3,7 @@ * message package modules * * @author -* @version $Header: /cvsroot/bitweaver/_bit_messages/message_box.php,v 1.8 2006/02/04 19:04:34 squareing Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_messages/message_box.php,v 1.9 2006/02/06 00:09:17 squareing Exp $ * @package messages * @subpackage functions */ @@ -27,7 +27,7 @@ if( !$gBitUser->isRegistered() ) { $gBitSystem->isPackageActive( 'messu', TRUE ); $gBitSystem->verifyPermission( 'bit_p_messages' ); -$maxRecords = $gBitSystem->getPreference( 'maxRecords', 20 ); +$max_records = $gBitSystem->getPreference( 'max_records', 20 ); // Mark messages if the mark button was pressed if (isset($_REQUEST["mark"]) && isset($_REQUEST["msg"])) { @@ -87,21 +87,21 @@ $gBitSmarty->assign_by_ref('offset', $offset); $gBitSmarty->assign_by_ref('sort_mode', $sort_mode); $gBitSmarty->assign('find', $find); // What are we paginating: items -$items = $messulib->list_messages( $gBitUser->mUserId, $offset, $maxRecords, $sort_mode, +$items = $messulib->list_messages( $gBitUser->mUserId, $offset, $max_records, $sort_mode, $find, $_REQUEST["flag"], $_REQUEST["flagval"], $_REQUEST['priority']); -$cant_pages = ceil($items["cant"] / $maxRecords); +$cant_pages = ceil($items["cant"] / $max_records); $gBitSmarty->assign_by_ref('cant_pages', $cant_pages); -$gBitSmarty->assign('actual_page', 1 + ($offset / $maxRecords)); +$gBitSmarty->assign('actual_page', 1 + ($offset / $max_records)); -if ($items["cant"] > ($offset + $maxRecords)) { - $gBitSmarty->assign('next_offset', $offset + $maxRecords); +if ($items["cant"] > ($offset + $max_records)) { + $gBitSmarty->assign('next_offset', $offset + $max_records); } else { $gBitSmarty->assign('next_offset', -1); } if ($offset > 0) { - $gBitSmarty->assign('prev_offset', $offset - $maxRecords); + $gBitSmarty->assign('prev_offset', $offset - $max_records); } else { $gBitSmarty->assign('prev_offset', -1); } diff --git a/messages_lib.php b/messages_lib.php index 8b75fac..a750eb2 100644 --- a/messages_lib.php +++ b/messages_lib.php @@ -3,7 +3,7 @@ * message package modules * * @author -* @version $Revision: 1.1 $ +* @version $Revision: 1.2 $ * @package messages */ @@ -109,7 +109,7 @@ class Messu extends BitBase { return $ret; } - function list_messages( $pUserId, $offset, $maxRecords, $sort_mode, $find, $flag = '', $flagval = '', $prio = '' ) { + function list_messages( $pUserId, $offset, $max_records, $sort_mode, $find, $flag = '', $flagval = '', $prio = '' ) { // Load all normal messages (user to user) $bindvars = array($pUserId); @@ -135,7 +135,7 @@ class Messu extends BitBase { WHERE `to_user_id`=? $mid ORDER BY ".$this->mDb->convert_sortmode($sort_mode).",".$this->mDb->convert_sortmode("msg_id_desc"); $query_cant = "select count(*) from `".BIT_DB_PREFIX."messages` where `to_user_id`=? $mid"; - $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); + $result = $this->mDb->query($query,$bindvars,$max_records,$offset); $cant = $this->mDb->getOne($query_cant,$bindvars); $normalMessages = array(); diff --git a/templates/messages_preferences_inc.tpl b/templates/messages_preferences_inc.tpl index ccd60df..75557c1 100644 --- a/templates/messages_preferences_inc.tpl +++ b/templates/messages_preferences_inc.tpl @@ -10,16 +10,16 @@ </div> <div class="row"> - {formlabel label="Messages per page" for="mess_maxRecords"} + {formlabel label="Messages per page" for="mess_max_records"} {forminput} - <select name="mess_maxRecords" id="mess_maxRecords"> - <option value="2" {if $userPrefs.mess_maxRecords eq 2}selected="selected"{/if}>{tr}2{/tr}</option> - <option value="5" {if $userPrefs.mess_maxRecords eq 5}selected="selected"{/if}>{tr}5{/tr}</option> - <option value="10" {if $userPrefs.mess_maxRecords eq 10}selected="selected"{/if}>{tr}10{/tr}</option> - <option value="20" {if $userPrefs.mess_maxRecords eq 20}selected="selected"{/if}>{tr}20{/tr}</option> - <option value="30" {if $userPrefs.mess_maxRecords eq 30}selected="selected"{/if}>{tr}30{/tr}</option> - <option value="40" {if $userPrefs.mess_maxRecords eq 40}selected="selected"{/if}>{tr}40{/tr}</option> - <option value="50" {if $userPrefs.mess_maxRecords eq 50}selected="selected"{/if}>{tr}50{/tr}</option> + <select name="mess_max_records" id="mess_max_records"> + <option value="2" {if $userPrefs.mess_max_records eq 2}selected="selected"{/if}>{tr}2{/tr}</option> + <option value="5" {if $userPrefs.mess_max_records eq 5}selected="selected"{/if}>{tr}5{/tr}</option> + <option value="10" {if $userPrefs.mess_max_records eq 10}selected="selected"{/if}>{tr}10{/tr}</option> + <option value="20" {if $userPrefs.mess_max_records eq 20}selected="selected"{/if}>{tr}20{/tr}</option> + <option value="30" {if $userPrefs.mess_max_records eq 30}selected="selected"{/if}>{tr}30{/tr}</option> + <option value="40" {if $userPrefs.mess_max_records eq 40}selected="selected"{/if}>{tr}40{/tr}</option> + <option value="50" {if $userPrefs.mess_max_records eq 50}selected="selected"{/if}>{tr}50{/tr}</option> </select> {formhelp note=""} {/forminput} |
