UBB.Dev
Posted By: aalhait Enabling PM for Established Members - 08/31/2006 3:27 PM
Does anybody have a hack or mod to allow only existing Members (Let's say with post count > 30 for example) to use PM, otherwise disallow?

I had that hack in my UBB Classic before since I understand the code, but I just upgraded to UBB Threads recently, and I'm slow to understand the code still...

This could cut on what I call the selfish users who want to solve their problems, but do not wish to share it!
Posted By: AllenAyres Re: Enabling PM for Established Members - 08/31/2006 8:09 PM
hmm.. I had a client with that. Let me see if I can dig up the code for you smile
Posted By: AllenAyres Re: Enabling PM for Established Members - 09/02/2006 12:28 AM


OK, the code I had wasn't like this, so I wrote it. Here you go, only minimally tested smile I have it set for 50 posts, you'll need to adjust that to whatever number you like.


mess_handler.php

Find:

PHP Code

$user
= $userob -> authenticate("U_Groups,U_EReplies,U_TextCols,U_TextRows,U_Preview");
$Username = $user['U_Username'];
$Password = $user['U_Password'];

Replace with:
PHP Code

$user
= $userob -> authenticate("U_Groups,U_EReplies,U_TextCols,U_TextRows,U_Preview,U_Totalposts");
$Username = $user['U_Username'];
$Password = $user['U_Password'];

if (
$user['U_Totalposts'] < "50" ) {
$html = new html;
$html -> not_right("You need 50 posts in the forum to send a private message,",$Cat);
}





send_message.php


Find:
PHP Code

$user
= $userob -> authenticate("U_Language,U_TextCols,U_TextRows");
$Username = $user['U_Username'];




Replace with:
PHP Code

$user
= $userob -> authenticate("U_Language,U_TextCols,U_TextRows,U_Totalposts");
$Username = $user['U_Username'];

if (
$user['U_Totalposts'] < "50" ) {
$html = new html;
$html -> not_right("You need 50 posts in the forum to send a private message,",$Cat);
}



send_private.php

Find:
PHP Code

$user
= $userob -> authenticate("U_TextCols,U_TextRows,U_Preview,U_CoppaUser");
$Username = $user['U_Username'];


Replace with:
PHP Code

$user
= $userob -> authenticate("U_TextCols,U_TextRows,U_Preview,U_CoppaUser,U_Totalposts");
$Username = $user['U_Username'];

if (
$user['U_Totalposts'] < "50" ) {
$html = new html;
$html -> not_right("You need 50 posts in the forum to send a private message,",$Cat);
}

Posted By: aalhait Re: Enabling PM for Established Members - 09/12/2006 5:26 PM
Allen, Thanks a bunch!

I just added it smile (It took me a while to do it, but it works great)

I think only through hacking the board will I learn how to do this well smile

That's how I learned UBB Classic and Actually picked up Perl 8 years ago smile

Thanks again.
Posted By: AllenAyres Re: Enabling PM for Established Members - 09/13/2006 12:18 AM
You are welcome, it does take some time to learn. I'm glad it worked for you smile
© UBB.Developers