Dragonfly CMS v9 ⇒ CPG-BB (forum) ⇒ [wip] Posts in Email Notification ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks CPG-BB (forum)

[wip] Posts in Email Notification Reply to topic


I'm guessing this mod is a bit out of date these days, as I can't seem to get it working.

dragonflycms.org/Downl...ls/id=417/

My subscribers have been asking for message content in the notification emails for a long time, so thought I'd give it a bash, but no joy so far.

Heres the code if anyone can spot what needs updating.

############################################################## # # MOD Title: Display sender username and post text in E-mail Notification for CPG-BB (DragonflyCMS Forum) # MOD Author: Mechanoid <cheremisin@gmail.com> http://kres2000.perm.ru/ # (based on AJP's Display Sender Username in E-mail phpBB mod, http://www.phpbb.com/mods/ # and code published by AckCmd at http://forum.ixbt.com/topic.cgi?id=24:17417-4#130 ) # # MOD Version: 0.0.2 tested with DragonflyCMS v 9.0.6.1 # # Installation Level: Easy # Installation Time: ~1 Minutes # Files To Edit: includes/phpBB/functions_post.php # modules/Forums/posting.php # languages/english/Forums/email/topic_notify.tpl # Included Files: n/a # License: GNU GPL v2 # ################################################################# ## ## MOD History: ## ## 2005-10-23 - Verion 0.0.2 ## - New version without SQL queries! Thanks to AckCmd. ## ## 2005-10-21 - Version 0.0.1 ## - First tested mod version. ## ################################################################## ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ################################################################## # # Small remark in Russian: # â ïðîöåññå äîðàáîòîê ìîäà ïî÷òè íè÷åãî îò ìîåãî èçíà÷àëüíîãî êîäà íå îñòàëîñü, # Ìîä íàïèñàí èñêëþ÷èòåëüíî äëÿ ñåáÿ è ïîýòîìó ïðåäåëüíî ïðîñò, # íå òðåáóåò äîáàâëåíèÿ ÷åãî-òî â áàçó äàííûõ è íå ñîäåðæèò # sql-çàïðîñîâ. # ################################################################# # modules/Forums/posting.php # #-----[ FIND ]------------------------------------------ # user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user); # #-----[ INLINE, FIND ]------------------------------------ # $notify_user # #-----[ AFTER, ADD ]-------------------------------------- # , $message # # includes/phpBB/functions_post.php # #-----[ FIND ]------------------------------------------ # function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user); # #-----[ INLINE, FIND ]------------------------------------ # &$notify_user # #-----[ AFTER, ADD ]-------------------------------------- # , $message # #-----[ FIND ]------------------------------------------ # 'TOPIC_TITLE' => $topic_title, # #-----[ AFTER, ADD ]-------------------------------------- # 'MESSAGE_AUTHOR' => $userdata['username'], 'MESSAGE_TEXT' => decode_bb_all(str_replace('<br />',"\n",stripslashes(str_replace('\n',"<br />",str_replace('\r',"",$message)))), 0, true), # language/[your_language]/Forums/email/topic_notify.tpl # # #-----[ FIND ]------------------------------------------ # {U_TOPIC} # #-----[ AFTER, ADD ]-------------------------------------- # {MESSAGE_AUTHOR} wrote: {MESSAGE_TEXT} # #-----[ SAVE & CLOSE ALL FILES ]-------------------------- # #--EoM # ############################################################################################################### # #---- [!!! OPTIONAL - IF YOU WANT TO SEND ALL NOTIFICATIONS WITHOUT CHECKING OF REVISITS OF THE TOPIC ----- !!!] # ############################################################################################################## ## includes/phpBB/functions_post.php # #-----[ FIND ]------------------------------------------ # if ($update_watched_sql != '') { $sql = "UPDATE " . TOPICS_WATCH_TABLE . " SET notify_status = " . TOPIC_WATCH_NOTIFIED . " WHERE topic_id = $topic_id AND user_id IN ($update_watched_sql)"; $db->sql_query($sql); } # #-----[ REPLACE WITH ]------------------------------------------ # /* if ($update_watched_sql != '') { $sql = "UPDATE " . TOPICS_WATCH_TABLE . " SET notify_status = " . TOPIC_WATCH_NOTIFIED . " WHERE topic_id = $topic_id AND user_id IN ($update_watched_sql)"; $db->sql_query($sql); } */ # # # # # #-----[ SAVE & CLOSE ALL FILES ]-------------------------- # #--EoM

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Aha, noticed a few differences between CPG-BB and ForumsPro which we use.

By substituting $userinfo where this says $userdata we now have the emails saying "Author Wrote:" correctly.

Now I only need it to actually post the messages instead of blank lines. Cool

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Ok, it seems this bit should strip any bbcode, and then add the message to the email. Unfortunately I just get a blank space where the message should be, can anybody see anything wrong with it at all???

'MESSAGE_TEXT' => decode_bb_all(str_replace('<br />',"\n",stripslashes(str_replace('\n',"<br />",str_replace('\r',"",$message)))), 0, true),

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Insert this after that block of code, and what you get:

trigger_error (decode_bb_all(str_replace('<br />',"\n",stripslashes(str_replace('\n',"<br />",str_replace('\r',"",$message)))), 0, true));

Maybe you have to enable HTML in the mailer function call (??)

www.greenday2k.net

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Will the error then appear in the email?

Seen a few topics re enabling HTML, will have a hunt around, would the code stay the same though?

Thanks for looking. I would have thought this would be a fairly sought after enhancement myself.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Enabled HTML in the Admin Backend, sorry, but I'm not sure how to add that error code. Embarassed

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


This is still something that would be very cool, any plans to add it in 10 perhaps?

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Feature requests have a better chance of being noticed and actioned when you place them through the correct vehicle dragonflycms.org/Projects/

Already planned for v10, amongst other things.

It will be an option for those who don't want the overhead, and may include a character limit.

DonationsPro for DragonflyCMS & SMF

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Awesome thanks.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0


Happy to say that this works just fine in the current forums, as is.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
2.6.18-164.11.1.el5xen/2.2.13/5.0.89-community-log/5.2.11/9.3.3.0

All times are UTC


Jump to: