Previous Thread
Next Thread
Print Thread
Rate Thread
#265643 12/29/2003 11:52 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
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?

Sponsored Links
BlarC #265644 12/30/2003 12:07 AM
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.

Daine #265645 12/30/2003 12:21 AM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Okay, I will double check. Thanks

BlarC #265646 12/30/2003 4:17 AM
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 wink at the moment - but expanding all the time....)
Gorlum #265647 12/30/2003 8:40 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
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.

Sponsored Links
Daine #265648 01/03/2004 8:51 PM
Joined: May 2003
Posts: 94
Power User
Power User
Offline
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.

Daine #265650 01/03/2004 10:00 PM
Joined: May 2003
Posts: 94
Power User
Power User
Offline
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.

Daine #265652 01/03/2004 10:37 PM
Joined: May 2003
Posts: 94
Power User
Power User
Offline
Joined: May 2003
Posts: 94
ok, thanks Josh

Sponsored Links
Daine #265653 01/03/2004 10:38 PM
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!
Tachyon #265654 01/03/2004 10:42 PM
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.

Daine #265655 01/03/2004 10:47 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
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
Offline
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)
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?

domain123 #265657 01/04/2004 12:03 PM
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.

Daine #265658 01/04/2004 2:34 PM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
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.....

domain123 #265659 01/06/2004 10:28 AM
Joined: Jun 2003
Posts: 1,025
Junior Member
Junior Member
Offline
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?

BrokenToy #265660 01/06/2004 11:08 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
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
Offline
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


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)