News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Maximum Personal Messages limit by membergroup

Started by gasman, July 27, 2007, 12:55:31 AM

Previous topic - Next topic

metallica48423

pmp6nl, i looked in the bug tracker for this, but couldn't find it, is it still open or is it resolved?

Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Fiery

#21
Good question.

I am not sure, I cant find it...

Stüldt Håjt

I'd like to see this bug fixed too. I have same problems as I want certain members to have more pm's.

Fiery

This w
Quote from: Stüldt Håjt on January 16, 2008, 12:05:26 PM
I'd like to see this bug fixed too. I have same problems as I want certain members to have more pm's.

Its in the bug tracker ;)

THE BRA1N

This sounds like the problem I am having. I have a Global Mod whose primary group is set to unlimited PMs but everyone gets an "inbox full" message when they PM him except admins.

Seems like the 0 unlimited setting is being overridden by something because when I set the limit to 800 (he likes to save all his PMs for some reason), the PMs finally go though. Yet if I change it back to 0, the full message comes back up again.

Recently his primary user group changed from Global, to something else which had a 200 PM limit and back to Global. Any thoughts?

Rumbaar

Well I haven't read the whole (OLD) thread.

But if you set the Regular Member PM limit to a level, leave all Post Count groups to 0 (unlimited) the Regular Members membergroup would control all other general users limits.  Then the special primary membergroups would override the Regular Members limit.  So adding them to Global Moderator with a limit of 200 should now work.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Biology Forums

#26
Did this ever get fixed?

I find that what SMF does right is that it doesn't show the bar for members that are unlimited, for instance.

It does this by the following code found in PersonalMessage.php

// Load up the members maximum message capacity.
if (!$user_info['is_admin'])
{
// !!! Why do we do this?  It seems like if they have any limit we should use it.
$request = db_query("
SELECT MAX(maxMessages) AS topLimit, MIN(maxMessages) AS bottomLimit
FROM {$db_prefix}membergroups
WHERE ID_GROUP IN (" . implode(', ', $user_info['groups']) . ')', __FILE__, __LINE__);
list ($maxMessage, $minMessage) = mysql_fetch_row($request);
mysql_free_result($request);

$context['message_limit'] = $minMessage == 0 ? 0 : $maxMessage;
}
else
$context['message_limit'] = 0;

// Prepare the context for the capacity bar.
if (!empty($context['message_limit']))
{
$bar = ($user_info['messages'] * 100) / $context['message_limit'];

$context['limit_bar'] = array(
'messages' => $user_info['messages'],
'allowed' => $context['message_limit'],
'percent' => $bar,
'bar' => min(100, (int) $bar),
'text' => sprintf($txt['pm_currently_using'], $user_info['messages'], round($bar, 1)),
);
}


But, when a message is being sent (being passed to Subs-Post.php), this is was controls the error, which doesn't take into account min and max values:

$request = db_query("
SELECT
mem.memberName, mem.realName, mem.ID_MEMBER, mem.emailAddress, mem.lngfile, mg.maxMessages,
mem.pm_email_notify, mem.instantMessages," . (allowedTo('moderate_forum') ? ' 0' : "
(mem.pm_ignore_list = '*' OR FIND_IN_SET($from[id], mem.pm_ignore_list))") . " AS ignored,
FIND_IN_SET($from[id], mem.buddy_list) AS is_buddy, mem.is_activated,
(mem.ID_GROUP = 1 OR FIND_IN_SET(1, mem.additionalGroups)) AS is_admin, mg.onlineColor
FROM {$db_prefix}members AS mem
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE mem.ID_MEMBER IN (" . implode(", ", $all_to) . ")
ORDER BY mem.lngfile
LIMIT " . count($all_to), __FILE__, __LINE__);
$notifications = array();
while ($row = mysql_fetch_assoc($request))
{
// Has the receiver gone over their message limit, assuming that neither they nor the sender are important?!
if (!empty($row['maxMessages']) && $row['maxMessages'] <= $row['instantMessages'] && !allowedTo('moderate_forum') && !$row['is_admin'])
{
$log['failed'][] = sprintf($txt['pm_error_data_limit_reached'], $row['realName']);
unset($all_to[array_search($row['ID_MEMBER'], $all_to)]);
continue;
}

Advertisement: