[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.
kenji
Registered User
Posts: 40
Joined: Thu Oct 10, 2002 7:48 am

Post by kenji »

great. mine was in japanese.. waiting for a fren of mine to translate it. :P
this mod is really good.

waiting for the final release from Aceman. :)

thanks
Kenji
meekaaku
Registered User
Posts: 2
Joined: Fri Mar 14, 2003 9:28 pm

getting error with this mod

Post by meekaaku »

I have installed this mod in a test forum.
it works great, but i get the following error when i submit a new post.

Fatal error: Cannot redeclare class emailer in /path/to/forum/includes/emailer.php on line 28


but the written post is actually available for moderation.

basically.. everythign works. but this error comes and stops there, have to use browsers back button to go to forum.

any hints?

thanks in advance

meekaaku[/b]
meekaaku
Registered User
Posts: 2
Joined: Fri Mar 14, 2003 9:28 pm

Re: getting error with this mod

Post by meekaaku »

meekaaku wrote: I have installed this mod in a test forum.
it works great, but i get the following error when i submit a new post.

Fatal error: Cannot redeclare class emailer in /path/to/forum/includes/emailer.php on line 28

any hints?

thanks in advance


the error doesnt occur if i use PM notification instead of email

and also i dont see the Approval section in the Administration panel
is it something to do with a tpl file?
AceMan
Registered User
Posts: 337
Joined: Thu Nov 15, 2001 6:47 am
Contact:

Post by AceMan »

hrm.. okay will fix, will release mod w/o admin panel for now.

anyone interested in writing the admin panel?
User avatar
Menace
Registered User
Posts: 25
Joined: Sun Mar 09, 2003 4:55 pm

Post by Menace »

Aceman,

thanks for the description about how to "activate" it (see earlier posts in this thread). Perhaps it's an idea to include these in your txt file, or include a readme...

I've tested it to some extent and will test it some further once I've managed to get the translations working (dutch).

I see there's already a growing base of supported languages... Perhaps combine it in a language pack? :wink:

Cheers! A lovely MOD by the way. Seems to work like a charm! Thanks sooooo much Aceman.

Dennis the ..... :wink:
User avatar
anor
Registered User
Posts: 48
Joined: Mon Apr 29, 2002 11:18 pm
Location: The Netherlands

Post by anor »

Well sorry too say i have expierenced 2 problems with this mod, i am unable to remove a member from auto accept there post, (link doesn't change when i auto approve him to remove from auto approve), and i cannot remove a moderated user.
waldopepper
Registered User
Posts: 7
Joined: Mon Apr 07, 2003 10:39 pm

Re: [BETA] Approve Mod

Post by waldopepper »

AceMan wrote: THE FASTER THIS MOD GETS BETA TESTED FOR ALL BUGS THE FASTER I CAN SUBMIT IT! :P


Great mod It is EXACTLY what my client wants.

Minor point: Your HTML is not XHTML
ie you have <br> and not <br />

One thing I found difficult from a user standpoint (keep in mind that the approver guy is NOT a computer guru)
is that the email he gets does not have the post text.
It just has a link to approve. What he really needs is the text of the post in that email and links to approve or disapprove - separated my white space.

What happens on disapproval?? Is the message deleted?

Also the links that the admin sees that say 'post waiting approval' or whatever it said would stand out more in red or a contrasting color with whatever scheme you have.

hopes this helps.
Tobi
Registered User
Posts: 48
Joined: Sun Dec 30, 2001 11:44 pm
Location: Germany
Contact:

Post by Tobi »

Hi,
anor wrote: Well sorry too say i have expierenced 2 problems with this mod, i am unable to remove a member from auto accept there post, (link doesn't change when i auto approve him to remove from auto approve), and i cannot remove a moderated user.


That is, what makes it work for me:

Search in viewtopic.php for:

Code: Select all

$approve_sql = "SELECT * FROM " . APPROVE_USERS_TABLE . " WHERE user_id = '" . $approve_mod['poster_id'] . "' AND approve_moderate = '-1' LIMIT 0,1";
Replace with:

Code: Select all

$approve_sql = "SELECT * FROM " . APPROVE_USERS_TABLE . " WHERE user_id = '" . $poster_id . "' AND approve_moderate = '-1' LIMIT 0,1";
Tobi
User avatar
rit
Registered User
Posts: 28
Joined: Thu Apr 03, 2003 11:23 am

patch for approve mod: solved quote problem...

Post by rit »

we have included the approve mod in our phpBB-installation as post approval was one of our "must-have-functions" to use this forum.

there was a problem with the quote-function. when a post waits for approval and a normal user clicks the quote-button he/she could see the orignal post - although this post has not been approved.

i have made a patch for the approve_mod, no qouting doesn't work.

Code: Select all

############################################################## 
## MOD Title: Approve Mod 
## MOD Author: Aceman < phpbbmods@synace.com > (Mike Dawidowicz) http://www.synace.com 
## MOD Description: Designate a forum for moderation by mods/admins. 
##   Option to setup Topic, Topic Edit, Post, Post Edit, User-Specific moderation. 
##   Notify selected mod/admin on private messaging, email. 
## MOD Version: 3.0.0b2 
## 
## Installation Level: easy 
## Installation Time: 10 Minutes 
## Files To Edit: posting.php, 
##      viewforum.php, 
##      viewtopic.php, 
##      includes/constants.php, 
##      includes/topic_review.php, 
##      admin/admin_forums.php, 
##      templates/subSilver/admin/forum_edit_body.tpl 
## 
## Included Files: (n/a) 
## 
## Patch Author: Markus Rietzler < markus.rietzler@rzf.fin-nrw.de > 
##               this patch corrects the "quote"-function when 
##              a post not have been approved you could see the 
##             message by hitting "quote" button... 
## 
############################################################## 

# 
#-----[ OPEN ]------------------------------------------ 
# 
viewtopic.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
               $post_subject = "[ " . $lang['approve_post_is_awaiting'] . " ]"; 
               $message = $post_subject; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# this was the easiest task, hiding the quote image 
# 
               $quote_img = "&nbsp;"; 
# 
#-----[ OPEN ]------------------------------------------ 
# 
posting.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
         $mode = 'reply'; 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
         $isQuote = 1; 

# 
#-----[ FIND ]------------------------------------------ 
# (the first one) 
// 
// Begin Approve_mod 
// 
if( $mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# (so, approve also works with quotings...) 
// 
// Begin Approve_mod 
// 
if( $mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost' || $mode == 'quote') 
# 
#-----[ FIND ]------------------------------------------ 
# (the last one) 
// 
// End Approve_Mod 
// 

// Generate smilies listing for page output 
generate_smilies('inline', PAGE_POSTING); 
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
   // when in mode=quote, is the orignal post approved or not? 
   if ( $isQuote) { 
      $approve_sql = "SELECT * FROM " . APPROVE_POSTS_TABLE . " WHERE post_id = '" . $post_id . "' AND is_post = '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) ) 
      { 
         // post_id belongs to a post, that has to be approved, so 
         // we delete "quoted"-message  and subject. 
         $message = ""; 
         $subject = ""; 
      } 
   } 
# 
# ----[ DONE ]---------------------------------------------- 
# 
markus rietzler


thanxs to conanqtran pointing out one litte error with "brackets"
Last edited by rit on Wed Apr 23, 2003 1:15 pm, edited 6 times in total.
User avatar
Menace
Registered User
Posts: 25
Joined: Sun Mar 09, 2003 4:55 pm

Post by Menace »

Any word of the poll-bug?
You shortcut approving by adding a poll.
User avatar
rit
Registered User
Posts: 28
Joined: Thu Apr 03, 2003 11:23 am

Post by rit »

Menace wrote: Any word of the poll-bug?
You shortcut approving by adding a poll.



mh,
we just tested all possibilities:

- new topic with poll
- topic waiting for approval, add a poll
- adding poll to approved topic



in all cases the post was not auto-approved and you have to approve it.

are you sure, that you haven't checked autoapprove this topic or user?

markus
User avatar
rit
Registered User
Posts: 28
Joined: Thu Apr 03, 2003 11:23 am

Post by rit »

kenji wrote: Aceman,

I'm not sure if it is a bug but when i click on "Find all posts by member", it shows all the topic/post posted by member including those that are not approve.

The search function is fine. Did searched the non-approve topic but somehow it didn't show it out.

Thanks.


here is a patch, so that search all posts from author will not reveal the message if the post has not been approved. (one problem with search still remains, you can search for words, that are in a non-approved post. search will find that post and lists it. but if you then click to view the post the approve mod in viewtopic works again.)

Code: Select all

#-----[ OPEN ]------------------------------------------
#
search.php
#
#-----[ FIND ]------------------------------------------
# (first one)
				$template->assign_block_vars("searchresults", array( 
#
#-----[ ADD BEFORE ]------------------------------------------
# 
// 
// Begin Approve_Mod 
// 		
		$approve_mod = array();
		$approve_sql = "SELECT * FROM " . APPROVE_FORUMS_TABLE . " WHERE forum_id = '" . $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_mod = $db->sql_fetchrow($approve_result) ) 
		{    
			if ( intval($approve_mod['enabled']) == 1 )
			{
				$approve_mod['enabled'] = true;
			}
		}
		if( $approve_mod['enabled'] )
		{
			$approve_mod['posts_awaiting'] = false;
			$approve_sql = "SELECT * FROM " . APPROVE_POSTS_TABLE . " WHERE post_id = '" . $searchset[$i]['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); 
			} 
			if ( $approve_row = $db->sql_fetchrow($approve_result) ) 
			{ 
				if( intval($approve_row['post_id']) == $searchset[$i]['post_id'] )
				{
					$approve_mod['posts_awaiting'] = true;
				}  
			} 
			if ( $approve_mod['posts_awaiting'] )
			{
				$post_subject = "[ " . $lang['approve_post_is_awaiting'] . " ]";
				$message = $post_subject;
			}
		}
// 
// End Approve_Mod 
// 
markus
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

Excuse my ignorance . . . . I've followed the instructions in the mod by modifying 8 files. Now, if you try to read any messages, you get the message:

Could not obtain forum approval information

DEBUG MODE

SQL Error : 1146 Table 'MYFORUMUSERNAME.phpbb_approve_forums' doesn't exist

SELECT * FROM phpbb_approve_forums WHERE forum_id = '2'

Line : 275
File : /home/MYACCOUNT/forum.MYFORUMDOMAIN.com/admin/admin_forums.php

What have I done wrong? Thanks for your help.
Last edited by luigicanova on Sun Apr 13, 2003 4:28 am, edited 1 time in total.
conanqtran
Registered User
Posts: 308
Joined: Tue Mar 26, 2002 4:19 am
Contact:

Post by conanqtran »

well, this part of the instruction got the typo, its obivous:

Code: Select all

  // when in mode=quote, is the orignal post approved or not? 
   if ( $isQuote) { 
      $approve_sql = "SELECT * FROM " . APPROVE_POSTS_TABLE . " WHERE post_id = '" . $post_id . "' AND is_post = '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) ) 
      { 
         // post_id belongs to a post, that has to be approved, so 
         // we delete "quoted"-message  and subject. 
         $message = ""; 
         $subject = ""; 
      } 
   } 
}

the last } shouldn't be there, just take that out

and also i have found another bug with this mod, that enable user to view the post that is still waiting for approval, provided that the user havent' read the post (of course always), so there will be a small icon with the arrow like this Image in front of the topic title on the left. If you click on that, you can go and see the post, of course u can't see the details of the post but u still can reply to it, which doesn't make any sense bc' the post is still waiting for approval.

This is how to fix it.

Code: Select all


#
#-----[ OPEN ]------------------------------------------ 
# 
viewforum.php 
# 
#-----[ FIND ]------------------------------------------ 
#
				if ( $approve_mod['topics_awaiting'] )
				{
					$topic_title = "</a><span class='copyright'>[ " . $lang['approve_topic_is_awaiting'] . " ]</span>";
					$view_topic_url = append_sid("viewforum.php?f=" . $forum_id );
					$last_post_url = $last_post_url = '<img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" />';
					$goto_page = '';


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$newest_post_img = '<img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" />';
Cheers :wink:
luigicanova
Registered User
Posts: 20
Joined: Sun Jan 19, 2003 5:51 pm

Post by luigicanova »

Oh, wait . . . I see all of this at the beginning of the mod. Sorry for being so ignorant about all this, but does this mean that I'm supposed to be modifying more than those 8 phpBB files specified in the mod? And if so, how do I do that? Thanks.

#
#-----[ 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(8) unsigned NOT NULL auto_increment,
topic_id mediumint(8) unsigned NOT NULL default '0',
post_id mediumint(8) unsigned NOT NULL default '0',
is_topic tinyint(1) NOT NULL default '0',
is_post tinyint(1) NOT NULL default '0',
poster_id mediumint(8) 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(8) 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(8) NOT NULL default '0',
approve_moderate tinyint(1) NOT NULL default '0',
PRIMARY KEY (user_id)
) TYPE=MyISAM;
Locked

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