Implemented configurable PMs-per-page for users' inbox.

This commit is contained in:
0bs3rv3ra 2014-04-01 00:24:53 +10:00
parent 3a0fb3ef32
commit 101685f997
2 changed files with 17 additions and 3 deletions

View File

@ -3,7 +3,10 @@
$UserID = $LoggedUser['ID']; $UserID = $LoggedUser['ID'];
//deal with users who have yet to configure this in their profile page
if(!isset($LoggedUser['PrivateMessagesPerPage'])) {
$LoggedUser['PrivateMessagesPerPage'] = 25; //problem solbed
}
if (empty($_GET['action'])) { if (empty($_GET['action'])) {
$Section = 'inbox'; $Section = 'inbox';
@ -14,7 +17,7 @@
error(404); error(404);
} }
list($Page, $Limit) = Format::page_limit(MESSAGES_PER_PAGE); list($Page, $Limit) = Format::page_limit($LoggedUser['PrivateMessagesPerPage']);
View::show_header('Inbox'); View::show_header('Inbox');
?> ?>
@ -79,7 +82,7 @@
$DB->set_query_id($Results); $DB->set_query_id($Results);
$Count = $DB->record_count(); $Count = $DB->record_count();
$Pages = Format::get_pages($Page, $NumResults, MESSAGES_PER_PAGE, 9); $Pages = Format::get_pages($Page, $NumResults, $LoggedUser['PrivateMessagesPerPage'], 9);
echo "\t\t$Pages\n"; echo "\t\t$Pages\n";
?> ?>
</div> </div>

View File

@ -381,6 +381,17 @@ function checked($Checked) {
posts per page posts per page
</td> </td>
</tr> </tr>
<tr id="comm_pmpp_tr">
<td class="label tooltip" title="This option allows you to set the desired number of displayed private messages per page in your inbox."><strong>Private messages per page (inbox)</strong></td>
<td>
<select name="privatemessagesperpage" id="privatemessagesperpage">
<option value="25"<?=$SiteOptions['PrivateMessagesPerPage'] == 25 ? ' selected="selected"' : ''?>>25 (default)</option>
<option value="50"<?=$SiteOptions['PrivateMessagesPerPage'] == 50 ? ' selected="selected"' : ''?>>50</option>
<option value="100"<?=$SiteOptions['PrivateMessagesPerPage'] == 100 ? ' selected="selected"' : ''?>>100</option>
</select>
private messages per page
</td>
</tr>
<tr id="comm_inbsort_tr"> <tr id="comm_inbsort_tr">
<td class="label tooltip" title="This option will force unread private messages to be listed first."><strong>Inbox sorting</strong></td> <td class="label tooltip" title="This option will force unread private messages to be listed first."><strong>Inbox sorting</strong></td>
<td> <td>