]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showstream.php
move url shortener superclass to lib from plugin
[quix0rs-gnu-social.git] / actions / showstream.php
index 663638c18a2c6781845bc844444209b7ce548de2..5a9add36ce14ef1caae088324000d94beb2999ad 100644 (file)
@@ -76,7 +76,7 @@ class ShowstreamAction extends ProfileAction
         if ($this->page == 1) {
             return $base;
         } else {
-            return sprintf(_("%s, page %d"),
+            return sprintf(_('%1$s, page %2$d'),
                            $base,
                            $this->page);
         }
@@ -119,7 +119,7 @@ class ShowstreamAction extends ProfileAction
                                   common_local_url('userrss',
                                                    array('nickname' => $this->user->nickname,
                                                          'tag' => $this->tag)),
-                                  sprintf(_('Notice feed for %s tagged %s (RSS 1.0)'),
+                                  sprintf(_('Notice feed for %1$s tagged %2$s (RSS 1.0)'),
                                           $this->user->nickname, $this->tag)));
         }
 
@@ -131,14 +131,14 @@ class ShowstreamAction extends ProfileAction
                      new Feed(Feed::RSS2,
                               common_local_url('ApiTimelineUser',
                                                array(
-                                                    'id' => $this->user->nickname,
+                                                    'id' => $this->user->id,
                                                     'format' => 'rss')),
                               sprintf(_('Notice feed for %s (RSS 2.0)'),
                                       $this->user->nickname)),
                      new Feed(Feed::ATOM,
                               common_local_url('ApiTimelineUser',
                                                array(
-                                                    'id' => $this->user->nickname,
+                                                    'id' => $this->user->id,
                                                     'format' => 'atom')),
                               sprintf(_('Notice feed for %s (Atom)'),
                                       $this->user->nickname)),
@@ -166,18 +166,21 @@ class ShowstreamAction extends ProfileAction
             $this->element('meta', array('name' => 'microid',
                                          'content' => $id->toString()));
         }
-        if ($this->user->jabbermicroid && $this->user->jabber && $this->profile->profileurl) {
-            $id = new Microid('xmpp:'.$this->user->jabber,
-                              $this->selfUrl());
-            $this->element('meta', array('name' => 'microid',
-                                         'content' => $id->toString()));
-        }
 
         // See https://wiki.mozilla.org/Microsummaries
 
         $this->element('link', array('rel' => 'microsummary',
                                      'href' => common_local_url('microsummary',
                                                                 array('nickname' => $this->profile->nickname))));
+
+        $rsd = common_local_url('rsd',
+                                array('nickname' => $this->profile->nickname));
+
+        // RSD, http://tales.phrasewise.com/rfc/rsd
+        $this->element('link', array('rel' => 'EditURI',
+                                     'type' => 'application/rsd+xml',
+                                     'href' => $rsd));
+
     }
 
     function showProfile()
@@ -188,14 +191,14 @@ class ShowstreamAction extends ProfileAction
 
     function showEmptyListMessage()
     {
-        $message = sprintf(_('This is the timeline for %s but %s hasn\'t posted anything yet.'), $this->user->nickname, $this->user->nickname) . ' ';
+        $message = sprintf(_('This is the timeline for %1$s but %2$s hasn\'t posted anything yet.'), $this->user->nickname, $this->user->nickname) . ' ';
 
         if (common_logged_in()) {
             $current_user = common_current_user();
             if ($this->user->id === $current_user->id) {
                 $message .= _('Seen anything interesting recently? You haven\'t posted any notices yet, now would be a good time to start :)');
             } else {
-                $message .= sprintf(_('You can try to nudge %s or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, '@' . $this->user->nickname);
+                $message .= sprintf(_('You can try to nudge %1$s or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%2$s).'), $this->user->nickname, '@' . $this->user->nickname);
             }
         }
         else {
@@ -269,4 +272,33 @@ class ProfileNoticeListItem extends NoticeListItem
     {
         return;
     }
+
+    /**
+     * show a link to the author of repeat
+     *
+     * @return void
+     */
+
+    function showRepeat()
+    {
+        if (!empty($this->repeat)) {
+
+            // FIXME: this code is almost identical to default; need to refactor
+
+            $attrs = array('href' => $this->profile->profileurl,
+                           'class' => 'url');
+
+            if (!empty($this->profile->fullname)) {
+                $attrs['title'] = $this->profile->fullname . ' (' . $this->profile->nickname . ')';
+            }
+
+            $this->out->elementStart('span', 'repeat');
+
+            $text_link = XMLStringer::estring('a', $attrs, $this->profile->nickname);
+
+            $this->out->raw(sprintf(_('Repeat of %s'), $text_link));
+
+            $this->out->elementEnd('span');
+        }
+    }
 }