BitTorrent Трекер RusTrek.ru http://5.45.70.241/ |
|
Сообщает по email администраторам о созданных топиках. http://5.45.70.241/viewtopic.php?f=817&t=14613 |
Страница 1 из 1 |
Автор: | oartemka178 [ 2011-06-11 17:59 ] |
Заголовок сообщения: | Сообщает по email администраторам о созданных топиках. |
Сообщает по email администраторам о созданных топиках. Установка Открыть includes/functions_post.php Найти [php]$topic_id = $db->sql_nextid();[/php] Ниже добавить [php]sk_send_mail_to_admins($topic_id, $post_subject);[/php] В самый низ добавить Код: function sk_send_mail_to_admins($topic_id, $post_subject) { global $bb_cfg, $lang, $db, $phpbb_root_path, $phpEx; include($phpbb_root_path . 'includes/emailer.'.$phpEx); $emailer = new emailer($bb_cfg['smtp_delivery']); $script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($bb_cfg['script_path'])); $script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx; $server_name = trim($bb_cfg['server_name']); $server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://'; $server_port = ($bb_cfg['server_port'] <> 80) ? ':' . trim($bb_cfg['server_port']) . '/' : '/'; $sql = "SELECT user_email, user_lang FROM " . USERS_TABLE . " WHERE user_level = " . ADMIN; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) { $emailer->email_address(trim($row['user_email'])); $emailer->use_template('rustrek_new_topic_notifier', 'english'); // See Notes! $emailer->from($bb_cfg['board_email']); $emailer->set_subject($lang['New_post']); $emailer->assign_vars(array( 'SITENAME' => $bb_cfg['sitename'], 'TOPIC_TITLE' => $post_subject, 'U_TOPIC' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_TOPIC_URL . "=$topic_id", 'EMAIL_SIG' => (!empty($bb_cfg['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $bb_cfg['board_email_sig']) : '') ); $emailer->send(); $emailer->reset(); } $db->sql_freeresult($result); } С архива распаковать в language/lang_russian/email/rustrek_new_topic_notifier.tpl |
Автор: | oartemka178 [ 2011-06-11 21:31 ] |
Заголовок сообщения: | |
Код: function sk_send_mail_to_admins($topic_id, $post_subject) {
global $bb_cfg, $lang, $db, $phpbb_root_path, $phpEx; include($phpbb_root_path . 'includes/emailer.'.$phpEx); $emailer = new emailer($bb_cfg['smtp_delivery']); $script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($bb_cfg['script_path'])); $script_name = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx; $server_name = trim($bb_cfg['server_name']); $server_protocol = ($bb_cfg['cookie_secure']) ? 'https://' : 'http://'; $server_port = ($bb_cfg['server_port'] <> 80) ? ':' . trim($bb_cfg['server_port']) . '/' : '/'; $sql = "SELECT user_email, user_lang FROM " . USERS_TABLE . " WHERE user_level = " . ADMIN; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not select Administrators', '', __LINE__, __FILE__, $sql); } while ($row = $db->sql_fetchrow($result)) |
Страница 1 из 1 | Часовой пояс: UTC + 3 часа |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |