(admin default to change) will receive ID of added posts','xnpn'); $subbbt = __('Save settings »','xnpn'); } else { _e('This email (update it if needed) will receive ID of added posts','xnpn'); $subbbt = __('Update settings »','xnpn'); } ?>

 

 

** **
Notification email settings saved.','xnpn') ); } } function admin_notification_new_post($post_id = 0) { // thanks Markus of comment suggest. global $bbdb, $topic_id, $bb_current_user ; $topic = get_topic($topic_id); $header = 'From: '.bb_get_option('from_email')."\n"; $header .= 'MIME-Version: 1.0'."\n"; $header .= 'Content-Type: text/plain; charset="'.BBDB_CHARSET.'"'."\n"; $header .= 'Content-Transfer-Encoding: 7bit'."\n"; $subject = __('There is a new post on: ','xnpn').$topic->topic_title; $msg = __('Hello,','xnpn')."\n".get_user_name($bb_current_user->ID).__(' has posted here:','xnpn')."\n\n".get_topic_link($topic_id); if ('' != bb_get_option('xnpn_email_content')) $msg .= "\n\n"."Content:"."\n\n".strip_tags(get_post_text($post_id)); // thanks Markus of comment suggest. if ('' == bb_get_option('xnpn_email')) { $msg = __('Hi Keymaster, don\'t forget to visit New Post Notification settings in forum admin UI and save a right email.','xnpn').$msg; bb_mail(bb_get_option('from_email'), $subject, $msg, $header); } else { bb_mail(bb_get_option('xnpn_email'), $subject, $msg, $header); } } add_action('bb_new_post', 'admin_notification_new_post'); //add_action('bb_insert_post', 'admin_notification_new_post'); ?>