############################################################## ## MOD Title: Topic Reply in Email ## MOD Author: abertoll (Angelo Bertolli) http://angelo.freeshell.org/computer/ ## MOD Description: Includes the replies to topics in the notification emails that are sent. ## MOD Version: 0.1.1 ## ## Installation Level: Easy ## Installation Time: 6 minutes ## Files To Edit: posting.php ## includes/functions_post.php ## language/lang_english/email/topic_notify.tpl ## Included Files: ## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 ## Generator: Phpbb.ModTeam.Tools ############################################################## ## For security purposes, please check: http://www.phpbb.com/mods/ ## for the latest version of this MOD. Although MODs are checked ## before being allowed in the MODs Database there is no guarantee ## that there are no security problems within the MOD. No support ## will be given for MODs not found within the MODs Database which ## can be found at http://www.phpbb.com/mods/ ############################################################## ## Author Notes: This mod was made to allow people to read responses before visiting the board. ## Be aware that some of the strings in this text file may wrap. ## ## Thanks to ksn and teknoshock for their comments and support. ## ############################################################## ## MOD History: ## ## 2007-03-06 - Version 0.0.1 ## ## 2007-03-10 - Version 0.0.2 ## ## 2007-03-12 - Version 0.0.3 ## ## 2007-05-20 - Version 0.0.4 ## ## 2007-06-07 - Version 0.1.0 ## ## 2007-06-27 - Version 0.1.1 ## ############################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ############################################################## # #-----[ OPEN ]------------------------------------------ # posting.php # #-----[ FIND ]------------------------------------------ # user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user); # #-----[ REPLACE WITH ]------------------------------------------ # // Custom - add the poster and post message to the email, no need to send username - it's global // user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user); user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user, $message); # #-----[ OPEN ]------------------------------------------ # includes/functions_post.php # #-----[ FIND ]------------------------------------------ # $message .= '

' . sprintf($lang['Click_return_forum'], '', ''); return; } # #-----[ AFTER, ADD ]------------------------------------------ # // // Custom - function to convert a post with quotes to an email with quotes // Author: Angelo Bertolli function convert_post_to_email($posttext) { $posttext = html_entity_decode(stripslashes($posttext)); while ((($start = strpos(strtolower($posttext),"[quote")) !== FALSE) && (($end = strpos(strtolower($posttext),"[/quote",$start)) !== FALSE)) { $end = strpos(strtolower($posttext),"]",$end); $extracted = substr($posttext,$start,($end - $start + 1)); $newtext = substr($extracted,strpos($extracted,"]") + 1, strpos($extracted,"[/quote") - strpos($extracted,"]") - 1); $newtext = ereg_replace("^","> ",$newtext); $newtext = ereg_replace("\n","\n> ",$newtext); $posttext = str_replace($extracted,$newtext,$posttext); } return $posttext; } # #-----[ FIND ]------------------------------------------ # function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user) # #-----[ REPLACE WITH ]------------------------------------------ # // Custom - add the poster and post message to the email // function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user) function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user, $message) # #-----[ FIND ]------------------------------------------ # 'TOPIC_TITLE' => $topic_title, # #-----[ AFTER, ADD ]------------------------------------------ # // Custom - let's send the poster and post with the email. // Add POST_MESSAGE and POST_USERNAME 'POST_MESSAGE' => convert_post_to_email($message), 'POST_USERNAME' => $userdata['username'], // this is a global # #-----[ OPEN ]------------------------------------------ # language/lang_english/email/topic_notify.tpl # #-----[ FIND ]------------------------------------------ # Subject: Topic Reply Notification - {TOPIC_TITLE} # #-----[ REPLACE WITH ]------------------------------------------ # Subject: {SITENAME} - {TOPIC_TITLE} # #-----[ FIND ]------------------------------------------ # You are receiving this email because you are watching the topic, "{TOPIC_TITLE}" at {SITENAME}. This topic has received a reply since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. # #-----[ REPLACE WITH ]------------------------------------------ # You are receiving this email because you are watching the topic, "{TOPIC_TITLE}" at {SITENAME}. This topic has received a reply since your last visit. {POST_USERNAME}'s reply. {POST_MESSAGE} # #-----[ FIND ]------------------------------------------ # {U_TOPIC} If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link: {U_STOP_WATCHING_TOPIC} # #-----[ REPLACE WITH ]------------------------------------------ # You can use the following link to view the replies made, no more notifications will be sent until you visit the topic. {U_TOPIC} If you no longer wish to watch this topic you can either click the "Stop watching this topic link" found at the bottom of the topic above, or by clicking the following link: {U_STOP_WATCHING_TOPIC} # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM