Hi to everyone
in our forum we have about 20 moderators, sometimes they are wrong... is it possible that admins get a notification via PM when moderators admonish/ban users? something like that
user xxx admonished/banned by yyy (when?) (post?)
thank you in advance
How Can Admin Get Notifications For Admonishments
Subject: Re: How Can Admin Get Notifications For Admonishments
I can't find where is the function that notify users when are warn :@
If i get that, i could make what u want ( i think :P )
If i get that, i could make what u want ( i think :P )
Subject: Re: How Can Admin Get Notifications For Admonishments
thank you for helping me :loveit: i've looked for it but i couldn't find anything :(
Subject: Re: How Can Admin Get Notifications For Admonishments
i think it could be in card.php ( first step :P)
Subject: Re: How Can Admin Get Notifications For Admonishments
maybe from #398
thank you :)
// se if the user are to be banned, if so do it ...
if ( ($the_user['user_warnings'] + 1) >= $board_config['max_user_bancard'] )
{
$sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE . ' WHERE ban_userid="' . $poster_id . '"';
if( $result = $db->sql_query($sql) )
{
if ( (!$db->sql_fetchrowset($result)) && ($poster_id != ANONYMOUS) )
{
// insert the user in the ban list
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid) VALUES ($poster_id)";
if (!$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert ban_userid info into database", "", __LINE__, __FILE__, $sql);
}
// update the user table with new status
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET session_logged_in="0" WHERE session_user_id="' . $poster_id . '"';
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update banned sessions from database", "", __LINE__, __FILE__, $sql);
}
$no_error_ban=true;
$message = $lang['Ban_update_red'];
$e_temp = 'ban_block';
// $e_subj = $lang['Ban_blocked'];
}
else
{
$no_error_ban = true;
$message = $lang['user_already_banned'];
}
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtain banlist information", "", __LINE__, __FILE__, $sql);
}
}
else
{
// the user shall not be baned this time, update the counter
$message = sprintf($lang['Ban_update_yellow'], ($the_user['user_warnings'] + 1), $board_config['max_user_bancard']) . '<br /><br />' . sprintf($lang['Send_PM_user'], '<a href="' . append_sid('privmsg.' . $phpEx . '?mode=post&u=' . $poster_id) . '">', '</a>');
$no_error_ban = true;
$e_temp = 'ban_warning';
// $e_subj = $lang['Ban_warning'];
$db->clear_cache();
}
}
if ($no_error_ban)
{
$sql = 'SELECT username, user_warnings, user_email, user_lang FROM ' . USERS_TABLE . ' WHERE user_id="' . $poster_id . '"';
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't find the users personal information", "", __LINE__, __FILE__, $sql);
}
$warning_data = $db->sql_fetchrow($result);
if (!empty($warning_data['user_email']))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$script_name = preg_replace('/^/?(.*?)/?$/', '1', trim($board_config['script_path'])). '/' . VIEWTOPIC_MG;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$emailer = new emailer($board_config['smtp_delivery']);
$email_headers = "TO: '". $warning_data['username']. "' <" . $warning_data['user_email'] . ">rn";
$email_headers .= ($userdata['user_email'] && $userdata['user_viewemail']) ? "FROM: "" . $userdata['username'] . "" <" . $userdata['user_email'] . ">rn" : "FROM: "" . $board_config['sitename'] . "" <" . $board_config['board_email'] . ">rn";
$emailer->use_template($e_temp, stripslashes($warning_data['user_lang']));
$emailer->email_address($warning_data['user_email']);
//$emailer->set_subject($e_subj);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'WARNINGS' => $warning_data['user_warnings'],
'TOTAL_WARN' => $board_config['max_user_bancard'],
'POST_URL' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . '=' . $post_id . '#p' . $post_id,
'EMAIL_SIG' => str_replace("<br />", "n", "-- n" . $board_config['board_email_sig']),
'WARNER' => $userdata['username'],
'BLOCK_TIME' => $block_time,
'WARNED_POSTER' => $warning_data['username'])
);
$emailer->send();
$emailer->reset();
}
else
{
$message .= '<br/><br/>' . $lang['user_no_email'];
}
}
else
{
$message = 'Error card.php file';
}
$message .= ( $post_id != '-1' ) ? '<br /><br />' . sprintf($lang['Click_return_viewtopic'], '<a href="' . append_sid(VIEWTOPIC_MG . '?' . POST_POST_URL . '=' . $post_id . '#p' . $post_id) . '">', '</a>') : '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(FORUM_MG). '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
?>
if ( ($the_user['user_warnings'] + 1) >= $board_config['max_user_bancard'] )
{
$sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE . ' WHERE ban_userid="' . $poster_id . '"';
if( $result = $db->sql_query($sql) )
{
if ( (!$db->sql_fetchrowset($result)) && ($poster_id != ANONYMOUS) )
{
// insert the user in the ban list
$sql = "INSERT INTO " . BANLIST_TABLE . " (ban_userid) VALUES ($poster_id)";
if (!$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert ban_userid info into database", "", __LINE__, __FILE__, $sql);
}
// update the user table with new status
$sql = 'UPDATE ' . SESSIONS_TABLE . ' SET session_logged_in="0" WHERE session_user_id="' . $poster_id . '"';
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't update banned sessions from database", "", __LINE__, __FILE__, $sql);
}
$no_error_ban=true;
$message = $lang['Ban_update_red'];
$e_temp = 'ban_block';
// $e_subj = $lang['Ban_blocked'];
}
else
{
$no_error_ban = true;
$message = $lang['user_already_banned'];
}
}
else
{
message_die(GENERAL_ERROR, "Couldn't obtain banlist information", "", __LINE__, __FILE__, $sql);
}
}
else
{
// the user shall not be baned this time, update the counter
$message = sprintf($lang['Ban_update_yellow'], ($the_user['user_warnings'] + 1), $board_config['max_user_bancard']) . '<br /><br />' . sprintf($lang['Send_PM_user'], '<a href="' . append_sid('privmsg.' . $phpEx . '?mode=post&u=' . $poster_id) . '">', '</a>');
$no_error_ban = true;
$e_temp = 'ban_warning';
// $e_subj = $lang['Ban_warning'];
$db->clear_cache();
}
}
if ($no_error_ban)
{
$sql = 'SELECT username, user_warnings, user_email, user_lang FROM ' . USERS_TABLE . ' WHERE user_id="' . $poster_id . '"';
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't find the users personal information", "", __LINE__, __FILE__, $sql);
}
$warning_data = $db->sql_fetchrow($result);
if (!empty($warning_data['user_email']))
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$script_name = preg_replace('/^/?(.*?)/?$/', '1', trim($board_config['script_path'])). '/' . VIEWTOPIC_MG;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$emailer = new emailer($board_config['smtp_delivery']);
$email_headers = "TO: '". $warning_data['username']. "' <" . $warning_data['user_email'] . ">rn";
$email_headers .= ($userdata['user_email'] && $userdata['user_viewemail']) ? "FROM: "" . $userdata['username'] . "" <" . $userdata['user_email'] . ">rn" : "FROM: "" . $board_config['sitename'] . "" <" . $board_config['board_email'] . ">rn";
$emailer->use_template($e_temp, stripslashes($warning_data['user_lang']));
$emailer->email_address($warning_data['user_email']);
//$emailer->set_subject($e_subj);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
'SITENAME' => $board_config['sitename'],
'WARNINGS' => $warning_data['user_warnings'],
'TOTAL_WARN' => $board_config['max_user_bancard'],
'POST_URL' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_POST_URL . '=' . $post_id . '#p' . $post_id,
'EMAIL_SIG' => str_replace("<br />", "n", "-- n" . $board_config['board_email_sig']),
'WARNER' => $userdata['username'],
'BLOCK_TIME' => $block_time,
'WARNED_POSTER' => $warning_data['username'])
);
$emailer->send();
$emailer->reset();
}
else
{
$message .= '<br/><br/>' . $lang['user_no_email'];
}
}
else
{
$message = 'Error card.php file';
}
$message .= ( $post_id != '-1' ) ? '<br /><br />' . sprintf($lang['Click_return_viewtopic'], '<a href="' . append_sid(VIEWTOPIC_MG . '?' . POST_POST_URL . '=' . $post_id . '#p' . $post_id) . '">', '</a>') : '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid(FORUM_MG). '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
include($phpbb_root_path . 'includes/page_tail.' . $phpEx);
?>
thank you :)
Subject: Re: How Can Admin Get Notifications For Admonishments
a quick solution (now i have not more time to do a better solution)
replace
with
replace admin @ email.com with the admins email
replace
with
mail("admin@email.com","users are warn","$userdata['username'] etc...");
$emailer->send();
$emailer->send();
replace admin @ email.com with the admins email
Subject: Re: How Can Admin Get Notifications For Admonishments
To enable this feature you should also create an extra template for emails.
When I have some free time, I'll have a try. :wink:
When I have some free time, I'll have a try. :wink:
Page 1 of 1
You cannot post new topicsYou cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.156s (PHP: 16% SQL: 84%)
SQL queries: 10 - Debug Off - GZIP Enabled