2013-06-04 08:00:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Inbox {
|
|
|
|
/*
|
|
|
|
* Get the link to a user's inbox.
|
|
|
|
* This is what handles the ListUnreadPMsFirst setting
|
|
|
|
*
|
|
|
|
* @param string - whether the inbox or sentbox should be loaded
|
|
|
|
* @return string - the URL to a user's inbox
|
|
|
|
*/
|
2013-06-12 08:00:46 +00:00
|
|
|
public static function get_inbox_link($WhichBox = 'inbox') {
|
|
|
|
|
2013-08-28 23:08:41 +00:00
|
|
|
$ListFirst = G::$LoggedUser['ListUnreadPMsFirst'];
|
2013-06-12 08:00:46 +00:00
|
|
|
|
2013-06-04 08:00:34 +00:00
|
|
|
if ($WhichBox == 'inbox') {
|
|
|
|
if ($ListFirst) {
|
|
|
|
$InboxURL = 'inbox.php?sort=unread';
|
|
|
|
} else {
|
|
|
|
$InboxURL = 'inbox.php';
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ($ListFirst) {
|
|
|
|
$InboxURL = 'inbox.php?action=sentbox&sort=unread';
|
|
|
|
} else {
|
|
|
|
$InboxURL = 'inbox.php?action=sentbox';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $InboxURL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|