mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 10:44:20 +02:00
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8521 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1803,4 +1803,25 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set correct users max messages in PM folder.
|
||||
* If several group memberships define different amount of messages, the highest will be chosen.
|
||||
*/
|
||||
function set_user_message_limit()
|
||||
{
|
||||
global $user, $db, $config;
|
||||
|
||||
// Get maximum about from user memberships - if it is 0, there is no limit set and we use the maximum value within the config.
|
||||
$sql = 'SELECT MAX(g.group_message_limit) as max_message_limit
|
||||
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
|
||||
WHERE ug.user_id = ' . $user->data['user_id'] . '
|
||||
AND ug.user_pending = 0
|
||||
AND ug.group_id = g.group_id';
|
||||
$result = $db->sql_query($sql);
|
||||
$message_limit = (int) $db->sql_fetchfield('max_message_limit');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
|
||||
}
|
||||
|
||||
?>
|
@@ -129,15 +129,7 @@ class ucp_pm
|
||||
break;
|
||||
|
||||
case 'options':
|
||||
$sql = 'SELECT group_message_limit
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE group_id = ' . $user->data['group_id'];
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
$message_limit = (int) $db->sql_fetchfield('group_message_limit');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
|
||||
|
||||
set_user_message_limit();
|
||||
get_folder($user->data['user_id']);
|
||||
|
||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.' . $phpEx);
|
||||
@@ -168,14 +160,7 @@ class ucp_pm
|
||||
|
||||
case 'view':
|
||||
|
||||
$sql = 'SELECT group_message_limit
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE group_id = ' . $user->data['group_id'];
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
$message_limit = (int) $db->sql_fetchfield('group_message_limit');
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
|
||||
set_user_message_limit();
|
||||
|
||||
if ($folder_specified)
|
||||
{
|
||||
|
Reference in New Issue
Block a user