UBB.Dev
Posted By: ericgtr PM's by admins - 12/30/2003 6:52 AM
When a user turns off the option to receive PM's, is there a way to make it so an admin can still get one through?
Posted By: JoshPet Re: PM's by admins - 12/30/2003 7:07 AM
That *should* be the way that it works. Or it used to.

Admins can always send PMs to anyone. Even if they are off.
Posted By: ericgtr Re: PM's by admins - 12/30/2003 7:21 AM
Okay, I will double check. Thanks
Posted By: Ian_W Re: PM's by admins - 12/30/2003 11:17 AM
I know as an admin - I have had it blocked before under 6.3.x - as this user was being a pain - I had to turn him on (his PM's I mean ) - not sure if this has changed under 6.4.
Posted By: omegatron Re: PM's by admins - 12/30/2003 3:40 PM
In the private message file there is coding to override a user's notify setting if your an admin. So thus if you send a user one it goes through.
Posted By: kestral Re: PM's by admins - 01/04/2004 3:51 AM
[]JoshPet said:
That *should* be the way that it works. Or it used to.

Admins can always send PMs to anyone. Even if they are off. [/]

6.4 nope. PM's off and as admin, Send a private message isn't a 'link' to send one. I have to enable PM's to send members private messages from admin.
Posted By: JoshPet Re: PM's by admins - 01/04/2004 4:45 AM
No I think you're not understanding.

If the user has decided not to receive PMs, the admin can still PM the user. If the admin turns off the PM ability all together, then nobody can PM.

But the question above was about a user blocking PMs in their profile.

So if PMs are turned off for the whole board, the behavior you describe is correct.
Posted By: kestral Re: PM's by admins - 01/04/2004 5:00 AM
Ok, gottcha. I was hoping as admin I could 'still' send PM's when necessary.


What type of strain do PM's put on threads working in general ? I have 800+ VERY active users.
Posted By: JoshPet Re: PM's by admins - 01/04/2004 5:03 AM
Not much - I would purge inactive messages from time to time (from the admin menu) just to keep the messages table from getting too big.
Posted By: kestral Re: PM's by admins - 01/04/2004 5:37 AM
ok, thanks Josh
Posted By: Pilgrim Re: PM's by admins - 01/04/2004 5:38 AM
[]JoshPet said:
Not much - I would purge inactive messages from time to time (from the admin menu) just to keep the messages table from getting too big. [/]
Josh,

In the old w3tthreads version, You would set the number of days, e.g., 30 in the Admin utility and then you could setup a cron task using the "doexpiremessages.pl" file.

Is there a way to do this in 6.4, so that PM's can be deleted from the database on a cron schedule every "x" number of days? (I have the "doexpiremessages.pl file which is configured for the cron if someone would like to look at it. ).

Thanks,

Jeff
Posted By: JoshPet Re: PM's by admins - 01/04/2004 5:42 AM
There is not currently a cron file for private messages. So I don't know about the old script, but so much has I doubt that the script would work.

We can't really allow it to be posted here, as those script are copyrighted. Probably a new cron script could be written easily in php just by looking at the admin scripts which currently purge the messages.
Posted By: omegatron Re: PM's by admins - 01/04/2004 5:47 AM
A simply query to delete all PM's with a unixtimestamp over or equal to 30days will do it. You set that up on a cron task and your set.

<?

// Require the library
require ("/PATH/TO/main.inc.php");

$query = "
DELETE FROM {$config['tbprefix']}Messages
WHERE M_Sent <= UNIX_TIMESTAMP( DATE_SUB(CURDATE(), INTERVAL 30 DAY) )
";
$dbh -> do_query($query);

?>
Posted By: Anno Re: PM's by admins - 01/04/2004 3:08 PM
In order for the moderators also be able to send a pm to everyone, change this check in sendmessage.php and in sendprivate.php (the code is a bit diffdrent in both, but does the same)
Code
 <br /><br />if ($AcceptPriv == "no" && $user['U_Status'] != "Administrator") {<br />   $html -> not_right($ubbt_lang['NO_PRIVATE'],$Cat);<br />}<br /> 


to

Code
 <br />if ($AcceptPriv == "no") {<br />    if ($user['U_Status'] != "Administrator"){<br />        if ($user['U_Status'] != "Moderator"){<br />	    $html -> not_right($ubbt_lang['NO_PRIVATE'],$Cat);<br />	}<br />    }<br />}<br /><br /> 


Question for PHP freaks:
How can I write the above constuct more compact?
Posted By: JoshPet Re: PM's by admins - 01/04/2004 7:03 PM
[]Anno said:
Question for PHP freaks:
How can I write the above constuct more compact? [/]

if (($AcceptPriv == "no") && ($user['U_Status'] != "Administrator") && ($user['U_Status'] != "Moderator")) {

Then all 3 of those statments would have to be true for it to do what's inside the brackets.
Posted By: Anno Re: PM's by admins - 01/04/2004 9:34 PM
Sounds logically, and I actually tried this before, but it didn´t work for some reason...the mods still couldn´t PM the users.

Then I went the long way.....
Posted By: slayer60 Re: PM's by admins - 01/06/2004 5:28 PM
It seems like you would want an or statement between the admin check and the mod check. If they all have to be true, then a mod wouldn't be able to send the pm...right?
Posted By: omegatron Re: PM's by admins - 01/06/2004 6:08 PM
What JoshPet posted is correct.

if (($AcceptPriv == "no") && ($user['U_Status'] != "Administrator") && ($user['U_Status'] != "Moderator")) {

I have done this on a person's server and works fine. I would look at your syntax and make sure it is exact.
Posted By: Anno Re: PM's by admins - 01/07/2004 12:57 PM
I didn't use the qotes around the criteria, I just inserted
&& $user['U_Status'] != "Moderator"
to the check that was there from infopop....perhaps that´s the cause.
Anyway, it works both ways, lucky me
© UBB.Developers