X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=76f675f19be2955be49762bcccb127c9fccd7397;hb=47bd3243cdb4a4840ca4d40452402a86b792ce1b;hp=5f5f9f98efbd8f432048fcf2dc1f7ec87a6f7d5d;hpb=63e2695d226d195c6a97e1045d6b174591dd2487;p=friendica.git diff --git a/mod/message.php b/mod/message.php index 5f5f9f98ef..76f675f19b 100644 --- a/mod/message.php +++ b/mod/message.php @@ -1,5 +1,7 @@ page['htmlhead'] .= replace_macros($tpl, array( '$baseurl' => App::get_baseurl(true), - '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); @@ -294,7 +276,6 @@ function message_content(App $a) { $tpl = get_markup_template('msg-end.tpl'); $a->page['end'] .= replace_macros($tpl, array( '$baseurl' => App::get_baseurl(true), - '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); @@ -370,7 +351,7 @@ function message_content(App $a) { $o .= $header; - $r = q("SELECT count(*) AS `total` FROM `mail` + $r = q("SELECT count(*) AS `total`, ANY_VALUE(`created`) AS `created` FROM `mail` WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `created` DESC", intval(local_user()) ); @@ -397,10 +378,6 @@ function message_content(App $a) { $o .= $header; - $plaintext = true; - if( local_user() && feature_enabled(local_user(),'richtext') ) - $plaintext = false; - $r = q("SELECT `mail`.*, `contact`.`name`, `contact`.`url`, `contact`.`thumb` FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` WHERE `mail`.`uid` = %d AND `mail`.`id` = %d LIMIT 1", @@ -439,7 +416,6 @@ function message_content(App $a) { $tpl = get_markup_template('msg-header.tpl'); $a->page['htmlhead'] .= replace_macros($tpl, array( '$baseurl' => App::get_baseurl(true), - '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); @@ -447,12 +423,10 @@ function message_content(App $a) { $tpl = get_markup_template('msg-end.tpl'); $a->page['end'] .= replace_macros($tpl, array( '$baseurl' => App::get_baseurl(true), - '$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'), '$nickname' => $a->user['nickname'], '$linkurl' => t('Please enter a link URL:') )); - $mails = array(); $seen = 0; $unknown = false; @@ -556,12 +530,20 @@ function message_content(App $a) { } function get_messages($user, $lstart, $lend) { - + //TODO: rewritte with a sub-query to get the first message of each private thread with certainty return q("SELECT max(`mail`.`created`) AS `mailcreated`, min(`mail`.`seen`) AS `mailseen`, - `mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network`, - count( * ) as count + ANY_VALUE(`mail`.`id`) AS `id`, ANY_VALUE(`mail`.`uid`) AS `uid`, ANY_VALUE(`mail`.`guid`) AS `guid`, + ANY_VALUE(`mail`.`from-name`) AS `from-name`, ANY_VALUE(`mail`.`from-photo`) AS `from-photo`, + ANY_VALUE(`mail`.`from-url`) AS `from-url`, ANY_VALUE(`mail`.`contact-id`) AS `contact-id`, + ANY_VALUE(`mail`.`convid`) AS `convid`, ANY_VALUE(`mail`.`title`) AS `title`, ANY_VALUE(`mail`.`body`) AS `body`, + ANY_VALUE(`mail`.`seen`) AS `seen`, ANY_VALUE(`mail`.`reply`) AS `reply`, ANY_VALUE(`mail`.`replied`) AS `replied`, + ANY_VALUE(`mail`.`unknown`) AS `unknown`, ANY_VALUE(`mail`.`uri`) AS `uri`, + `mail`.`parent-uri`, + ANY_VALUE(`mail`.`created`) AS `created`, ANY_VALUE(`contact`.`name`) AS `name`, ANY_VALUE(`contact`.`url`) AS `url`, + ANY_VALUE(`contact`.`thumb`) AS `thumb`, ANY_VALUE(`contact`.`network`) AS `network`, + count( * ) as `count` FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id` - WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `mailcreated` DESC LIMIT %d , %d ", + WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `mailcreated` DESC LIMIT %d , %d ", intval($user), intval($lstart), intval($lend) ); }