can i get a response in your phpinstallers of my predefined question as i think i m being ignoredRMcGirr83 wrote:Welcome to my world
It is possible of course with some code addition. To do it right you need to use the mailing class that comes with phpBB similarly to how it is done in functions_approve.php for moderator notification.tsunamix83 wrote:Is it possible to send an email to that particular user when his/her post/topic got approved?
I tried to do that just putting a php mail() statement to somewhere in the code but couldn't figure it out.
Any help is appreciated.
I don't know where to put the additional code. I want email to go to the user after moderator click on the approve button. Can you show me where to put it?uncle.f wrote:It is possible of course with some code addition. To do it right you need to use the mailing class that comes with phpBB similarly to how it is done in functions_approve.php for moderator notification.
First of all you need to create a template for your e-mail that will go out to your users.tsunamix83 wrote:I want email to go to the user after moderator click on the approve button. Can you show me where to put it?
Code: Select all
Subject: {SITENAME} Post Approval Notification
Charset: iso-8859-1
Hello,
This is an automated message from {SITENAME}.
Your post post in the forum '{FORUM_NAME}' has been approved.
(full post text can be found below)
------------------------------------------------------------------------------
Topic title: {TOPIC_TITLE}
Message subject: {POST_SUBJECT}
{POST_TEXT}
------------------------------------------------------------------------------
{EMAIL_SIG}
Code: Select all
message_die(GENERAL_ERROR, "Error while updating user's post counter", '', __LINE__, __FILE__, $sql);
}
}
Code: Select all
message_die(GENERAL_ERROR, "Error while updating user's post counter", '', __LINE__, __FILE__, $sql);
}
...your additional code here...
}
Code: Select all
global $board_config, $phpbb_root_path, $phpEx, $lang;
if ($post_info['poster_id'] != ANONYMOUS)
{
$sql = "SELECT user_email, user_lang FROM " . USERS_TABLE . " WHERE user_id = " . $post_info['poster_id'] . " AND user_active <> 0 ";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query poster information', '', __LINE__, __FILE__, $sql);
}
$userinfo = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($userinfo['user_email'] != '')
{
include_once($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$emailer->from($board_config['board_email']);
$emailer->replyto($board_config['board_email']);
$emailer->assign_vars(array(
'EMAIL_SIG' => $board_config['board_email_sig'] ? strip_tags(str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig'])) : '',
'SITENAME' => $board_config['sitename'],
'FORUM_NAME' => $post_info['forum_name'],
'TOPIC_TITLE' => stripslashes(trim($post_info['topic_title'])),
'POST_SUBJECT' => stripslashes(trim($post_info['post_subject'])),
'POST_TEXT' => stripslashes(trim($post_info['post_text']))
));
$emailer->use_template('approved_notify', $userinfo['user_lang']);
$emailer->email_address($userinfo['user_email']);
$emailer->send();
$emailer->reset();
}
}
Code: Select all
message_die(GENERAL_ERROR, "Error while updating user's post counter", '', __LINE__, __FILE__, $sql);
You could have mentioned that from the start!tsunamix83 wrote:Thank you very much for the help but I am using the old version.
Code: Select all
$sql = "UPDATE " . TOPICS_TABLE . " SET " . $topic_sql . " WHERE topic_id = $topic_id";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Error while updating topic approval info', '', __LINE__, __FILE__, $sql);
}
...... insert new code here ......
}
imlek wrote:Hello,
I just installed this Approval Mod 2.0.0.
I can login to Admin panel. But there is an error on my board.
The error message: "This board has no forums"
But I can see all my forums at the Admin panel.
Please help me.
Thank you and warm regards
Code: Select all
Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/etaupoli/public_html/forum/viewtopic.php on line 1051
Code: Select all
if ( $userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $forum_topic_data['topic_last_post_id'] == $postrow[$i]['post_id'] || $allowed_to_approve && $postrow[$i]['post_approve'])
Thanks for a great mod -do you have any indication which piece of code could be causing this post reporting error? I have installed on a heavily modded board and therefore cannot us EasyMOD and all works perfectly apart from the post and comment counts (only in approval required forums). Link.uncle.f wrote:bugfixed wrote: Ok problem solved.
but now other category there is same problem
(wrong values)
The SQL queries above should have fixed the whole board. If this is not the case, then I am afraid wrong values are being written into the tables when posts are made / deleted. This means that the MOD was installed incorrectly. Most likely editing error.
I said it million times before and I will say it again. Please use EasyMOD instead of manual editing.
It is REALLY easy and error free.
The code that you quoted is 100% correct. That is how that line should look after the Approval MOD installation. What I wonder is why your line number is 1051. If you installed the Approval MOD using EasyMOD on a virgin phpBB 2.0.22, the line number should be actually 1055. So either you have more MODs installed that modified this file and could cause a conflict OR you did not use EasyMOD to install the Approval MOD (and very likely made a typo somewhere earlier in that file).stefane321 wrote:hello,
I installed the Approval MOD
I got this error:
Code of line 1051:Code: Select all
Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/etaupoli/public_html/forum/viewtopic.php on line 1051
Code: Select all
if ( $userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $forum_topic_data['topic_last_post_id'] == $postrow[$i]['post_id'] || $allowed_to_approve && $postrow[$i]['post_approve'])
Thanks a lot for reporting this problem! Indeed a bug in the "fix" file. I will include the revised fix with the next update!ChunkyBananas wrote:I have this installed with the Last Topic Title on Index mod, and it didn't work with the included fix. Looks like it leaves a missing open parens after the FROM in index.php.
Figured I'd let ya'll know
This functionality is included in the MOD. The only catch is that you need to make sure the "Hide unapproved posts" option is deactivated for the required forum. This way the posts will be displayed as "waiting for approval" for everybody, except the moderators and the user who posted it.ChunkyBananas wrote:I'm sorry if I missed it, but has anyone found a way to allow the poster to view his/her own post while its approval is pending - but still hidden to everyone else?