[MODDB] Approval MOD

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
gr82bart
Registered User
Posts: 29
Joined: Sat Apr 30, 2005 12:51 pm

Post by gr82bart » Wed Sep 06, 2006 1:32 am

uncle.f wrote: Have you ever used phpMyAdmin before?
You're giving me a lot of credit with that question. LOL! That would be "no".
You need to execute SQL queries directly on your SQL database. :-)
phpMyAdmin is the best for this purpose.
Sure. Again, I'll take your word for it. Went to their website and will download this program. Need to read up on it though.

And, I have no clue what to do still.... 8O

Regards, Art.

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Wed Sep 06, 2006 5:06 am

Ok, forget the phpMyAdmin.
It is a bit too much to install that just to execute 3 SQL queries ;-)

I have a little script for you that will do the needed task. Create a new text file directly under the root of phpBB, in the same directory where the you see common.php, faq.php, login.php, etc. Name that file sql.php, for example.

Copy this code into the file:

Code: Select all

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

$sql = "UPDATE " . TOPICS_TABLE . " SET
        topic_last_post_approved = topic_last_post_id,
        topic_approve = 0,
        topic_replies_unapproved = 0";

if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Error updating topics table', '', __LINE__, __FILE__, $sql);
}

$sql = "UPDATE " . FORUMS_TABLE . " SET
        forum_last_post_approved = forum_last_post_id,
        forum_posts_unapproved = 0,
        forum_topics_unapproved = 0,
        forum_approve = 0";

if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Error updating forums table', '', __LINE__, __FILE__, $sql);
}

$sql = "UPDATE " . POSTS_TABLE . " SET post_approve = 0";

if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Error updating posts table', '', __LINE__, __FILE__, $sql);
}

message_die(GENERAL_MESSAGE, 'All OK!');

?>
Now in your browser open that newly created page:

http://yourhost/path_to_phpbb/sql.php

You should see the OK message if everything went fine.
Delete that sql.php file immediately afterwards!

Now you should have the approval status for all of your forums/topics/posts reset to "none". You have to configure the approval settings again in the Admin CP.

After that everything should hopefully work as designed.

Good luck!

sobewebmaster
Registered User
Posts: 119
Joined: Sun Oct 02, 2005 1:19 am

Post by sobewebmaster » Thu Sep 07, 2006 12:11 am

Might I ask about users that can be set by admin for ALL of their posts to be approved if marked via User Management. A site I am admin for(Uses custom coding from Unified(not released to public)) uses a "TU" system, which is marked as "Troublesome User". And when someone is marked by an admin as a TU, all posts must await moderation before the, "This post must be moderated by a staff member before being shown publically" goes away.

And if a forum had that, it would be great, as this seems a lot simpler than the older Approve/Post Control mod that was abandoned. But that one DID work extremely well to my liking. It also included the single user approval which I wish to request for this.
Tech Nominal, A new generation of tech support

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Thu Sep 07, 2006 12:51 am

sobewebmaster wrote: a "TU" system, which is marked as "Troublesome User". And when someone is marked by an admin as a TU, all posts must await moderation


And how exactly is a user marked as TU in your system? Is this a special group that you put the user into?

gr82bart
Registered User
Posts: 29
Joined: Sat Apr 30, 2005 12:51 pm

Post by gr82bart » Thu Sep 07, 2006 2:38 am

uncle.f wrote: After that everything should hopefully work as designed.
All's still not well. OK You solved the first problem (I can see the old posts), but now I see all my new posts (as just some user) even though I checked off in the forum management area (as an admin) that I want them approved first.

Oiy!

Regards, Art.

gr82bart
Registered User
Posts: 29
Joined: Sat Apr 30, 2005 12:51 pm

Post by gr82bart » Thu Sep 07, 2006 3:12 am

Oops. Nevermind. I'm reading the post as the poster! I can't read it when I'm someone else. Everything's fine now.

Thanks very much for this MOD and all your help!

Regards, Art.

sobewebmaster
Registered User
Posts: 119
Joined: Sun Oct 02, 2005 1:19 am

Post by sobewebmaster » Thu Sep 07, 2006 3:16 am

uncle.f wrote:
sobewebmaster wrote:a "TU" system, which is marked as "Troublesome User". And when someone is marked by an admin as a TU, all posts must await moderation


And how exactly is a user marked as TU in your system? Is this a special group that you put the user into?


It's not my system, it's one Garner(owner of the site) coded, he is a programmer. Anyway, you can see a great example in the Approve Mod.

http://www.phpbb.com/phpBB/viewtopic.php?t=76852

It works great, even with the latest phpBB, however, your version seems a little "lighter", instead of having all the extras not needed in that version. That is why I am asking here. Anyway, it's not an extra group you create, it's simply a mark on a user. That's what I liked about the Approve Mod, it allowed the same exact thing I am talking about from levels4you.com with the TU system.
Tech Nominal, A new generation of tech support

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Thu Sep 07, 2006 9:50 am

sobewebmaster wrote: It works great, even with the latest phpBB, however, your version seems a little "lighter"


My version is most definitely MUCH lighter (and I am proud of it :lol: ). That was the whole point why I started designing it. In comparison to the abandoned Approve MOD it puts SIGNIFICANTLY less strain on the SQL server. It only contains 2 additional SQL queries compared to the standard phpBB install (and those are only used when the new post is made or the post is deleted). Compare that to the abandoned Approve MOD... If you had a huge forum with that MOD installed you would probably notice that it is "not so effective" :-)
sobewebmaster wrote: Anyway, it's not an extra group you create, it's simply a mark on a user.


I still don't follow. What is the essence of that "mark" on the user. Is it something that purely belongs to Appove MOD and is a part of it, or is that "mark" a part of another modification, that you mention in you previous post when you talk about "Troublesome Users"?

Anyhow, after thinking about this functionality I cannot imagine how it could be done without building a new Admin CP for Approval. Right now you do not need that because all approval options can be set per forum from the Forum Administration page. If you want to have new user attribute, you need to manage it from somewhere in a centralized way. So, basically, what I am trying to say, it is too much work for me at the moment. As the information given in the first post of this topic states "Most likely I won't implement any new features that require significant code changes or additions." I can only add: unless a lot of people ask for it. Sorry.

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Thu Sep 07, 2006 9:52 am

gr82bart wrote: Oops. Nevermind. I'm reading the post as the poster! I can't read it when I'm someone else. Everything's fine now.


Yeah, I need to add this info into the readme.txt and to the first post of this topic. Thanks for reminding :-)

Glad it worked for you. I am packaging RC3 now with the SQL changes and some code optimization, which hopefully will become the released version.

sobewebmaster
Registered User
Posts: 119
Joined: Sun Oct 02, 2005 1:19 am

Post by sobewebmaster » Thu Sep 07, 2006 5:08 pm

I mean if you go into the User Management in the AdminCP and choose someone's name, say, sobe, and at the bottom there is a checkbox that states, "Mark as Troublesome User". And if that box becomes checked, then every post that user makes, cannot be shown to public, and states that the post must be moderated. And, as in the Approval Mod, it had a overview, of how many topics, what topics, how many users, and what users had posts waiting to be approved.

This is the easiest way I can explain this. And yes, I like your version since it's lighter. However, that feature is what I am namely looking for, rather than marking forums as needing to be moderated.
AceMan wrote: You alternately can choose to moderate only selected users & topics

/\
Hope this helps if you didn't understand the above.
Tech Nominal, A new generation of tech support

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Thu Sep 07, 2006 5:21 pm

sobewebmaster wrote: I mean if you go into the User Management in the AdminCP and choose someone's name, say, sobe, and at the bottom there is a checkbox that states, "Mark as Troublesome User". And if that box becomes checked, then every post that user makes, cannot be shown to public, and states that the post must be moderated.


This could be done without building a new interface from scratch. I need to think about it. It won't be in version 1.0.0 though.
sobewebmaster wrote: And, as in the Approval Mod, it had a overview, of how many topics, what topics, how many users, and what users had posts waiting to be approved.


This requires brand new Approval Control Panel as well as complete MOD redesign (new database fields and even tables, perhaps). At the moment I have no time for this development. Sorry. The situation may change in the future but as it stands now - I won't do it.

sobewebmaster
Registered User
Posts: 119
Joined: Sun Oct 02, 2005 1:19 am

Post by sobewebmaster » Thu Sep 07, 2006 7:22 pm

Thank you for looking over this. Hopefully in the future versions you can include the single user post approval.

I'll be watching this mod ^_^
Tech Nominal, A new generation of tech support

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Mon Sep 11, 2006 7:44 am

New RC is up.
See the first post for the list of changes.

gr82bart
Registered User
Posts: 29
Joined: Sat Apr 30, 2005 12:51 pm

Post by gr82bart » Mon Sep 11, 2006 2:49 pm

Hey!

So now with all these bug fixes, how can I install the latest 'version' when I already have RC1 installed?

Thanks, Art.

User avatar
uncle.f
Registered User
Posts: 253
Joined: Thu Mar 25, 2004 11:42 am
Location: Purple Yonder
Contact:

Post by uncle.f » Mon Sep 11, 2006 2:58 pm

The best way is scratch install.

Alternatively, (if you used EasyMOD) you can restore all the modified files which should be located in the "mods/approval_mod/backups" directory and then reapply the latest version of Approval MOD. That will only work if you did not install any MODs after the Approval MOD.

Do not worry about SQL errors during MOD installation (that means the SQL table fields already exist in your database).

Locked

Return to “[2.0.x] MODs in Development”