]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/EmailSummary/useremailsummaryhandler.php
Merge branch 'oembed-thumbnails' into 0.9.x
[quix0rs-gnu-social.git] / plugins / EmailSummary / useremailsummaryhandler.php
index 4bbbb861c0f806a5d497789d566b0706f73c4c68..b1ebd0c425ac79f37c0c16c7b270be47d84df849 100644 (file)
@@ -128,11 +128,66 @@ class UserEmailSummaryHandler extends QueueHandler
                          common_config('site', 'name'),
                          $profile->getBestName()));
        
-       $nl = new NoticeList($notice, $out);
 
-       // Outputs to the string
+       $out->elementStart('table', array('width' => '541px', 'style' => 'border: none'));
        
-       $nl->show();
+       while ($notice->fetch()) {
+           
+           $profile = Profile::staticGet('id', $notice->profile_id);
+           
+           if (empty($profile)) {
+               continue;
+           }
+           
+           $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
+
+           $out->elementStart('tr');
+           $out->elementStart('td', array('width' => AVATAR_STREAM_SIZE,
+                                          'height' => AVATAR_STREAM_SIZE,
+                                          'align' => 'left',
+                                          'valign' => 'top'));
+           $out->element('img', array('src' => ($avatar) ?
+                                      $avatar->displayUrl() :
+                                      Avatar::defaultImage($avatar_size),
+                                      'class' => 'avatar photo',
+                                      'width' => AVATAR_STREAM_SIZE,
+                                      'height' => AVATAR_STREAM_SIZE,
+                                      'alt' => $profile->getBestName()));
+           $out->elementEnd('td');
+           $out->elementStart('td', array('align' => 'left',
+                                          'valign' => 'top'));
+           $out->element('a', array('href' => $profile->profileurl),
+                         $profile->nickname);
+           $out->text(' ');
+           $out->raw($notice->rendered);
+           $out->element('br'); // yeah, you know it. I just wrote a <br> in the middle of my table layout.
+           $noticeurl = $notice->bestUrl();
+           // above should always return an URL
+           assert(!empty($noticeurl));
+           $out->elementStart('a', array('rel' => 'bookmark',
+                                         'class' => 'timestamp',
+                                         'href' => $noticeurl));
+           $dt = common_date_iso8601($notice->created);
+           $out->element('abbr', array('class' => 'published',
+                                       'title' => $dt),
+                         common_date_string($notice->created));
+           $out->elementEnd('a');
+           if ($notice->hasConversation()) {
+               $conv = Conversation::staticGet('id', $notice->conversation);
+               $convurl = $conv->uri;
+               if (!empty($convurl)) {
+                                 $out->text(' ');
+                                 $out->element('a',
+                                               array('href' => $convurl.'#notice-'.$notice->id,
+                                                     'class' => 'response'),
+                                               _('in context'));
+               }
+           }
+           $out->elementEnd('td');
+           $out->elementEnd('tr');
+       }
+       
+       $out->elementEnd('table');
        
        $out->raw(sprintf(_('<p><a href="%1s">change your email settings for %2s</a></p>'),
                          common_local_url('emailsettings'),
@@ -163,10 +218,9 @@ class UserEmailSummaryHandler extends QueueHandler
            $ess->last_summary_id = $new_top;
            $ess->modified        = common_sql_now();
 
-           $ess->update();
+           $ess->update($orig);
        }
        
        return true;
     }
 }
-