[ABD] Approve 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.
Locked
conanqtran
Registered User
Posts: 308
Joined: Tue Mar 26, 2002 4:19 am
Contact:

Post by conanqtran »

i was talking about the fixes for the mod, provided that you install the mod correctly, then you can follow the above instruction to fix some existing bugs :wink:
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

update coming soon.. (i'm moving, working on a big project, and remodelling the place i'm moving to... so i'll try to get this done ASAP.)

new issues to be addressed: (and thanks to those who contributed thus far!)

admin panel (for posts, users, topics)
polls
quotes
moderator add/remove box will make those users moderators, as well as recieve notificaitons
search
any other areas where the post may show up prior to approval (excluding portal/news mods)


ETA: 1-2weeks
User avatar
Menace
Registered User
Posts: 25
Joined: Sun Mar 09, 2003 4:55 pm

Post by Menace »

Aceman,

Looking forward to the new version!!!!!!

Luigicanova,

This bit:
#
#-----[ SQL ]------------------------------------------
#
DROP TABLE IF EXISTS phpbb_approve_forums;
CREATE TABLE phpbb_approve_forums (
forum_id smallint(5) unsigned NOT NULL default '0',
enabled tinyint(1) NOT NULL default '0',
approve_posts tinyint(1) NOT NULL default '0',
approve_topics tinyint(1) NOT NULL default '0',
approve_users tinyint(1) NOT NULL default '0',
approve_poste tinyint(1) NOT NULL default '0',
approve_topice tinyint(1) NOT NULL default '0',
approve_notify tinyint(1) NOT NULL default '0',
approve_notify_approval tinyint(1) NOT NULL default '0',
approve_notify_type tinyint(1) NOT NULL default '0',
approve_notify_message tinyint(1) NOT NULL default '0',
approve_notify_message_len smallint(5) NOT NULL default '500',
approve_notify_user varchar(255) NOT NULL default '0',
approve_notify_posts tinyint(1) NOT NULL default '0',
approve_notify_poste tinyint(1) NOT NULL default '0',
approve_notify_topics tinyint(1) NOT NULL default '0',
approve_notify_topice tinyint(1) NOT NULL default '0',
PRIMARY KEY (forum_id)
) TYPE=MyISAM;

DROP TABLE IF EXISTS phpbb_approve_posts;
CREATE TABLE phpbb_approve_posts (
approval_id mediumint( unsigned NOT NULL auto_increment,
topic_id mediumint( unsigned NOT NULL default '0',
post_id mediumint( unsigned NOT NULL default '0',
is_topic tinyint(1) NOT NULL default '0',
is_post tinyint(1) NOT NULL default '0',
poster_id mediumint( NOT NULL default '0',
PRIMARY KEY (approval_id),
KEY post_id (post_id),
KEY topic_id (topic_id)
) TYPE=MyISAM;

DROP TABLE IF EXISTS phpbb_approve_topics;
CREATE TABLE phpbb_approve_topics (
topic_id mediumint( unsigned NOT NULL default '0',
approve_moderate tinyint(1) NOT NULL default '0',
PRIMARY KEY (topic_id)
) TYPE=MyISAM;

DROP TABLE IF EXISTS phpbb_approve_users;
CREATE TABLE phpbb_approve_users (
user_id mediumint( NOT NULL default '0',
approve_moderate tinyint(1) NOT NULL default '0',
PRIMARY KEY (user_id)
) TYPE=MyISAM;


are all (My)SQL commands. Copy and paste each paragraph to the command line and press enter. It will drop and create all necessary tables for the mod.

If you cannot copy and paste chunks then you need to type in line by line. When in (My)SQL, it will not execute the commands until it finds the " ; "-sign at the end of each chunk. Good luck!

Markus,
I will re-check the poll-situation.

Dennis the.....
waldopepper
Registered User
Posts: 7
Joined: Mon Apr 07, 2003 10:39 pm

approve mod bug

Post by waldopepper »

When the sig block of the person (aka admin sig block) that receives the email for approval has an apostrophe '
the program yields:
Parse error: parse error in /pathto/includes/emailer.php(150) : eval()'d code on line 11
that line is
eval("\$this->msg = '$this->msg';");
plus error messages about sending headers out after output has begun.

the email has \\' instead of '

thank you.
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

rgr, will address that as well..

i've addressed everything on the main page so far, thanx to all who've contrib'd

i've finished the 'user-admin' section of the admin panel, and am now working on the post & topic admin panels, as well as the 'portal-ish' approve admin index..

suggestions/features for the admin page welcome
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

AceMan, I installed your excellent mod, and in testing I noted that when a user submits a new thread, on the forum index it shows that there is a topic awaiting approval and it shows the user's name and date of submission. That would allow someone to get a message across by way of their choice of username (even if not a registered user and just posting anonymously). Is there a way so that nothing appears on the forum whatsoever until the moderator approves the post? In other words, so that there's no indication to anyone else that there are messages awaiting approval by the moderator? If not, then is that something you would consider adding? Thanks.
User avatar
rit
Registered User
Posts: 28
Joined: Thu Apr 03, 2003 11:23 am

Post by rit »

@luigicanova:

i think it is ok, if you could see that user "xyz" has posted a new message on the board. with the new version (or some of my patches) you could prevent, that the original post is displayed (via search messages by user, quote a message). if you contact that user privately via mail and ask him what he has written, it is all your "private" thing. as long as that post is not displayed to the public, it's ok for me.

if i can see, that there is a post waiting for approval, i know that there was an answer. so i will come back. that's good.

ok, one problem, what if the moderator deletes the post, because it couldn't be published (against the board rules, against the law, bad language etc). then i - as a normal visitor - knew that there was a post from user "xyz", but when i come back to the forum this post is gone.

maybe it would be possible, to have a setting in the admin panel to adjust the way aapprove mod is working (displayes waiting approval hint or hides the message completly). in the viewtopic.php it would be very easy to insert a "break" to skip waiting posts. but i think it is a hard task to hide this post on all other places (viewforum - counters, new posts, last post, unanswered posts, search etc. )

markus
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

Hi, Markus -

The problem is abuse by people who sneak in obscenities & nastiness by way of the username(s) they submit their posts under, whether they actually register with the forum or not. For example, votf.org had a lot of similar problems with their message board (which did not utilize this mod).

There are much simpler message board scripts out there that do work that way: nothing at all appears on the public forum to indicate that there are any messages waiting in the queue for approval (such as WebBBS). So it's just kind of surprising that phpBB doesn't offer the same kind of feature (in its out-of-the package configuration or as modified) that would give a moderator total control over what appears (and doesn't) in any part of the message board forum, at any time.

Lou
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

issue addressed..
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

CHECK FIRST POST FOR:
ApproveMod v3.0.0b3 built on phpBB 2.0.4 !!!



I really need you guys to test the new admin panel EXTENSIVELY. Please push this system as hard as you can while I've got the time to work on it.

I am definately releasing it before the end of the month, complete w/ all features or not.
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

Glitch detected regarding the anonymous guest's choice of name appearing. AceMan said:
issue addressed..


True, on the main message forum page, in the "Last Post" column it indicates that there is a new post (which is awaiting approval) by "Guest". And when you go to the actual thread, again it shows only "Guest" for the message that is awaiting approval.

But in-between is where the problem is, after you click from the main index page to visit the specific forum, but before you click to view the topic thread where the new post is: When you click to enter that specific forum and are looking at the index of the topics, in the "Last Post" column you can still see the unregistered guest's choice of name, whether it be "YOU'RE A MF" or whatever vile title they have chosen.
Last edited by luigicanova on Thu Apr 17, 2003 2:56 pm, edited 1 time in total.
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

Plus, and I'm not saying this is a negative thing (just wanted everyone to be aware of it), I just noticed that the new mod has affected the main forum index page with respect to all previous messages posted by unregistered users.

If an unregistered user was the "Last Post" in a given forum, their chosen username no longer appears on the forum index page, but does still appear (a) on the specific forum index page (the list of thread topics), and (b) in the individual thread.

Of course, I want anonymous posters to be able to choose their own non-objectionable monickers, and wouldn't want every such person's post to appear as being posted by "Guest", but I did want everyone to be aware that, at least with prior existing posts, their names will appear merely as "Guest" on the main forum index page - but nowhere else.

I'm assuming that from this point on, whenever an unregistered user posts a message which I approve, the same circumstances will apply. I will test it out to confirm that that is in fact the case.
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

Another problem, now when going into Edit Forum to configure "Approve Posts":
Could not insert forum approval information

DEBUG MODE

SQL Error : 1054 Unknown column 'approve_moderators' in 'field list'

INSERT INTO phpbb_approve_forums (forum_id, enabled, approve_posts, approve_topics, approve_users, approve_poste, approve_topice, approve_notify, approve_notify_type, approve_notify_message, approve_notify_message_len, approve_moderators, approve_notify_posts, approve_notify_poste, approve_notify_topics, approve_notify_topice, approve_notify_approval) VALUES ('3', '1', '1', '1', '1', '1', '1', '1', '-1', '1', '200', '2', '1', '1', '1', '1', '0')

Line : 611
File : /home/MYACCOUNT/MYFORUMURL/admin/admin_forums.php

AACKKK!!!!!!
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

sorry, have to update your SQL tables, the structure changed only slightly.

#
#----[ SQL ] -----------
#

ALTER TABLE `phpbb_approve_forums` CHANGE `approve_notify_user` `approve_moderators` VARCHAR(255) NOT NULL




regarding the 'viewforum.php', last post author (in topics list)
this line was added for that purpose
$last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? $lang['Guest'] : $last_post_author;


if you don't see that line in youf viewforum.php, then that's why, if you do see it, make sure you're not logged in as an admin, or moderator, or any user designated in the 'moderator(s)' list in the edit forum page.
Last edited by AceMan on Thu Apr 17, 2003 7:30 pm, edited 2 times in total.
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

as to index guests always showing as guest:
find:

Code: Select all

//
// Begin Approve_Mod
//
							$approve_mod = array();
							$approve_sql = "SELECT * FROM " . APPROVE_FORUMS_TABLE . " WHERE forum_id = '" . $forum_data[$j]['forum_id'] . "' LIMIT 0,1"; 
							if ( !($approve_result = $db->sql_query($approve_sql)) ) 
							{ 
								message_die(GENERAL_ERROR, $lang['approve_posts_error_obtain'], '', __LINE__, __FILE__, $approve_sql); 
							} 
							if ( $approve_row = $db->sql_fetchrow($approve_result) ) 
							{    
								if ( intval($approve_row['enabled']) == 1 )
								{
									$approve_mod = $approve_row;
									$approve_mod['enabled'] = true;
								}
							}
							$approve_mod['moderators'] = array();
							$approve_mod['moderators'] = explode("|", $approve_mod['approve_moderators']);
							if ( $approve_mod['enabled'] && !in_array($userdata['user_id'], $approve_mod['moderators']) && !$is_auth_ary[$forum_id]['auth_mod'])
							{
								if( $last_post != $lang['No_Posts'] && $forum_data[$j]['user_id'] == ANONYMOUS )
								{
									$last_post = $last_post_time . '<br />';
									$last_post .= $lang['Guest'] . '  ' . '<a href="' . append_sid("viewforum.$phpEx?"  . POST_FORUM_URL . '=' . $forum_data[$j]['forum_id']) . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
								}
							}
//
// End Approve_Mod
//
replace with:

Code: Select all

//
// Begin Approve_Mod
//
							$approve_mod = array();
							$approve_sql = "SELECT enabled, approve_moderators FROM " . APPROVE_FORUMS_TABLE . " WHERE forum_id = '" . $forum_data[$j]['forum_id'] . "' LIMIT 0,1"; 
							if ( !($approve_result = $db->sql_query($approve_sql)) ) 
							{ 
								message_die(GENERAL_ERROR, $lang['approve_posts_error_obtain'], '', __LINE__, __FILE__, $approve_sql); 
							} 
							if ( $approve_row = $db->sql_fetchrow($approve_result) ) 
							{    
								if ( intval($approve_row['enabled']) == 1 )
								{
									$approve_mod = $approve_row;
									$approve_mod['enabled'] = true;
								}
							}
							if ( $approve_mod['enabled'] )
							{
								$approve_mod['moderators'] = array();
								$approve_mod['moderators'] = explode("|", $approve_mod['approve_moderators']);
								if ( !in_array($userdata['user_id'], $approve_mod['moderators']) && !$is_auth_ary[$forum_id]['auth_mod'] && $last_post != $lang['No_Posts'] && $forum_data[$j]['user_id'] == ANONYMOUS )
								{
									$approve_sql = "SELECT * FROM " . APPROVE_POSTS_TABLE . " WHERE post_id = " . intval($forum_data[$j]['forum_last_post_id']) . " LIMIT 0,1"; 
									if ( !$approve_result = $db->sql_query($approve_sql) ) 
									{ 
										message_die(GENERAL_ERROR, $lang['approve_posts_error_obtain'], '', __LINE__, __FILE__, $approve_sql); 
									}	
									$approve_row = $db->sql_fetchrow($approve_result);
									if( intval($approve_row['post_id']) == intval($forum_data[$j]['forum_last_post_id']) )
									{
										$last_post = $last_post_time . '<br />';
										$last_post .= $lang['Guest'] . '  ' . '<a href="' . append_sid("viewforum.$phpEx?"  . POST_FORUM_URL . '=' . $forum_data[$j]['forum_id']) . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
									}
								}
							}
//
// End Approve_Mod
//
**EDIT** i forgot to fetchrow... :)
Last edited by AceMan on Thu Apr 17, 2003 7:42 pm, edited 1 time in total.
Locked

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