UBB.Dev
Posted By: JoshPet [6.2] Private Moderation 1.3 - 11/22/2002 9:38 AM
Mod Name / Version - Private Moderation 1.3
     Version 1.1 blocks the users ability to edit their profile if they are in private moderation. 1/23/03
     Version 1.2 offers the option to block the sending of Private Messages. 1/28/03
     Version 1.3 adds in the functionality to be able to search and find users who are in private moderation - thanks Raconteur

Description - This allows you to put a user into "Private Moderation" where all their posts will require approval from an admin or mod. An alternative to banning...allowing their good posts to get through. Almost like a probation.

Working Under - UBB.Threads 6.2, 6.2.1

Pre-requisites - none

Author - JoshPet - www.joshuapettit.com
     for discussions and bug reports come to www.ubbdev.com

Credits - Raconteur

Files Altered - addpost.php, ubbthreads.php, /admin/selectoption.php, admin/selectusers.php, admin/showusers.php, includes/selectusers.js

Database Altered - 1 field added to the w3t_Users table (U_PrivateModeration) with a yes/no value.

New Files - /admin/moderateuser.php, /admin/unmoderateuser.php

Any other info - Only Admins can enter or remove a user from private moderation. Edit their profile, and you'll see the option right below the "ban this user" option. Remove them from moderation the same way. The User and All Admins/Mods receive a PM when they are added or removed from Moderation.

Backup your files and database before doing any modifing of you code.

Haven't done much testing yet myself. But all seems to be OK with initial testing.


Attached File
60856-PrivateModeration1.3.zip  (334 downloads)
Posted By: Gardener Re: Private Moderation 1.0 - 11/22/2002 9:51 AM
Great work, this will be a popular mod I should think!
Posted By: dimopoulos Re: Private Moderation 1.0 - 11/22/2002 12:35 PM
Thanks Josh!

Nice one!

Warm regards

Nikos
Posted By: JoshPet Re: Private Moderation 1.0 - 11/24/2002 10:50 AM
There are some tweaks to this mod, that I could see useful, and would write up if anyone was interested.

As an alternative to approving user registrations.. you could set it up that New Users are in the Private Moderation for their first X posts...or until the Admin "approves" them for live posting.... Let people start there and earn their trust.
Posted By: ksanuk Re: Private Moderation 1.0 - 11/25/2002 8:53 AM
Hi,

Great mod.

I do have a request though

Could this be modified to work on a forum by forum basis and then allowing not just the Admin, but also the moderators to approve posts?

Reason for asking is that I have one area on my board in which tensions seem to flare up at times, yet the same poster that would need moderating in there might be well behaved in other areas.

Sanuk!
Posted By: JoshPet Re: Private Moderation 1.0 - 11/25/2002 10:18 AM
Moderators are allowed to approve posts in their forum. Currently only admins can put a user in, or take a user out of private moderation. But anyone who can normally approve posts can approve them.

This isn't fancy... but if you wanted it to work in a specific board only....

Where you normally add this in addpost.php:
code:

// -------------------------
// Private Moderation - by JoshPet
if ($user['U_PrivateModeration'] == "yes") {
$Approved = "no";
}



Try changing it to this:
code:

// -------------------------
// Private Moderation - by JoshPet
if (($user['U_PrivateModeration'] == "yes") && ($Board =="keywordofboardhere")) {
$Approved = "no";
}



I think that'll do it.
Posted By: ksanuk Re: Private Moderation 1.0 - 12/13/2002 12:01 PM
Hi,

Thanks. Will give this a go.

Sanuk!
Posted By: JoshPet Re: Private Moderation 1.1 - 01/24/2003 3:50 AM
Updated the main post to version 1.1

Version 1.1 will block a user in Private Moderation from editing their profile.
Posted By: pootlecat Re: Private Moderation 1.1 - 01/24/2003 3:55 AM
This is an awesome idea for a mod!!!
Does anyone know if it works with 6.2?
Posted By: JoshPet Re: Private Moderation 1.1 - 01/24/2003 4:02 AM
Ah yes... sorry.

I forgot to update the text in the first post to indicate that this is for 6.2 and 6.2.1.

Enjoy!
Posted By: pootlecat Re: Private Moderation 1.1 - 01/24/2003 4:03 AM
Thanks - great news!!!
Posted By: pootlecat Re: [6.2] Private Moderation 1.1 - 01/26/2003 5:41 AM
Ok - I think I have a little problem
Made all the edits required and can see the new link when I edit a user.
The problem is that I don't think the username is getting passed on properly. I tried to put a user in Private Moderation and got the following PM:

"Webmaster has put into Private Moderation. All their posts will require approval."

Username missing I assume? Any help or suggestions would be great!

p.s. forgot to say that if you go back to edit that user again the option to put them into moderation is still there. It doesn't say click to remove them as I assume it should?
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 01/26/2003 7:57 AM
Hmmmm.....

In the moderateuser and unmoderateuser.php files.... try adding this below the require main.inc.php line near the top:

Code
<br />// -------------<br />// Get the input<br />   $Cat  = get_input("Cat","get");<br />   $User	= get_input("User","get");<br />


See if that solves it.
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 01/26/2003 7:57 AM
Let me know if it does, and I'll update the files.
Posted By: pootlecat Re: [6.2] Private Moderation 1.1 - 01/26/2003 5:27 PM
Thanks Josh - it is working perfectly now
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 01/26/2003 10:16 PM
OK - cool.... it has to do with Register Globals.

The fix I posted for the contact form will fix you too.

I will update the Zip on the first post.
Posted By: Wando Re: [6.2] Private Moderation 1.1 - 01/27/2003 3:57 PM
Is it possible to disable an 'on probation' members ability to pm during this period?
Posted By: pootlecat Re: [6.2] Private Moderation 1.1 - 01/27/2003 8:00 PM
That is a really good question!
I am also interested to know if it would be possible to stop them posting on the Shout Box (though i am probably asking too much there lol)
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 01/27/2003 8:22 PM
I will post some instructions to do that tonight.

Hmm.. have to check on the shoutbox. Not 100% sure how that works.... but I will check it out.
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 01/28/2003 8:17 AM
I haven't test this yet... .but this should disable the Private Message ability (sending) if they are in Private Moderation.

Please let me know how it works.
Code
 <br />OPTIONAL STEPS - To restrict the Sending of Private Messages: <br /> <br />########################## <br />## Open sendprivate.php ## <br />########################## <br /> <br />######################################## <br /># Find this: <br /># <br /> <br />   $user = $userob -> authenticate("U_TextCols,U_TextRows,U_Preview"); <br /> <br /> <br /> <br /># <br /># Change to this: <br /># <br /> <br />   $user = $userob -> authenticate("U_TextCols,U_TextRows,U_Preview,U_PrivateModeration"); <br /> <br />	// ----------------------------------- <br />	// Block if they are in Private Moderation <br />      if ($user['U_PrivateModeration'] == "yes") { <br />		   $html = new html; <br />	       $html -> not_right('You cannot send Private Messages while you are in Private Moderation.',$Cat); <br />	  } <br /> <br /> <br /> <br />########################### <br />## Open mess_handler.php ## <br />########################### <br /> <br />######################################## <br /># Find this: <br /># <br /> <br />   $user = $userob -> authenticate("U_Groups,U_EReplies,U_TextCols,U_TextRows,U_Preview"); <br />   $Username = $user['U_Username']; <br />   $Password = $user['U_Password']; <br /> <br /> <br /># <br /># Change to this: <br /># <br /> <br />   $user = $userob -> authenticate("U_Groups,U_EReplies,U_TextCols,U_TextRows,U_Preview,U_PrivateModeration"); <br />   $Username = $user['U_Username']; <br />   $Password = $user['U_Password']; <br /> <br />	// ----------------------------------- <br />	// Block if they are in Private Moderation <br />      if ($user['U_PrivateModeration'] == "yes") { <br />		   $html = new html; <br />	       $html -> not_right('You cannot send Private Messages while you are in Private Moderation.',$Cat); <br />	  } <br />
Posted By: pootlecat Re: [6.2] Private Moderation 1.1 - 01/28/2003 9:02 PM
Hi Josh

The sendprivate.php part works perfectly but not the mess_handler.php bit.

I get the following error message:

"SQL ERROR: Tue, Jan 28 2003 12:11:45 -0700 Database error only visible to forum administrators

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites/site2/web/neohelp/mysql.inc.php on line 130"

Thanks
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 01/28/2003 9:10 PM
Ah I made a typo

U_PrivateModeraton

Should be:

U_PrivateModeration



It was late. I need sleep.

I will fix my post above.
Posted By: pootlecat Re: [6.2] Private Moderation 1.1 - 01/28/2003 9:11 PM
Thanks lol - should have spotted that myself
Posted By: jluerken Re: [6.2] Private Moderation 1.1 - 02/14/2003 9:40 PM
One more question Josh.

I added this hack and its working fine but how do I know as admin that a user has posted a new thread which needs to be approved?

In the adminmenu I see it only If I choose - APPROVE POSTS and then the right forum. But how to know?

Kind regards...
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 02/15/2003 2:27 AM
If you are using "Full new post tracking" in your config file... then on the main index, you'll see a number of posts with a N/A (for Not Approved) next to it. Like this:

(3 N/A) would be 3 non approved posts.

Also.... the unapproved posts will have (N/A) in the title.

You can also approve them by clicking edit next to the post.
Posted By: dgermann Re: [6.2] Private Moderation 1.1 - 02/21/2003 4:12 AM
Josh--

Would this work with 5.4.4php?
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 02/21/2003 4:30 AM
Probably not. As it's based on user numbers..... and 5.4.4 was username based.

You might try the version that's posted somewhere here for the 6.0 series. But I'm not too familiar with that early a version anymore to know if it would work.
Posted By: dgermann Re: [6.2] Private Moderation 1.1 - 02/21/2003 6:12 PM
Thanks, Josh!
Posted By: Daemon_dup1 Re: [6.2] Private Moderation 1.1 - 02/23/2003 4:52 AM
Hey, Just installed this hack and get the following error when trying to put a user in moderation:

Parse error: parse error in /var/www/vodatones.com/html/ubb/admin/moderateuser.php on line 28

Also there's a file called ".DS_Store" in the zip file. There's no referance to this file in the instructions, what do I do with it? Is this whats causing the problem?
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 02/23/2003 4:58 AM
Don't know what the DS_Store file is... perhaps it was somethign your systm created when you unzipped?

Don't know about the error either. That's right at the begining of the code. Make sure that you uploaded the scripts in ASCII mode....otherwise they'll get corrupted.
Posted By: Daemon_dup1 Re: [6.2] Private Moderation 1.1 - 02/23/2003 5:01 AM
Great, lol
Just re-uploaded the files and it's still happening. I have cuteFTP in auto detect mode for uploading which has NEVER cuased a problem si it cnt be that.
Any chance you can have a look? your admin on my board and also have FTP access.
I'd appreciate it.
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 02/23/2003 5:15 AM
Reuploaded in text (ASCII) mode and it works fine. Best to use ASCII or TEXT rather than automatic when uploading scripts to prevent corruption.
Posted By: Daemon_dup1 Re: [6.2] Private Moderation 1.1 - 02/23/2003 5:17 AM
Ok thanks very much....I'll send you that cape as soon as paypal do deliveries lol

Thats a first though, i've NEVER had to do that before.

Cheers m8, once again lightning support
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 02/23/2003 5:20 AM
OR - since you had that wierd file in the zip... I wonder if something got corrupt either during download from here.... or during uncompression on your end. Anything is possible.... but the parse error was at the very first line of code in the file... so most likely the file that was there had some bizarre characters in it.
Posted By: Daemon_dup1 Re: [6.2] Private Moderation 1.1 - 02/23/2003 5:22 AM
yea weird ehhh, thanks though
Posted By: JoshPet Re: [6.2] Private Moderation 1.3 - 02/26/2003 2:20 AM
Updated to version 1.3.

Version 1.3 adds the functionality to be able to search and find users who are in private moderation. Thanks to Raconteur for this addition.
Posted By: Lisa_P Re: [6.2] Private Moderation 1.1 - 02/26/2003 7:57 AM
[]Don't know what the DS_Store file is... [/]

I get this in every one of your zips Josh. Even the stylesheet zips. I don't get them in anything else though. I just ignore it. Everything else has been fine, just an extra little file.
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 02/26/2003 8:07 AM
Maybe it's because I zip them on my Mac?
Posted By: Lisa_P Re: [6.2] Private Moderation 1.1 - 02/26/2003 8:14 AM
It's possible - but they didn't used to do it. I only noticed the new file within the last couple weeks or so. When I try to view it, it's obviously not something that can be viewed with just a text editor. I try to view it in WinRAR and I can make out a few words, but the rest is just "|" and a few other characters. The words I can make out are always relevant to whatever the hack is, so it's not just an odd file that is added on.
Posted By: smilesforu Re: [6.2] Private Moderation 1.1 - 02/26/2003 11:21 AM
Josh got a list of what changed in the upgrade? Just broke out beyond compare and can see its all on the end of the post. Off to upgrade
Posted By: dimopoulos Re: [6.2] Private Moderation 1.1 - 02/26/2003 11:34 AM
Yes Josh, the .DStore file comes from the zipper of Macintosh.
Posted By: smilesforu Re: [6.2] Private Moderation 1.1 - 02/28/2003 12:18 PM
I added a member to private moderation and it stopped me from sending private messages also. Mind lookin at sendprivate.php.

I removed the file and put the original back and it didn't stop me which is to be expected.

Ok somehow I got myself in private moderation along with my other admin user name... now wonder it stopped me. I look at my Edit users feature and it doesn't allow me to unprivate mod myself.. grr.
Posted By: smilesforu Re: [6.2] Private Moderation 1.1 - 03/02/2003 10:44 AM
Ok got rid of my private mod settings on myself by copying shortcut on a moderated user and changing the number to mine
Posted By: Deejay_dup1 Re: [6.2] Private Moderation 1.1 - 03/29/2003 7:59 AM
[]JoshPet said:
Hmmmm.....

In the moderateuser and unmoderateuser.php files.... try adding this below the require main.inc.php line near the top:

Code
<br />// -------------<br />// Get the input<br />   $Cat  = get_input("Cat","get");<br />   $User	= get_input("User","get");<br />


See if that solves it. [/]

Im getting an error on this line now!!!

Fatal error: Call to undefined function: get_input() in /home/httpd/html/4x4/forum/admin/moderateuser.php on line 28

Any idea what I should do?
Posted By: Dave_L_dup1 Re: [6.2] Private Moderation 1.1 - 03/29/2003 12:31 PM
[]Fatal error: Call to undefined function: get_input()[/]

What's your UBB.threads version?
Posted By: Deejay_dup1 Re: [6.2] Private Moderation 1.1 - 04/01/2003 7:09 AM
I figured its a version thing, im running 6.1.1 so I took some of the stuff out, edited this and that, and got it going... A little different, but i got it going...

Works great though! THANKS!

Deej
Posted By: JoshPet Re: [6.2] Private Moderation 1.1 - 04/06/2003 4:26 PM
Yeah,

The get_input function isn't used in versions before 6.2 so it's not needed.
Posted By: Lisa_P Re: Private Moderation 1.0 - 04/19/2003 11:53 PM
[]As an alternative to approving user registrations.. you could set it up that New Users are in the Private Moderation for their first X posts...or until the Admin "approves" them for live posting[/]

Have you done this? I would like to do this - is it pretty 'change intensive', or not really that much to change?
Posted By: JoshPet Re: Private Moderation 1.0 - 04/24/2003 6:38 PM
Sorry, I missed replying to this for a few days.

If you are running my private moderation mod.... what I would first do is change the database so that new users are in Private Moderation by default. The easiest way to do this, is to alter the default in the database:

ALTER TABLE w3t_Users
CHANGE U_PrivateModeration U_PrivateModeration CHAR(3) DEFAULT 'yes'


Then as you see new posters in moderation.... if they seem OK - click their username and remove them from private moderation.

You might also want to alter the welcome PM so that it tells people that "all new users posts are moderated during a probation period. When the moderators deem fit, you will be removed from moderation and can post live." Something like that.

Then of course if you needed to put someone back into private moderation, you could do so.

Then if you needed something to display a list of who was in private moderation.... and had x number of posts and had been registered for at least x days, then you could review the list and turn people on if you wanted.

OR.. you could alter addpost.php so that if their post count was = 10 or whatever, it updated U_PrivateModeration = 'no' thus turned them off at post 10.

It could be expanded in quite a useful way.
Posted By: Rutto Re: Private Moderation 1.0 - 11/08/2003 7:06 PM
Hi Josh, is this hack compatible with 6.4b1 ?
Posted By: JoshPet Re: Private Moderation 1.0 - 11/08/2003 7:12 PM
It should be. I know I've used it on 6.3.x. So should be fine. Might need to alter the instructions a bit, but should be no problems.
Posted By: smilesforu Re: Private Moderation 1.0 - 11/11/2003 5:32 AM
I got this running on 6.4 and working.
Posted By: ZealotOnAStick_dup1 Re: [6.2] Private Moderation 1.1 - 12/13/2003 9:26 AM
Will this work with 6.4? Or is there similar functionality for this built into 6.4?
Posted By: smilesforu Re: [6.2] Private Moderation 1.1 - 12/13/2003 10:35 AM
I used this mod with some beyond compare work and it works fine
Posted By: Rutto Re: [6.2] Private Moderation 1.1 - 12/15/2003 10:43 PM
[]ZealotOnAStick said:
Will this work with 6.4? Or is there similar functionality for this built into 6.4? [/]

I tried it with 6.4 b1 and works fine !
Posted By: AKD96 Re: [6.2] Private Moderation 1.1 - 11/04/2004 4:10 PM
Is anyone planning to update this for 6.5? I found it to be a very useful feature. I am taking a look at it, but the admin files have been redesigned for 6.5, which makes it more difficult to update.
Posted By: AKD96 Re: [6.2] Private Moderation 1.1 - 11/16/2004 2:16 PM
Am I the only one that appreciates this fine modification of JoshPet's? I have looked into updating it, but it seems a bunch of stuff has been moved around into different files which I can't locate. Maybe someone out there is fluent in the 6.5 code enough to know where?
Posted By: pootlecat Re: [6.2] Private Moderation 1.1 - 02/06/2005 12:15 PM
I desperately need this mod for 6.5 lol - too many 13 year old kids on my board who think bumping posts is the way to go *sigh*.
Pleaaaaaaase can you update it Josh?
© UBB.Developers