From 2e531c103f33e798d979bd9dcda168cc6cb5d3e0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Mon, 8 May 2017 02:00:00 -0700 Subject: error --- Zotlabs/Daemon/Notifier.php | 6 --- Zotlabs/Module/Photo.php | 2 +- include/network.php | 109 +------------------------------------------- 3 files changed, 2 insertions(+), 115 deletions(-) diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 56a9691bc..0e7284793 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -425,12 +425,6 @@ class Notifier { 'hash' => $d['xchan_hash'] ]; } - - if($d['xchan_network'] === 'mail' && $normal_mode) { - $delivery_options = get_xconfig($d['xchan_hash'],'system','delivery_mode'); - if(! $delivery_options) - format_and_send_email($channel,$d,$target_item); - } } } diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 8963480e6..8a110f925 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -159,7 +159,7 @@ class Photo extends \Zotlabs\Web\Controller { if($r && intval($r[0]['photo_usage']) === PHOTO_COVER && $resolution >= PHOTO_RES_COVER_1200) $allowed = 1; - $d = [ 'imgscale' => $resolution, 'resource_id' => $photo, 'photo' => $r[0], 'allowed' => $allowed ]; + $d = [ 'imgscale' => $resolution, 'resource_id' => $photo, 'photo' => $r, 'allowed' => $allowed ]; call_hooks('get_photo',$d); $resolution = $d['imgscale']; diff --git a/include/network.php b/include/network.php index 5bf626908..d3ccc498d 100644 --- a/include/network.php +++ b/include/network.php @@ -343,7 +343,7 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) { if (isset($url_parsed)) { curl_close($ch); if($http_code == 303) { - return z_fetch_url($newurl,false,$redirects++,$opts); + return z_fetch_url($newurl,false,++$redirects,$opts); } else { return z_post_url($newurl,$params,++$redirects,$opts); } @@ -397,31 +397,6 @@ function json_return_and_die($x, $content_type = 'application/json') { killme(); } - -/** - * @brief Generic XML return. - * - * Outputs a basic dfrn XML status structure to STDOUT, with a variable - * of $st and an optional text of $message and terminates the current - * process. - * - * @param string $st - * @param string $message - */ -function xml_status($st, $message = '') { - - $xml_message = ((strlen($message)) ? "\t" . xmlify($message) . "\r\n" : ''); - - if($st) - logger('Returning non_zero: ' . $st . " message=" . $message); - - header( "Content-type: text/xml" ); - echo ''."\r\n"; - echo "\r\n\t$st\r\n$xml_message\r\n"; - killme(); -} - - /** * @brief Send HTTP status header. * @@ -1452,88 +1427,6 @@ function scrape_feed($url) { } -function format_and_send_email($sender,$xchan,$item) { - - $title = $item['title']; - $body = $item['body']; - - $textversion = strip_tags(html_entity_decode(bbcode(str_replace(array("\\r", "\\n"), array( "", "\n"), $body)),ENT_QUOTES,'UTF-8')); - - $htmlversion = bbcode(str_replace(array("\\r","\\n"), array("","
\n"),$body)); - - $banner = t('$Projectname Notification'); - - $product = t('$projectname'); // PLATFORM_NAME; - $siteurl = z_root(); - $thanks = t('Thank You,'); - $sitename = get_config('system','sitename'); - $site_admin = sprintf( t('%s Administrator'), $sitename); - - // load the template for private message notifications - $tpl = get_markup_template('email_notify_html.tpl'); - $email_html_body = replace_macros($tpl,array( - '$banner' => $banner, - '$notify_icon' => Zotlabs\Lib\System::get_notify_icon(), - '$product' => $product, - '$preamble' => '', - '$sitename' => $sitename, - '$siteurl' => $siteurl, - '$source_name' => $sender['xchan_name'], - '$source_link' => $sender['xchan_url'], - '$source_photo' => $sender['xchan_photo_m'], - '$username' => $xchan['xchan_name'], - '$hsitelink' => $datarray['hsitelink'], - '$hitemlink' => $datarray['hitemlink'], - '$thanks' => $thanks, - '$site_admin' => $site_admin, - '$title' => $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' => '', - '$sitename' => $sitename, - '$siteurl' => $siteurl, - '$source_name' => $sender['xchan_name'], - '$source_link' => $sender['xchan_url'], - '$source_photo' => $sender['xchan_photo_m'], - '$username' => $xchan['xchan_name'], - '$hsitelink' => $datarray['hsitelink'], - '$hitemlink' => $datarray['hitemlink'], - '$thanks' => $thanks, - '$site_admin' => $site_admin, - '$title' => $title, - '$textversion' => $textversion - )); - - $sender_name = t('Administrator'); - - $hostname = App::get_hostname(); - if(strpos($hostname,':')) - $hostname = substr($hostname,0,strpos($hostname,':')); - $sender_email = get_config('system','reply_address'); - if(! $sender_email) - $sender_email = 'noreply' . '@' . $hostname; - - // use the EmailNotification library to send the message - - Zotlabs\Lib\Enotify::send(array( - 'fromName' => $product, - 'fromEmail' => $sender_email, - 'replyTo' => $sender_email, - 'toEmail' => str_replace('mailto:','',$xchan['xchan_addr']), - 'messageSubject' => (($title) ? $title : t('No Subject')), - 'htmlVersion' => $email_html_body, - 'textVersion' => $email_text_body, - 'additionalMailHeader' => '', - )); - -} - function do_delivery($deliveries) { -- cgit v1.2.3