|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
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?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
That *should* be the way that it works. Or it used to. Admins can always send PMs to anyone. Even if they are off.
|
|
|
|
Joined: May 2003
Posts: 1,068
Junior Member
|
Junior Member
Joined: May 2003
Posts: 1,068 |
Okay, I will double check. Thanks
|
|
|
|
Joined: Feb 2002
Posts: 2,286
Veteran
|
Veteran
Joined: Feb 2002
Posts: 2,286 |
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.
Fans Focus - Focusing on Fans of Sport (Okay - mainly football (the British variety at the moment - but expanding all the time....)
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
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.
|
|
|
|
Joined: May 2003
Posts: 94
Power User
|
Power User
Joined: May 2003
Posts: 94 |
[] 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.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
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.
|
|
|
|
Joined: May 2003
Posts: 94
Power User
|
Power User
Joined: May 2003
Posts: 94 |
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.
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
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.
|
|
|
|
Joined: May 2003
Posts: 94
Power User
|
Power User
Joined: May 2003
Posts: 94 |
|
|
|
|
Joined: Jun 2000
Posts: 190
Enthusiast
|
Enthusiast
Joined: Jun 2000
Posts: 190 |
[] 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
Artificial Intelligence is no match for natural stupidity!
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
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.
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
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); ?>
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
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) <br /><br />if ($AcceptPriv == "no" && $user['U_Status'] != "Administrator") {<br /> $html -> not_right($ubbt_lang['NO_PRIVATE'],$Cat);<br />}<br /> to <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?
|
|
|
|
Joined: Nov 2001
Posts: 10,369
I type Like navaho
|
I type Like navaho
Joined: Nov 2001
Posts: 10,369 |
[] 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.
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
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.....
|
|
|
|
Joined: Jun 2003
Posts: 1,025
Junior Member
|
Junior Member
Joined: Jun 2003
Posts: 1,025 |
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?
|
|
|
|
Joined: Apr 2001
Posts: 3,266
Member
|
Member
Joined: Apr 2001
Posts: 3,266 |
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.
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
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
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|