diff options
-rw-r--r-- | boot.php | 8 | ||||
-rw-r--r-- | database.sql | 20 | ||||
-rw-r--r-- | include/diaspora.php | 13 | ||||
-rw-r--r-- | include/enotify.php | 203 | ||||
-rw-r--r-- | include/items.php | 245 | ||||
-rw-r--r-- | include/notifier.php | 8 | ||||
-rw-r--r-- | include/poller.php | 2 | ||||
-rw-r--r-- | mod/dfrn_confirm.php | 13 | ||||
-rw-r--r-- | mod/dfrn_request.php | 30 | ||||
-rw-r--r-- | mod/item.php | 144 | ||||
-rw-r--r-- | mod/network.php | 25 | ||||
-rw-r--r-- | mod/notifications.php | 2 | ||||
-rw-r--r-- | mod/profile.php | 12 | ||||
-rw-r--r-- | mod/settings.php | 2 | ||||
-rw-r--r-- | update.php | 26 | ||||
-rw-r--r-- | view/de/cmnt_received_html_body_eml.tpl | 12 | ||||
-rw-r--r-- | view/de/mail_received_html_body_eml.tpl | 11 | ||||
-rw-r--r-- | view/de/wall_received_html_body_eml.tpl | 24 | ||||
-rw-r--r-- | view/de/wall_received_text_body_eml.tpl | 18 | ||||
-rw-r--r-- | view/email_notify_html.tpl | 27 | ||||
-rw-r--r-- | view/email_notify_text.tpl | 13 | ||||
-rw-r--r-- | view/en/mail_received_html_body_eml.tpl | 2 | ||||
-rw-r--r-- | view/intros.tpl | 1 | ||||
-rw-r--r-- | view/suggestions.tpl | 1 |
24 files changed, 495 insertions, 367 deletions
@@ -9,9 +9,9 @@ require_once('include/nav.php'); require_once('include/cache.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica'); -define ( 'FRIENDICA_VERSION', '2.3.1202' ); +define ( 'FRIENDICA_VERSION', '2.3.1213' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); -define ( 'DB_UPDATE_VERSION', 1112 ); +define ( 'DB_UPDATE_VERSION', 1114 ); define ( 'EOL', "<br />\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -701,7 +701,7 @@ function login($register = false, $hiddens=false) { '$lpassword' => array('password', t('Password: '), '', ''), '$openid' => !$noid, - '$lopenid' => array('openid_url', t('OpenID: '),'',''), + '$lopenid' => array('openid_url', t('Or login using OpenID: '),'',''), '$hiddens' => $hiddens, @@ -830,7 +830,7 @@ function profile_load(&$a, $nickname, $profile = 0) { } if(($r === false) || (! count($r))) { - notice( t('No profile') . EOL ); + notice( t('Requested profile is not available.') . EOL ); $a->error = 404; return; } diff --git a/database.sql b/database.sql index e96aff4b7..4dc1973ed 100644 --- a/database.sql +++ b/database.sql @@ -731,3 +731,23 @@ CREATE TABLE IF NOT EXISTS `conv` ( INDEX ( `created` ), INDEX ( `updated` ) ) ENGINE = MyISAM DEFAULT CHARSET=utf8; + + +CREATE TABLE IF NOT EXISTS `notify` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`type` INT( 11 ) NOT NULL , +`name` CHAR( 255 ) NOT NULL , +`url` CHAR( 255 ) NOT NULL , +`photo` CHAR( 255 ) NOT NULL , +`date` DATETIME NOT NULL , +`msg` MEDIUMTEXT NOT NULL , +`uid` INT NOT NULL , +`link` CHAR( 255 ) NOT NULL , +`seen` TINYINT( 1 ) NOT NULL DEFAULT '0', +`verb` CHAR( 255 ) NOT NULL, +`otype` CHAR( 16 ) NOT NULL, +INDEX ( `type` ), +INDEX ( `uid` ), +INDEX ( `seen` ), +INDEX ( `date` ) +) ENGINE = MyISAM DEFAULT CHARSET=utf8; diff --git a/include/diaspora.php b/include/diaspora.php index d1e975a89..2d139c77c 100644 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -1223,6 +1223,19 @@ function diaspora_conversation($importer,$xml,$msg) { dbesc(datetime_convert()), intval($conversation['id']) ); + + require_once('include/enotify.php'); + notification(array( + 'type' => NOTIFY_MAIL, + 'notify_flags' => $importer['notify-flags'], + 'language' => $importer['language'], + 'to_name' => $importer['username'], + 'to_email' => $importer['email'], + 'item' => array('subject' => $subject, 'body' => $body), + 'source_name' => $person['name'], + 'source_link' => $person['url'], + 'source_photo' => $person['thumb'], + )); } return; diff --git a/include/enotify.php b/include/enotify.php new file mode 100644 index 000000000..f6f291e5d --- /dev/null +++ b/include/enotify.php @@ -0,0 +1,203 @@ +<?php + +function notification($params) { + + logger('notification: entry', LOGGER_DEBUG); + + $a = get_app(); + $banner = t('Friendica Notification'); + $product = FRIENDICA_PLATFORM; + $siteurl = z_path(); + $thanks = t('Thank You,'); + $sitename = get_config('config','sitename'); + $site_admin = sprintf( t('%s Administrator'), $sitename); + + $sender_name = $product; + $sender_email = t('noreply') . '@' . $a->get_hostname(); + + if(array_key_exists('item',$params)) { + $title = $params['item']['title']; + $body = $params['item']['body']; + } + else { + $title = $body = ''; + } + + if($params['type'] == NOTIFY_MAIL) { + + $subject = sprintf( t('New mail received at %s'),$sitename); + + $preamble = sprintf( t('%s sent you a new private message at %s.'),$params['source_name'],$sitename); + + $sitelink = t('Please visit %s to view and/or reply to your private messages.'); + $tsitelink = sprintf( $sitelink, $siteurl . '/message' ); + $hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '/message">' . $sitename . '</a>'); + $itemlink = ''; + } + + if($params['type'] == NOTIFY_COMMENT) { + + $subject = sprintf( t('%s commented on an item at %s'), $params['source_name'], $sitename); + $preamble = sprintf( t('%s commented on an item/conversation you have been following.'), $params['source_name']); + $sitelink = t('Please visit %s to view and/or reply to the conversation.'); + $tsitelink = sprintf( $sitelink, $siteurl ); + $hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>'); + $itemlink = $params['link']; + } + + if($params['type'] == NOTIFY_WALL) { + $preamble = $subject = sprintf( t('%s posted to your profile wall at %s') , $params['source_name'], $sitename); + + $sitelink = t('Please visit %s to view and/or reply to the conversation.'); + $tsitelink = sprintf( $sitelink, $siteurl ); + $hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>'); + $itemlink = $params['link']; + } + + if($params['type'] == NOTIFY_INTRO) { + $subject = sprintf( t('Introduction received at %s'), $sitename); + $preamble = sprintf( t('You\'ve received an introduction from \'%s\' at %s'), $params['source_name'], $sitename); + $body = sprintf( t('You may visit their profile at %s'),$params['source_link']); + + $sitelink = t('Please visit %s to approve or reject the introduction.'); + $tsitelink = sprintf( $sitelink, $siteurl ); + $hsitelink = sprintf( $sitelink, '<a href="' . $siteurl . '">' . $sitename . '</a>'); + $itemlink = $params['link']; + } + + if($params['type'] == NOTIFY_CONFIRM) { + + } + + // TODO - create notification entry in DB + + + + // send email notification if notification preferences permit + + require_once('bbcode.php'); + if(intval($params['notify_flags']) & intval($params['type'])) { + + logger('notification: sending notification email'); + + push_lang($params['language']); + + $textversion = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n", + $body))),ENT_QUOTES,'UTF-8')); + $htmlversion = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), + "<br />\n",$body)))); + + // load the template for private message notifications + $tpl = get_markup_template('email_notify_html.tpl'); + $email_html_body = replace_macros($tpl,array( + '$banner' => $banner, + '$product' => $product, + '$preamble' => $preamble, + '$sitename' => $sitename, + '$siteurl' => $siteurl, + '$source_name' => $parama['source_name'], + '$source_link' => $params['source_link'], + '$source_photo' => $params['source_photo'], + '$username' => $params['to_name'], + '$hsitelink' => $hsitelink, + '$itemlink' => '<a href="' . $itemlink . '">' . $itemlink . '</a>', + '$thanks' => $thanks, + '$site_admin' => $site_admin, + '$title' => stripslashes($title), + '$htmlversion' => $htmlversion, + )); + + // load the template for private message notifications + $tpl = get_markup_template('email_notify_text.tpl'); + $email_text_body = replace_macros($tpl,array( + '$banner' => $banner, + '$product' => $product, + '$preamble' => $preamble, + '$sitename' => $sitename, + '$siteurl' => $siteurl, + '$source_name' => $parama['source_name'], + '$source_link' => $params['source_link'], + '$source_photo' => $params['source_photo'], + '$username' => $params['to_name'], + '$tsitelink' => $tsitelink, + '$itemlink' => $itemlink, + '$thanks' => $thanks, + '$site_admin' => $site_admin, + '$title' => stripslashes($title), + '$textversion' => $textversion, + )); + +// logger('text: ' . $email_text_body); + + // use the EmailNotification library to send the message + + enotify::send(array( + 'fromName' => $sender_name, + 'fromEmail' => $sender_email, + 'replyTo' => $sender_email, + 'toEmail' => $params['to_email'], + 'messageSubject' => $subject, + 'htmlVersion' => $email_html_body, + 'textVersion' => $email_text_body + )); + pop_lang(); + } +} + +require_once('include/email.php'); + +class enotify { + /** + * Send a multipart/alternative message with Text and HTML versions + * + * @param fromName name of the sender + * @param fromEmail email fo the sender + * @param replyTo replyTo address to direct responses + * @param toEmail destination email address + * @param messageSubject subject of the message + * @param htmlVersion html version of the message + * @param textVersion text only version of the message + */ + static public function send($params) { + + $fromName = email_header_encode($params['fromName'],'UTF-8'); + $messageSubject = email_header_encode($params['messageSubject'],'UTF-8'); + + // generate a mime boundary + $mimeBoundary =rand(0,9)."-" + .rand(10000000000,9999999999)."-" + .rand(10000000000,9999999999)."=:" + .rand(10000,99999); + + // generate a multipart/alternative message header + $messageHeader = + "From: {$params['fromName']} <{$params['fromEmail']}>\n" . + "Reply-To: {$params['fromName']} <{$params['replyTo']}>\n" . + "MIME-Version: 1.0\n" . + "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\""; + + // assemble the final multipart message body with the text and html types included + $textBody = chunk_split(base64_encode($params['textVersion'])); + $htmlBody = chunk_split(base64_encode($params['htmlVersion'])); + $multipartMessageBody = + "--" . $mimeBoundary . "\n" . // plain text section + "Content-Type: text/plain; charset=UTF-8\n" . + "Content-Transfer-Encoding: base64\n\n" . + $textBody . "\n" . + "--" . $mimeBoundary . "\n" . // text/html section + "Content-Type: text/html; charset=UTF-8\n" . + "Content-Transfer-Encoding: base64\n\n" . + $htmlBody . "\n" . + "--" . $mimeBoundary . "--\n"; // message ending + + // send the message + $res = mail( + $params['toEmail'], // send to address + $params['messageSubject'], // subject + $multipartMessageBody, // message body + $messageHeader // message headers + ); + logger("notification: enotify::send returns " . $res, LOGGER_DEBUG); + } +} +?>
\ No newline at end of file diff --git a/include/items.php b/include/items.php index 50c5e56c1..9becb9ffb 100644 --- a/include/items.php +++ b/include/items.php @@ -1822,84 +1822,25 @@ function local_delivery($importer,$data) { $r = dbq("INSERT INTO `mail` (`" . implode("`, `", array_keys($msg)) . "`) VALUES ('" . implode("', '", array_values($msg)) . "')" ); - // send email notification if requested. - - require_once('bbcode.php'); - if($importer['notify-flags'] & NOTIFY_MAIL) { - - push_lang($importer['language']); - - // name of the automated email sender - $msg['notificationfromname'] = t('Administrator'); - // noreply address to send from - $msg['notificationfromemail'] = t('noreply') . '@' . $a->get_hostname(); - - // text version - // process the message body to display properly in text mode - // 1) substitute a \n character for the "\" then "n", so it behaves properly (it doesn't come in as a \n character) - // 2) remove escape slashes - // 3) decode any bbcode from the message editor - // 4) decode any encoded html tags - // 5) remove html tags - $msg['textversion'] - = strip_tags(html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r", "\\n"), "\n",$msg['body']))),ENT_QUOTES,'UTF-8')); - - // html version - // process the message body to display properly in text mode - // 1) substitute a <br /> tag for the "\" then "n", so it behaves properly (it doesn't come in as a \n character) - // 2) remove escape slashes - // 3) decode any bbcode from the message editor - // 4) decode any encoded html tags - $msg['htmlversion'] - = html_entity_decode(bbcode(stripslashes(str_replace(array("\\r\\n", "\\r","\\n\\n" ,"\\n"), "<br />\n",$msg['body'])))); - - // 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( - '$username' => $importer['username'], - '$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 - )); + // send notifications. + + require_once('include/enotify.php'); + + $notif_params = array( + 'type' => NOTIFY_MAIL, + 'notify_flags' => $importer['notify-flags'], + 'language' => $importer['language'], + 'to_name' => $importer['username'], + 'to_email' => $importer['email'], + 'item' => $msg, + 'source_name' => $msg['from-name'], + 'source_link' => $importer['url'], + 'source_photo' => $importer['thumb'], + ); - // 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( - '$username' => $importer['username'], - '$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 - )); - - // use the EmailNotification library to send the message - require_once("include/EmailNotification.php"); - EmailNotification::sendTextHtmlEmail( - $msg['notificationfromname'], - $msg['notificationfromemail'], - $msg['notificationfromemail'], - $importer['email'], - t('New mail received at ') . $a->config['sitename'], - $email_html_body_tpl, - $email_text_body_tpl - ); - - pop_lang(); - } + notification($notif_params); return 0; + // NOTREACHED } @@ -2151,68 +2092,24 @@ function local_delivery($importer,$data) { proc_run('php',"include/notifier.php","comment-import","$posted_id"); - if((! $is_like) && ($importer['notify-flags'] & NOTIFY_COMMENT) && (! $importer['self'])) { - push_lang($importer['language']); - require_once('bbcode.php'); - $from = stripslashes($datarray['author-name']); - - // 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"), "<br />\n",$datarray['body'])))); - - $imgtouse = ((link_compare($datarray['author-link'],$importer['url'])) ? $importer['thumb'] : $datarray['author-avatar']); - - // 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( - '$username' => $importer['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $imgtouse, // 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['htmlversion'], // html version of the message - '$display' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $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( - '$username' => $importer['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $imgtouse, // 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'] . '/' . $posted_id, + if((! $is_like) && (! $importer['self'])) { + + require_once('include/enotify.php'); + + notification(array( + 'type' => NOTIFY_COMMENT, + 'notify_flags' => $importer['notify-flags'], + 'language' => $importer['language'], + 'to_name' => $importer['username'], + 'to_email' => $importer['email'], + 'item' => $datarray, + 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, + 'source_name' => stripslashes($datarray['author-name']), + 'source_link' => $datarray['author-link'], + 'source_photo' => ((link_compare($datarray['author-link'],$importer['url'])) + ? $importer['thumb'] : $datarray['author-avatar']) )); - // 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'], - sprintf( t('%s commented on an item at %s'), $from , $a->config['sitename']), - $email_html_body_tpl, - $email_text_body_tpl - ); - pop_lang(); } } return 0; @@ -2299,78 +2196,36 @@ function local_delivery($importer,$data) { // find out if our user is involved in this conversation and wants to be notified. - if(($datarray['type'] != 'activity') && ($importer['notify-flags'] & NOTIFY_COMMENT)) { + if($datarray['type'] != 'activity') { $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']) ); + if(count($myconv)) { $importer_url = $a->get_baseurl() . '/profile/' . $importer['nickname']; foreach($myconv as $conv) { + if(! link_compare($conv['author-link'],$importer_url)) continue; - push_lang($importer['language']); - require_once('bbcode.php'); - $from = stripslashes($datarray['author-name']); - - // 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"), "<br />\n",$datarray['body'])))); - - $imgtouse = ((link_compare($datarray['author-link'],$importer['url'])) ? $importer['thumb'] : $datarray['author-avatar']); - - - // 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( - '$username' => $importer['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $imgtouse, // thumbnail url for sender icon - '$url' => $datarray['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'] . '/' . $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( - '$username' => $importer['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $imgtouse, // thumbnail url for sender icon - '$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'] . '/' . $posted_id, + require_once('include/enotify.php'); + + notification(array( + 'type' => NOTIFY_COMMENT, + 'notify_flags' => $importer['notify-flags'], + 'language' => $importer['language'], + 'to_name' => $importer['username'], + 'to_email' => $importer['email'], + 'item' => $datarray, + 'link' => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id, + 'source_name' => stripslashes($datarray['author-name']), + 'source_link' => $datarray['author-link'], + 'source_photo' => ((link_compare($datarray['author-link'],$importer['url'])) + ? $importer['thumb'] : $datarray['author-avatar']) )); - // 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'], - sprintf( t('%s commented on an item at %s'), $from , $a->config['sitename']), - $email_html_body_tpl, - $email_text_body_tpl - ); - pop_lang(); break; } } diff --git a/include/notifier.php b/include/notifier.php index 2562f09eb..1db1b09da 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -626,7 +626,13 @@ function notifier_run($argv, $argc){ $reply_to = $r1[0]['reply_to']; $subject = (($it['title']) ? $it['title'] : t("\x28no subject\x29")) ; - $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n"; + + // only expose our real email address to true friends + + if($contact['rel'] == CONTACT_IS_FRIEND) + $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n"; + else + $headers = 'From: ' . $local_user[0]['username'] . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; if($reply_to) $headers .= 'Reply-to: ' . $reply_to . "\n"; diff --git a/include/poller.php b/include/poller.php index d568bbd03..89e4488b9 100644 --- a/include/poller.php +++ b/include/poller.php @@ -140,7 +140,7 @@ function poller_run($argv, $argc){ if($manual_id) $contact['last-update'] = '0000-00-00 00:00:00'; - if($contact['network'] === NETWORK_DFRN) + if($contact['network'] === NETWORK_DFRN || $contact['network'] === NETWORK_OSTATUS) $contact['priority'] = 2; if($contact['priority'] || $contact['subhub']) { diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index ce6f4f95f..1b0985cef 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -71,12 +71,14 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $dfrn_id = $handsfree['dfrn_id']; $intro_id = $handsfree['intro_id']; $duplex = $handsfree['duplex']; + $hidden = ((array_key_exists('hidden',$handsfree)) ? intval($handsfree['hidden']) : 0 ); } else { $dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : ""); $intro_id = ((x($_POST,'intro_id')) ? intval($_POST['intro_id']) : 0 ); $duplex = ((x($_POST,'duplex')) ? intval($_POST['duplex']) : 0 ); $cid = ((x($_POST,'contact_id')) ? intval($_POST['contact_id']) : 0 ); + $hidden = ((x($_POST,'hidden')) ? intval($_POST['hidden']) : 0 ); } /** @@ -122,7 +124,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $site_pubkey = $contact['site-pubkey']; $dfrn_confirm = $contact['confirm']; $aes_allow = $contact['aes_allow']; - + $network = ((strlen($contact['issued-id'])) ? NETWORK_DFRN : NETWORK_OSTATUS); if($contact['network']) @@ -316,7 +318,8 @@ function dfrn_confirm_post(&$a,$handsfree = null) { if(($relation == CONTACT_IS_SHARING) && ($duplex)) $duplex = 0; - $r = q("UPDATE `contact` SET `photo` = '%s', + $r = q("UPDATE `contact` SET + `photo` = '%s', `thumb` = '%s', `micro` = '%s', `rel` = %d, @@ -326,6 +329,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { `blocked` = 0, `pending` = 0, `duplex` = %d, + `hidden` = %d, `network` = 'dfrn' WHERE `id` = %d LIMIT 1 ", dbesc($photos[0]), @@ -336,6 +340,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc(datetime_convert()), dbesc(datetime_convert()), intval($duplex), + intval($hidden), intval($contact_id) ); } @@ -387,6 +392,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { `pending` = 0, `network` = '%s', `writable` = %d, + `hidden` = %d, `rel` = %d WHERE `id` = %d LIMIT 1 ", @@ -400,6 +406,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($poll), dbesc($network), intval($writable), + intval($hidden), intval($new_relation), intval($contact_id) ); @@ -423,7 +430,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1", intval($uid) ); - if((count($r)) && ($r[0]['hide-friends'] == 0) && (is_array($contact)) && isset($new_relation) && ($new_relation == CONTACT_IS_FRIEND)) { + if((count($r)) && (! $hidden) && ($r[0]['hide-friends'] == 0) && (is_array($contact)) && isset($new_relation) && ($new_relation == CONTACT_IS_FRIEND)) { if($r[0]['network'] === NETWORK_DIASPORA) { require_once('include/diaspora.php'); diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index d7c918490..a96860403 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -568,24 +568,22 @@ function dfrn_request_content(&$a) { if(count($r)) { if($r[0]['page-flags'] != PAGE_NORMAL) $auto_confirm = true; - if(($r[0]['notify-flags'] & NOTIFY_INTRO) && (! $auto_confirm)) { - $email_tpl = get_intltext_template('request_notify_eml.tpl'); - $email = replace_macros($email_tpl, array( - '$requestor' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), - '$url' => stripslashes($r[0]['url']), - '$myname' => $r[0]['username'], - '$siteurl' => $a->get_baseurl(), - '$sitename' => $a->config['sitename'] + + if(! $auto_confirm) { + require_once('include/enotify.php'); + notification(array( + 'type' => NOTIFY_INTRO, + 'notify_flags' => $r[0]['notify-flags'], + 'language' => $r[0]['language'], + 'to_name' => $r[0]['username'], + 'to_email' => $r[0]['email'], + 'link' => $a->get_baseurl() . '/notifications/intros', + 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')), + 'source_link' => $r[0]['url'], + 'source_photo' => $r[0]['photo'] )); - $res = mail($r[0]['email'], - t("Introduction received at ") . $a->config['sitename'], - $email, - 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n" - . 'Content-type: text/plain; charset=UTF-8' . "\n" - . 'Content-transfer-encoding: 8bit' ); - - // This is a redundant notification - no point throwing errors if it fails. } + if($auto_confirm) { require_once('mod/dfrn_confirm.php'); $handsfree = array( diff --git a/mod/item.php b/mod/item.php index f72b17fc1..ece92f0f3 100644 --- a/mod/item.php +++ b/mod/item.php @@ -16,6 +16,7 @@ */ require_once('include/crypto.php'); +require_once('include/enotify.php'); function item_post(&$a) { @@ -679,68 +680,20 @@ function item_post(&$a) { intval($post_id) ); - // Send a notification email to the conversation owner, unless the owner is me and I wrote this item - if(($user['notify-flags'] & NOTIFY_COMMENT) && ($contact_record != $author)) { - push_lang($user['language']); - require_once('bbcode.php'); - $from = $author['name']; - - // 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"), "<br />\n",$datarray['body'])))); - - // 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( - '$username' => $user['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $author['thumb'], // thumbnail url for sender icon - '$email' => $importer['email'], // email address to send to - '$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/' . $user['nickname'] . '/' . $post_id, + if($contact_record != $author) { + notification(array( + 'type' => NOTIFY_COMMENT, + 'notify_flags' => $user['notify-flags'], + 'language' => $user['language'], + 'to_name' => $user['username'], + 'to_email' => $user['email'], + 'item' => $datarray, + 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, + 'source_name' => $datarray['author-name'], + 'source_link' => $datarray['author-link'], + 'source_photo' => $datarray['author-avatar'] )); - // 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( - '$username' => $user['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$thumb' => $author['thumb'], // thumbnail url for sender icon - '$email' => $importer['email'], // email address to send to - '$url' => $author['url'], // profile url for the author - '$from' => $from, // name of the person sending the message - '$body' => $msg['textversion'], // text version of the message - '$display' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, - )); - - // 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'], - sprintf( t('%s commented on an item at %s'), $from , $a->config['sitename']), - $email_html_body_tpl, - $email_text_body_tpl - ); - - pop_lang(); } // We won't be able to sign Diaspora comments for authenticated visitors - we don't have their private key @@ -767,66 +720,19 @@ function item_post(&$a) { else { $parent = $post_id; - // let me know if somebody did a wall-to-wall post on my profile - - if(($user['notify-flags'] & NOTIFY_WALL) && ($contact_record != $author)) { - push_lang($user['language']); - require_once('bbcode.php'); - $from = $author['name']; - - // 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"), "<br />\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( - '$username' => $user['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$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/' . $user['nickname'] . '/' . $post_id, + if($contact_record != $author) { + notification(array( + 'type' => NOTIFY_WALL, + 'notify_flags' => $user['notify-flags'], + 'language' => $user['language'], + 'to_name' => $user['username'], + 'to_email' => $user['email'], + 'item' => $datarray, + 'link' => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id, + 'source_name' => $datarray['author-name'], + 'source_link' => $datarray['author-link'], + 'source_photo' => $datarray['author-avatar'] )); - - // 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( - '$username' => $user['username'], - '$sitename' => $a->config['sitename'], // name of this site - '$siteurl' => $a->get_baseurl(), // descriptive url of this site - '$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/' . $user['nickname'] . '/' . $post_id, - )); - - // 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'], - sprintf( t('%s posted to your profile wall at %s') , $from , $a->config['sitename']), - $email_html_body_tpl, - $email_text_body_tpl - ); - pop_lang(); } } diff --git a/mod/network.php b/mod/network.php index 57e120e86..55f5a8c95 100644 --- a/mod/network.php +++ b/mod/network.php @@ -271,12 +271,17 @@ function network_content(&$a, $update = 0) { // that belongs to you, hence you can see all of it. We will filter by group if // desired. - $star_sql = (($star) ? " AND `starred` = 1 " : ''); - if($bmark) - $star_sql .= " AND `bookmark` = 1 "; + $sql_options = (($star) ? " and starred = 1 " : ''); + $sql_options .= (($bmark) ? " and bookmark = 1 " : ''); - $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql ) "; + + $sql_new = ''; + $sql_items = ''; + $sql_update = ''; + + + $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $sql_options ) "; if($group) { $r = q("SELECT `name`, `id` FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1", @@ -300,21 +305,19 @@ function network_content(&$a, $update = 0) { info( t('Group is empty')); } - -// $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; - $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $star_sql AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; + $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND ( `contact-id` IN ( $contact_str ) OR `allow_gid` REGEXP '<" . intval($group) . ">' )) "; $o = '<h2>' . t('Group: ') . $r[0]['name'] . '</h2>' . $o; } elseif($cid) { - $r = q("SELECT `id`,`name`,`network`,`writable` FROM `contact` WHERE `id` = %d + $r = q("SELECT `id`,`name`,`network`,`writable`,`nurl` FROM `contact` WHERE `id` = %d AND `blocked` = 0 AND `pending` = 0 LIMIT 1", intval($cid) ); if(count($r)) { - $sql_extra = " AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` $star_sql AND `contact-id` IN ( " . intval($cid) . " )) "; + $sql_extra = " AND `item`.`parent` IN ( SELECT DISTINCT(`parent`) FROM `item` WHERE 1 $sql_options AND `contact-id` = " . intval($cid) . " ) "; $o = '<h2>' . t('Contact: ') . $r[0]['name'] . '</h2>' . $o; - if($r[0]['network'] !== NETWORK_MAIL && $r[0]['network'] !== NETWORK_DFRN && $r[0]['network'] !== NETWORK_FACEBOOK && $r[0]['network'] !== NETWORK_DIASPORA && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { + if($r[0]['network'] === NETWORK_OSTATUS && $r[0]['writable'] && (! get_pconfig(local_user(),'system','nowarn_insecure'))) { notice( t('Private messages to this person are at risk of public disclosure.') . EOL); } @@ -432,7 +435,7 @@ function network_content(&$a, $update = 0) { $r = q("SELECT distinct(`parent`) AS `item_id`, `contact`.`uid` AS `contact_uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 - and `item`.`parent` in ( select parent from item where unseen = 1 ) + and `item`.`unseen` = 1 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 $sql_extra ", intval(local_user()) diff --git a/mod/notifications.php b/mod/notifications.php index 5733e6e57..910b84e32 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -141,6 +141,7 @@ function notifications_content(&$a) { '$photo' => ((x($rr,'fphoto')) ? $rr['fphoto'] : "images/default-profile.jpg"), '$fullname' => $rr['fname'], '$url' => $rr['furl'], + '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''), '$knowyou' => $knowyou, '$approve' => t('Approve'), '$note' => $rr['note'], @@ -185,6 +186,7 @@ function notifications_content(&$a) { '$contact_id' => $rr['contact-id'], '$photo' => ((x($rr,'photo')) ? $rr['photo'] : "images/default-profile.jpg"), '$fullname' => $rr['name'], + '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['hidden'] == 1), ''), '$url' => $rr['url'], '$knowyou' => $knowyou, '$approve' => t('Approve'), diff --git a/mod/profile.php b/mod/profile.php index d2f9d7e29..946499895 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -7,9 +7,15 @@ function profile_init(&$a) { if($a->argc > 1) $which = $a->argv[1]; else { - notice( t('No profile') . EOL ); - $a->error = 404; - return; + $r = q("select nickname from user where blocked = 0 and account_expired = 0 and verified = 1 order by rand() limit 1"); + if(count($r)) { + $which = $r[0]['nickname']; + } + else { + notice( t('Requested profile is not available.') . EOL ); + $a->error = 404; + return; + } } $profile = 0; diff --git a/mod/settings.php b/mod/settings.php index ad22ba1a6..35902f831 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -574,7 +574,7 @@ function settings_content(&$a) { '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''), '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''), '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''), - '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TSL'=>'TSL', 'SSL'=>'SSL')), + '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')), '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''), '$mail_pass' => array('mail_pass', t('Email password:'), '', ''), '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'), diff --git a/update.php b/update.php index 9b5772af1..6eade22f7 100644 --- a/update.php +++ b/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1112 ); +define( 'UPDATE_VERSION' , 1114 ); /** * @@ -948,3 +948,27 @@ function update_1111() { q("ALTER TABLE `gcontact` ADD `connect` CHAR( 255 ) NOT NULL "); } + +function update_1112() { + + q("CREATE TABLE IF NOT EXISTS `notify` ( +`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , +`type` INT( 11 ) NOT NULL , +`name` CHAR( 255 ) NOT NULL , +`url` CHAR( 255 ) NOT NULL , +`photo` CHAR( 255 ) NOT NULL , +`date` DATETIME NOT NULL , +`msg` MEDIUMTEXT NOT NULL , +`uid` INT NOT NULL , +`link` CHAR( 255 ) NOT NULL , +`seen` TINYINT( 1 ) NOT NULL DEFAULT '0' +) ENGINE = MYISAM "); + + q("ALTER TABLE `notify` ADD INDEX ( `type` ), ADD INDEX ( `uid`), ADD INDEX (`seen`), ADD INDEX (`date`) "); + +} + +function update_1113() { + q("ALTER TABLE `notify` ADD `verb` CHAR( 255 ) NOT NULL , +ADD `otype` CHAR( 16 ) NOT NULL"); +} diff --git a/view/de/cmnt_received_html_body_eml.tpl b/view/de/cmnt_received_html_body_eml.tpl index 3904b5f57..db7f829bc 100644 --- a/view/de/cmnt_received_html_body_eml.tpl +++ b/view/de/cmnt_received_html_body_eml.tpl @@ -1,25 +1,25 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> <html> <head> - <title>Friendika Mitteilung</title> + <title>Friendica Nachricht</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head> <body> <table style="border:1px solid #ccc"> <tbody> - <tr><td colspan="2" style="background:#3b5998; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px;" src='$siteurl/images/friendika-32.png'><span style="padding:7px;">Friendika</span></td></tr> + <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">Friendica</div><div style="clear: both;"></div></td></tr> - <tr><td style="padding-top:22px;" colspan="2">$from hat einen Pinnwandeintrag kommentiert dem du auch folgst.</td></tr> + <tr><td style="padding-top:22px;" colspan="2">$from hat einen Beitrag kommentiert dem du auch folgst.</td></tr> <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$url"><img style="border:0px;width:48px;height:48px;" src="$thumb"></a></td> <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> <tr><td style="padding-bottom:5px;"></td></tr> <tr><td style="padding-right:22px;">$body</td></tr> - <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2"><a href="$display">Um die gesamte Konversation zu sehen melde dich bitte bei $siteurl an</a>.</td></tr> - <tr><td></td><td>Danke für die Aufmerksamkeit</td></tr> + <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Bitte melde dich an um <a href="$display">die komplette Unterhaltung anzuzeigen</a>.</td></tr> + <tr><td></td><td>Beste Grüße,</td></tr> <tr><td></td><td>$sitename Administrator</td></tr> </tbody> </table> </body> -</html>
\ No newline at end of file +</html> diff --git a/view/de/mail_received_html_body_eml.tpl b/view/de/mail_received_html_body_eml.tpl index 9d0ecf7ae..34eea59da 100644 --- a/view/de/mail_received_html_body_eml.tpl +++ b/view/de/mail_received_html_body_eml.tpl @@ -1,23 +1,24 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> <html> <head> - <title>Friendika Nachricht</title> + <title>Friendica Nachricht</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head> <body> <table style="border:1px solid #ccc"> <tbody> - <tr><td colspan="2" style="background:#3b5998; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px;" src='$siteurl/images/freindika-32.png'><span style="padding:7px;">Friendika</span></td></tr> + <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">Friendica</div><div style="clear: both;"></div></td></tr> - <tr><td style="padding-top:22px;" colspan="2">Du hast eine neue private Nachricht von '$from' auf '$siteName' erhhalten.</td></tr> + + <tr><td style="padding-top:22px;" colspan="2">$fromi hat dir eine private Nachricht auf $siteName gesendet.</td></tr> <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$url"><img style="border:0px;width:48px;height:48px;" src="$thumb"></a></td> <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> <tr><td style="font-weight:bold;padding-bottom:5px;">$title</td></tr> <tr><td style="padding-right:22px;">$htmlversion</td></tr> - <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Bitte melde dich unter <a href="$siteurl"$siteurl</a> an um deine privaten Nachrichte zu lesen und zu beantworten.</td></tr> - <tr><td></td><td>Viele Grüße,</td></tr> + <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Bitte melde dich auf <a href="$siteurl/message">$siteurl/message</a> an um die Nachricht zu bearbeiten.</td></tr> + <tr><td></td><td>Beste Grüße,</td></tr> <tr><td></td><td>$siteName Administrator</td></tr> </tbody> </table> diff --git a/view/de/wall_received_html_body_eml.tpl b/view/de/wall_received_html_body_eml.tpl new file mode 100644 index 000000000..407e4fdce --- /dev/null +++ b/view/de/wall_received_html_body_eml.tpl @@ -0,0 +1,24 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> +<html> +<head> + <title>Friendica Nachricht</title> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> +</head> +<body> +<table style="border:1px solid #ccc"> + <tbody> + <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">Friendica</div><div style="clear: both;"></div></td></tr> + + <tr><td style="padding-top:22px;" colspan="2">$from hat etwas auf deine Pinnwand gepostet.</td></tr> + + + <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$url"><img style="border:0px;width:48px;height:48px;" src="$thumb"></a></td> + <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> + <tr><td style="padding-right:22px;">$body</td></tr> + <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Bitte melde dich auf <a href="$siteurl">$siteurl</a> an um <a href="$display">den Eintrag anzusehen oder ihn zu löschen</a>.</td></tr> + <tr><td></td><td>Beste Grüße,</td></tr> + <tr><td></td><td>$sitename Administrator</td></tr> + </tbody> +</table> +</body> +</html> diff --git a/view/de/wall_received_text_body_eml.tpl b/view/de/wall_received_text_body_eml.tpl new file mode 100644 index 000000000..c627b0c7e --- /dev/null +++ b/view/de/wall_received_text_body_eml.tpl @@ -0,0 +1,18 @@ + +Hallo $username, + + '$from' hat etwas auf deiner Pinnwand gepostet. + +----- +$body +----- + +Bitte melde dich auf $siteurl an um den Beitrag anzusehen oder ihn zu löschen: + +$display + +Besten Dank! + $sitename Administrator + + + diff --git a/view/email_notify_html.tpl b/view/email_notify_html.tpl new file mode 100644 index 000000000..b302c2149 --- /dev/null +++ b/view/email_notify_html.tpl @@ -0,0 +1,27 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional //EN"> +<html> +<head> + <title>$banner</title> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> +</head> +<body> +<table style="border:1px solid #ccc"> + <tbody> + <tr><td colspan="2" style="background:#084769; color:#FFFFFF; font-weight:bold; font-family:'lucida grande', tahoma, verdana,arial, sans-serif; padding: 4px 8px; vertical-align: middle; font-size:16px; letter-spacing: -0.03em; text-align: left;"><img style="width:32px;height:32px; float:left;" src='$siteurl/images/friendica-32.png'><div style="padding:7px; margin-left: 5px; float:left; font-size:18px;letter-spacing:1px;">$product</div><div style="clear: both;"></div></td></tr> + + + <tr><td style="padding-top:22px;" colspan="2">$preamble</td></tr> + + + <tr><td style="padding-left:22px;padding-top:22px;width:60px;" valign="top" rowspan=3><a href="$source_link"><img style="border:0px;width:48px;height:48px;" src="$source_photo"></a></td> + <td style="padding-top:22px;"><a href="$source_link">$source_name</a></td></tr> + <tr><td style="font-weight:bold;padding-bottom:5px;">$title</td></tr> + <tr><td style="padding-right:22px;">$htmlversion</td></tr> + <tr><td style="padding-top:11px;" colspan="2">$hsitelink</td></tr> + <tr><td style="padding-bottom:11px;" colspan="2">$itemlink</td></tr> + <tr><td></td><td>$thanks</td></tr> + <tr><td></td><td>$site_admin</td></tr> + </tbody> +</table> +</body> +</html> diff --git a/view/email_notify_text.tpl b/view/email_notify_text.tpl new file mode 100644 index 000000000..f7f5a4c68 --- /dev/null +++ b/view/email_notify_text.tpl @@ -0,0 +1,13 @@ + +$preamble + +$title + +$textversion + +$tsitelink +$itemlink + +$thanks +$site_admin + diff --git a/view/en/mail_received_html_body_eml.tpl b/view/en/mail_received_html_body_eml.tpl index 23d9ac4c2..bd105a61b 100644 --- a/view/en/mail_received_html_body_eml.tpl +++ b/view/en/mail_received_html_body_eml.tpl @@ -17,7 +17,7 @@ <td style="padding-top:22px;"><a href="$url">$from</a></td></tr> <tr><td style="font-weight:bold;padding-bottom:5px;">$title</td></tr> <tr><td style="padding-right:22px;">$htmlversion</td></tr> - <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Please login at <a href="$siteurl">$siteurl</a> to read and reply to your private messages.</td></tr> + <tr><td style="padding-top:11px;padding-bottom:11px;" colspan="2">Please login at <a href="$siteurl/message">$siteurl/message</a> to read and reply to your private messages.</td></tr> <tr><td></td><td>Thank You,</td></tr> <tr><td></td><td>$siteName Administrator</td></tr> </tbody> diff --git a/view/intros.tpl b/view/intros.tpl index d52c3a7aa..d02fd57e6 100644 --- a/view/intros.tpl +++ b/view/intros.tpl @@ -14,6 +14,7 @@ <div class="intro-form-end"></div> <form class="intro-approve-form" action="dfrn_confirm" method="post"> +{{inc field_checkbox.tpl with $field=$hidden }}{{endinc}} <input type="hidden" name="dfrn_id" value="$dfrn_id" > <input type="hidden" name="intro_id" value="$intro_id" > <input type="hidden" name="contact_id" value="$contact_id" > diff --git a/view/suggestions.tpl b/view/suggestions.tpl index dae551849..656336496 100644 --- a/view/suggestions.tpl +++ b/view/suggestions.tpl @@ -14,6 +14,7 @@ <div class="intro-form-end"></div> <form class="intro-approve-form" action="$request" method="get"> +{{inc field_checkbox.tpl with $field=$hidden }}{{endinc}} <input class="intro-submit-approve" type="submit" name="submit" value="$approve" /> </form> </div> |