From 11dd0c85716431ac9e38245c8f0a4d8270525001 Mon Sep 17 00:00:00 2001 From: Chris Case Date: Sat, 21 May 2011 19:23:56 -0700 Subject: [PATCH 1/4] html email updates --- view/de/cmnt_received_html_body_eml.tpl | 25 +++++++++++++++++++++++++ view/de/cmnt_received_text_body_eml.tpl | 16 ++++++++++++++++ view/en/cmnt_received_html_body_eml.tpl | 25 +++++++++++++++++++++++++ view/en/cmnt_received_text_body_eml.tpl | 14 ++++++++++++++ view/fr/cmnt_received_html_body_eml.tpl | 25 +++++++++++++++++++++++++ view/fr/cmnt_received_text_body_eml.tpl | 14 ++++++++++++++ view/it/cmnt_received_html_body_eml.tpl | 25 +++++++++++++++++++++++++ view/it/cmnt_received_text_body_eml.tpl | 18 ++++++++++++++++++ 8 files changed, 162 insertions(+) create mode 100644 view/de/cmnt_received_html_body_eml.tpl create mode 100644 view/de/cmnt_received_text_body_eml.tpl create mode 100644 view/en/cmnt_received_html_body_eml.tpl create mode 100644 view/en/cmnt_received_text_body_eml.tpl create mode 100644 view/fr/cmnt_received_html_body_eml.tpl create mode 100644 view/fr/cmnt_received_text_body_eml.tpl create mode 100644 view/it/cmnt_received_html_body_eml.tpl create mode 100644 view/it/cmnt_received_text_body_eml.tpl diff --git a/view/de/cmnt_received_html_body_eml.tpl b/view/de/cmnt_received_html_body_eml.tpl new file mode 100644 index 0000000000..3904b5f575 --- /dev/null +++ b/view/de/cmnt_received_html_body_eml.tpl @@ -0,0 +1,25 @@ + + + + Friendika Mitteilung + + + + + + + + + + + + + + + + + + +
Friendika
$from hat einen Pinnwandeintrag kommentiert dem du auch folgst.
$from
$body
Um die gesamte Konversation zu sehen melde dich bitte bei $siteurl an.
Danke für die Aufmerksamkeit
$sitename Administrator
+ + \ No newline at end of file diff --git a/view/de/cmnt_received_text_body_eml.tpl b/view/de/cmnt_received_text_body_eml.tpl new file mode 100644 index 0000000000..e00a868af2 --- /dev/null +++ b/view/de/cmnt_received_text_body_eml.tpl @@ -0,0 +1,16 @@ +Hallo $username, + +'$from' hat einen Pinnwandeintrag kommentiert dem du auch folgst. + +----- +$body +----- + +Um die gesamte Konversation zu sehen melde dich bitte bei $siteurl an: + +$display + +Danke fr die Aufmerksamkeit + $sitename Administrator + + diff --git a/view/en/cmnt_received_html_body_eml.tpl b/view/en/cmnt_received_html_body_eml.tpl new file mode 100644 index 0000000000..e7609228ef --- /dev/null +++ b/view/en/cmnt_received_html_body_eml.tpl @@ -0,0 +1,25 @@ + + + + Friendika Message + + + + + + + + + + + + + + + + + + +
Friendika
$from commented on an item/conversation which you have been following.
$from
$body
Please login to view the complete conversation.
Thank You,
$sitename Administrator
+ + diff --git a/view/en/cmnt_received_text_body_eml.tpl b/view/en/cmnt_received_text_body_eml.tpl new file mode 100644 index 0000000000..7dcedeb0cf --- /dev/null +++ b/view/en/cmnt_received_text_body_eml.tpl @@ -0,0 +1,14 @@ +Dear $username, + + '$from' commented on an item/conversation which you have been following. + +----- +$body +----- + +Please login at $siteurl to view the complete conversation: + +$display + +Thank you, + $sitename administrator \ No newline at end of file diff --git a/view/fr/cmnt_received_html_body_eml.tpl b/view/fr/cmnt_received_html_body_eml.tpl new file mode 100644 index 0000000000..1d904c53c6 --- /dev/null +++ b/view/fr/cmnt_received_html_body_eml.tpl @@ -0,0 +1,25 @@ + + + + Friendika Message + + + + + + + + + + + + + + + + + + +
Friendika
$from a commenté sur un élément ou une conversation que vous suivez.
$from
$body
Connectez-vous à $siteurl si vous souhaitez voir la conversation complète
Merci,
L'administrateur de $sitename
+ + \ No newline at end of file diff --git a/view/fr/cmnt_received_text_body_eml.tpl b/view/fr/cmnt_received_text_body_eml.tpl new file mode 100644 index 0000000000..d466321383 --- /dev/null +++ b/view/fr/cmnt_received_text_body_eml.tpl @@ -0,0 +1,14 @@ +Cher $username, + + '$from' a comment sur un lment ou une conversation que vous suivez. + +----- +$body +----- + +Connectez-vous $siteurl si vous souhaitez voir la conversation complte: + +$display + +Merci, + L'administrateur de $sitename \ No newline at end of file diff --git a/view/it/cmnt_received_html_body_eml.tpl b/view/it/cmnt_received_html_body_eml.tpl new file mode 100644 index 0000000000..5f2edb84b8 --- /dev/null +++ b/view/it/cmnt_received_html_body_eml.tpl @@ -0,0 +1,25 @@ + + + + Friendika Messaggio + + + + + + + + + + + + + + + + + + +
Friendika
$from ha commentato un elemeto/conversazione che stai seguendo.
$from
$body
Accedi a $siteurl per verdere la conversazione completa:.
Grazie,
L'amministratore di $sitename
+ + \ No newline at end of file diff --git a/view/it/cmnt_received_text_body_eml.tpl b/view/it/cmnt_received_text_body_eml.tpl new file mode 100644 index 0000000000..1991d29ae6 --- /dev/null +++ b/view/it/cmnt_received_text_body_eml.tpl @@ -0,0 +1,18 @@ + +Caro/a $username, + + '$from' ha commentato un elemeto/conversazione che stai seguendo. + +----- +$body +----- + +Accedi a $siteurl per verdere la conversazione completa: + +$display + +Grazie, + L'amministratore di $sitename + + + From dfc05af73b784c5c16abf31b3df8ee07ec0201b7 Mon Sep 17 00:00:00 2001 From: Chris Case Date: Sat, 21 May 2011 19:26:51 -0700 Subject: [PATCH 2/4] email updates --- favicon.gif | 0 favicon.ico | 0 view/en/wall_received_html_body_eml.tpl | 24 ++++++++++++++++++++++++ view/en/wall_received_text_body_eml.tpl | 18 ++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 favicon.gif create mode 100644 favicon.ico create mode 100644 view/en/wall_received_html_body_eml.tpl create mode 100644 view/en/wall_received_text_body_eml.tpl diff --git a/favicon.gif b/favicon.gif new file mode 100644 index 0000000000..e69de29bb2 diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000..e69de29bb2 diff --git a/view/en/wall_received_html_body_eml.tpl b/view/en/wall_received_html_body_eml.tpl new file mode 100644 index 0000000000..d771836043 --- /dev/null +++ b/view/en/wall_received_html_body_eml.tpl @@ -0,0 +1,24 @@ + + + + Friendika Message + + + + + + + + + + + + + + + + + +
Friendika
$from posted something to your profile wall.
$from
$body
Please login at $siteurl to view or delete the post.
Thank You,
$sitename Administrator
+ + \ No newline at end of file diff --git a/view/en/wall_received_text_body_eml.tpl b/view/en/wall_received_text_body_eml.tpl new file mode 100644 index 0000000000..c296de7851 --- /dev/null +++ b/view/en/wall_received_text_body_eml.tpl @@ -0,0 +1,18 @@ + +Dear $username, + + '$from' posted something to your profile wall. + +----- +$body +----- + +Please login at $siteurl to view or delete the item: + +$display + +Thank you, + $sitename administrator + + + From 2cf696d0b5d647e1741d2f94ee379aa19b25ae1b Mon Sep 17 00:00:00 2001 From: Chris Case Date: Sat, 21 May 2011 19:27:56 -0700 Subject: [PATCH 3/4] image updates --- mod/dfrn_notify.php | 113 +++++++++++++++++++++++++++++++++++++++++++- mod/item.php | 110 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 221 insertions(+), 2 deletions(-) diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index f447b54533..3ceb4b3fcc 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -374,6 +374,7 @@ function dfrn_notify_post(&$a) { if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { require_once('bbcode.php'); $from = stripslashes($datarray['author-name']); + /* $tpl = load_view_file('view/cmnt_received_eml.tpl'); $email_tpl = replace_macros($tpl, array( '$sitename' => $a->config['sitename'], @@ -387,6 +388,60 @@ function dfrn_notify_post(&$a) { $res = mail($importer['email'], $from . t(' commented on an item at ') . $a->config['sitename'], $email_tpl, "From: " . t('Administrator') . '@' . $a->get_hostname() ); + */ + // name of the automated email sender + $msg['notificationfromname'] = stripslashes($datarray['author-name']);; + // noreply address to send from + $msg['notificationfromemail'] = t('noreply') . '@' . $a->get_hostname(); + + // text version + // process the message body to display properly in text mode + $msg['textversion'] + = html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8'); + + // html version + // process the message body to display properly in text mode + $msg['htmlversion'] + = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "
\n",$datarray['body'])))); + + // load the template for private message notifications + $tpl = load_view_file('view/cmnt_received_html_body_eml.tpl'); + $email_html_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $datarray['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => 'q1' .$msg['htmlversion'], // html version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // load the template for private message notifications + $tpl = load_view_file('view/cmnt_received_text_body_eml.tpl'); + $email_text_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $datarray['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['textversion'], // text version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // use the EmailNotification library to send the message + require_once("include/EmailNotification.php"); + EmailNotification::sendTextHtmlEmail( + $msg['notificationfromname'], + t("Administrator@") . $a->get_hostname(), + t("noreply") . '@' . $a->get_hostname(), + $importer['email'], + $from . t(" commented on an item at ") . $a->config['sitename'], + $email_html_body_tpl, + $email_text_body_tpl + ); + } } xml_status(0); @@ -449,7 +504,7 @@ function dfrn_notify_post(&$a) { if(($datarray['type'] != 'activity') && ($importer['notify-flags'] & NOTIFY_COMMENT)) { - $myconv = q("SELECT `author-link` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 ", + $myconv = q("SELECT `author-link`, `author-avatar` FROM `item` WHERE `parent-uri` = '%s' AND `uid` = %d AND `parent` != 0 ", dbesc($parent_uri), intval($importer['importer_uid']) ); @@ -460,6 +515,7 @@ function dfrn_notify_post(&$a) { continue; require_once('bbcode.php'); $from = stripslashes($datarray['author-name']); + /* $tpl = load_view_file('view/cmnt_received_eml.tpl'); $email_tpl = replace_macros($tpl, array( '$sitename' => $a->config['sitename'], @@ -474,6 +530,61 @@ function dfrn_notify_post(&$a) { $res = mail($importer['email'], $from . t(" commented on an item at ") . $a->config['sitename'], $email_tpl,t("From: Administrator@") . $a->get_hostname() ); + */ + + + + // name of the automated email sender + $msg['notificationfromname'] = stripslashes($datarray['author-name']);; + // noreply address to send from + $msg['notificationfromemail'] = t('noreply') . '@' . $a->get_hostname(); + + // text version + // process the message body to display properly in text mode + $msg['textversion'] + = html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8'); + + // html version + // process the message body to display properly in text mode + $msg['htmlversion'] + = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "
\n",$datarray['body'])))); + + // load the template for private message notifications + $tpl = load_view_file('view/cmnt_received_html_body_eml.tpl'); + $email_html_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$url' => $conv['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['htmlversion'], // html version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // load the template for private message notifications + $tpl = load_view_file('view/cmnt_received_text_body_eml.tpl'); + $email_text_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$url' => $conv['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['textversion'], // text version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // use the EmailNotification library to send the message + require_once("include/EmailNotification.php"); + EmailNotification::sendTextHtmlEmail( + $msg['notificationfromname'], + t("Administrator@") . $a->get_hostname(), + t("noreply") . '@' . $a->get_hostname(), + $importer['email'], + $from . t(" commented on an item at ") . $a->config['sitename'], + $email_html_body_tpl, + $email_text_body_tpl + ); + break; } } diff --git a/mod/item.php b/mod/item.php index 5989d09674..ad32985921 100644 --- a/mod/item.php +++ b/mod/item.php @@ -408,6 +408,7 @@ function item_post(&$a) { if(($user['notify-flags'] & NOTIFY_COMMENT) && ($contact_record != $author)) { require_once('bbcode.php'); $from = $author['name']; + /* $tpl = load_view_file('view/cmnt_received_eml.tpl'); $email_tpl = replace_macros($tpl, array( '$sitename' => $a->config['sitename'], @@ -420,7 +421,60 @@ function item_post(&$a) { )); $res = mail($user['email'], $from . t(" commented on your item at ") . $a->config['sitename'], - $email_tpl,t("From: Administrator@") . $a->get_hostname() ); + $email_tpl,t("From: Administrator@") . $a->get_hostname() ); + */ + // name of the automated email sender + $msg['notificationfromname'] = stripslashes($datarray['author-name']);; + // noreply address to send from + $msg['notificationfromemail'] = t('noreply') . '@' . $a->get_hostname(); + + // text version + // process the message body to display properly in text mode + $msg['textversion'] + = html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8'); + + // html version + // process the message body to display properly in text mode + $msg['htmlversion'] + = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "
\n",$datarray['body'])))); + + // load the template for private message notifications + $tpl = load_view_file('view/cmnt_received_html_body_eml.tpl'); + $email_html_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $conv['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['htmlversion'], // html version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // load the template for private message notifications + $tpl = load_view_file('view/cmnt_received_text_body_eml.tpl'); + $email_text_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $conv['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['textversion'], // text version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // use the EmailNotification library to send the message + require_once("include/EmailNotification.php"); + EmailNotification::sendTextHtmlEmail( + $msg['notificationfromname'], + t("Administrator@") . $a->get_hostname(), + t("noreply") . '@' . $a->get_hostname(), + $user['email'], + $from . t(" commented on an item at ") . $a->config['sitename'], + $email_html_body_tpl, + $email_text_body_tpl + ); } } else { @@ -431,6 +485,7 @@ function item_post(&$a) { if(($user['notify-flags'] & NOTIFY_WALL) && ($contact_record != $author)) { require_once('bbcode.php'); $from = $author['name']; + /* $tpl = load_view_file('view/wall_received_eml.tpl'); $email_tpl = replace_macros($tpl, array( '$sitename' => $a->config['sitename'], @@ -444,6 +499,59 @@ function item_post(&$a) { $res = mail($user['email'], $from . t(" posted on your profile wall at ") . $a->config['sitename'], $email_tpl,t("From: Administrator@") . $a->get_hostname() ); + */ + + + // name of the automated email sender + $msg['notificationfromname'] = $from; + // noreply address to send from + $msg['notificationfromemail'] = t('noreply') . '@' . $a->get_hostname(); + + // text version + // process the message body to display properly in text mode + $msg['textversion'] + = html_entity_decode(strip_tags(bbcode(stripslashes($datarray['body']))), ENT_QUOTES, 'UTF-8'); + + // html version + // process the message body to display properly in text mode + $msg['htmlversion'] + = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "
\n",$datarray['body'])))); + + // load the template for private message notifications + $tpl = load_view_file('view/wall_received_html_body_eml.tpl'); + $email_html_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$url' => $conv['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['htmlversion'], // html version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // load the template for private message notifications + $tpl = load_view_file('view/wall_received_text_body_eml.tpl'); + $email_text_body_tpl = replace_macros($tpl,array( + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$url' => $conv['author-link'], // full url for the site + '$from' => $from, // name of the person sending the message + '$body' => $msg['textversion'], // text version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + )); + + // use the EmailNotification library to send the message + require_once("include/EmailNotification.php"); + EmailNotification::sendTextHtmlEmail( + $msg['notificationfromname'], + t("Administrator@") . $a->get_hostname(), + t("noreply") . '@' . $a->get_hostname(), + $user['email'], + $from . t(" commented on an item at ") . $a->config['sitename'], + $email_html_body_tpl, + $email_text_body_tpl + ); } } From f4cb6b9b08f6dc392b1f008f0aa9e9181f9e8b21 Mon Sep 17 00:00:00 2001 From: Chris Case Date: Sat, 21 May 2011 23:19:50 -0700 Subject: [PATCH 4/4] fixed a couple of bugs --- mod/dfrn_notify.php | 63 ++++++++++++++++++++++++--------------------- mod/item.php | 35 +++++++++++++------------ 2 files changed, 52 insertions(+), 46 deletions(-) diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index 6709ed2755..5f6ed59d4f 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -79,6 +79,9 @@ function dfrn_notify_post(&$a) { // $importer in this case contains the contact record for the remote contact joined with the user record of our user. $importer = $r[0]; + foreach($importer as $key => $val) { + logger( "importer - key: " . $key . " val: " . $val); + } if(($writable != (-1)) && ($writable != $importer['writable'])) { q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1", @@ -212,31 +215,31 @@ function dfrn_notify_post(&$a) { // load the template for private message notifications $tpl = get_intltext_template('mail_received_html_body_eml.tpl'); $email_html_body_tpl = replace_macros($tpl,array( - '$siteName' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $importer['thumb'], // thumbnail url for sender icon - '$email' => $importer['email'], // email address to send to - '$url' => $importer['url'], // full url for the site - '$from' => $msg['from-name'], // name of the person sending the message + '$siteName' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $importer['thumb'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $importer['url'], // full url for the site + '$from' => $msg['from-name'], // name of the person sending the message '$title' => stripslashes($msg['title']), // subject of the message '$htmlversion' => $msg['htmlversion'], // html version of the message '$mimeboundary' => $msg['mimeboundary'], // mime message divider - '$hostname' => $a->get_hostname() // name of this host + '$hostname' => $a->get_hostname() // name of this host )); // load the template for private message notifications $tpl = get_intltext_template('mail_received_text_body_eml.tpl'); $email_text_body_tpl = replace_macros($tpl,array( - '$siteName' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $importer['thumb'], // thumbnail url for sender icon - '$email' => $importer['email'], // email address to send to - '$url' => $importer['url'], // full url for the site - '$from' => $msg['from-name'], // name of the person sending the message + '$siteName' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$thumb' => $importer['thumb'], // thumbnail url for sender icon + '$email' => $importer['email'], // email address to send to + '$url' => $importer['url'], // full url for the site + '$from' => $msg['from-name'], // name of the person sending the message '$title' => stripslashes($msg['title']), // subject of the message '$textversion' => $msg['textversion'], // text version of the message '$mimeboundary' => $msg['mimeboundary'], // mime message divider - '$hostname' => $a->get_hostname() // name of this host + '$hostname' => $a->get_hostname() // name of this host )); // use the EmailNotification library to send the message @@ -408,27 +411,27 @@ function dfrn_notify_post(&$a) { // load the template for private message notifications $tpl = get_intltext_template('cmnt_received_html_body_eml.tpl'); $email_html_body_tpl = replace_macros($tpl,array( - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon - '$email' => $importer['email'], // email address to send to + '$email' => $importer['email'], // email address to send to '$url' => $datarray['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message - '$body' => 'q1' .$msg['htmlversion'], // html version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$from' => $from, // name of the person sending the message + '$body' => 'q1' .$msg['htmlversion'], // html version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nick'] . '/' . $posted_id, )); // load the template for private message notifications $tpl = get_intltext_template('cmnt_received_text_body_eml.tpl'); $email_text_body_tpl = replace_macros($tpl,array( - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site + '$sitename' => $a->config['sitename'], // name of this site + '$siteurl' => $a->get_baseurl(), // descriptive url of this site '$thumb' => $datarray['author-avatar'], // thumbnail url for sender icon - '$email' => $importer['email'], // email address to send to + '$email' => $importer['email'], // email address to send to '$url' => $datarray['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message - '$body' => $msg['textversion'], // text version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$from' => $from, // name of the person sending the message + '$body' => $msg['textversion'], // text version of the message + '$display' => $a->get_baseurl() . '/display/' . $importer['nick'] . '/' . $posted_id, )); // use the EmailNotification library to send the message @@ -539,9 +542,9 @@ function dfrn_notify_post(&$a) { '$siteurl' => $a->get_baseurl(), // descriptive url of this site '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon '$url' => $conv['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$from' => $from, // name of the person sending the message '$body' => $msg['htmlversion'], // html version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$display' => $a->get_baseurl() . '/display/' . $importer['nick'] . '/' . $posted_id, )); // load the template for private message notifications @@ -551,9 +554,9 @@ function dfrn_notify_post(&$a) { '$siteurl' => $a->get_baseurl(), // descriptive url of this site '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon '$url' => $conv['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$from' => $from, // name of the person sending the message '$body' => $msg['textversion'], // text version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$display' => $a->get_baseurl() . '/display/' . $importer['nick'] . '/' . $posted_id, )); // use the EmailNotification library to send the message diff --git a/mod/item.php b/mod/item.php index 0b5e32e888..8c9e004c3f 100644 --- a/mod/item.php +++ b/mod/item.php @@ -485,12 +485,12 @@ function item_post(&$a) { $email_html_body_tpl = replace_macros($tpl,array( '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$thumb' => $author['thumb'], // thumbnail url for sender icon '$email' => $importer['email'], // email address to send to - '$url' => $conv['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$url' => $author['url'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['htmlversion'], // html version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$display' => $a->get_baseurl() . '/display/' . $author['nick'] . '/' . $post_id, )); // load the template for private message notifications @@ -498,12 +498,12 @@ function item_post(&$a) { $email_text_body_tpl = replace_macros($tpl,array( '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon + '$thumb' => $author['thumb'], // thumbnail url for sender icon '$email' => $importer['email'], // email address to send to - '$url' => $conv['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$url' => $author['url'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['textversion'], // text version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$display' => $a->get_baseurl() . '/display/' . $author['nick'] . '/' . $post_id, )); // use the EmailNotification library to send the message @@ -548,11 +548,11 @@ function item_post(&$a) { $email_html_body_tpl = replace_macros($tpl,array( '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon - '$url' => $conv['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$thumb' => $author['thumb'], // thumbnail url for sender icon + '$url' => $author['url'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['htmlversion'], // html version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$display' => $a->get_baseurl() . '/display/' . $author['nick'] . '/' . $post_id, )); // load the template for private message notifications @@ -560,11 +560,11 @@ function item_post(&$a) { $email_text_body_tpl = replace_macros($tpl,array( '$sitename' => $a->config['sitename'], // name of this site '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $conv['author-avatar'], // thumbnail url for sender icon - '$url' => $conv['author-link'], // full url for the site - '$from' => $from, // name of the person sending the message + '$thumb' => $author['thumb'], // thumbnail url for sender icon + '$url' => $author['url'], // full url for the site + '$from' => $from, // name of the person sending the message '$body' => $msg['textversion'], // text version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $r, + '$display' => $a->get_baseurl() . '/display/' . $author['nick'] . '/' . $post_id, )); // use the EmailNotification library to send the message @@ -589,6 +589,9 @@ function item_post(&$a) { dbesc(datetime_convert()), intval($post_id) ); + foreach( $r as $key => $val) { + logger("key: " . $key . " val: " . $val); + } // photo comments turn the corresponding item visible to the profile wall // This way we don't see every picture in your new photo album posted to your wall at once.