From 79b1e3a488372065590700491320b9d3b0c74de4 Mon Sep 17 00:00:00 2001
From: Robin Millette <millette@controlyourself.ca>
Date: Tue, 7 Apr 2009 23:25:12 +0000
Subject: [PATCH] added filler/guide text to user replies timeline.

---
 actions/all.php     |  2 +-
 actions/replies.php | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/actions/all.php b/actions/all.php
index dc5da3e005..f5bbfe2e39 100644
--- a/actions/all.php
+++ b/actions/all.php
@@ -84,7 +84,7 @@ class AllAction extends ProfileAction
             if ($this->user->id === $current_user->id) {
                 $message .= _('Try subscribing to more people, [join a group](%%action.groups) or post something yourself.');
             } else {
-                $message .= sprintf(_('You can try to [nudge %s](./) from his profile 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 %s](../%s) from his profile or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
             }
         }
         else {
diff --git a/actions/replies.php b/actions/replies.php
index 4ab9b14ed2..2769cb4227 100644
--- a/actions/replies.php
+++ b/actions/replies.php
@@ -166,12 +166,36 @@ class RepliesAction extends Action
         $nl = new NoticeList($notice, $this);
 
         $cnt = $nl->show();
+        if (0 === $cnt) {
+            $this->showEmptyListMessage();
+        }
 
         $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE,
                           $this->page, 'replies',
                           array('nickname' => $this->user->nickname));
     }
 
+    function showEmptyListMessage()
+    {
+        $message = sprintf(_('This is the timeline showing replies to %s but %s hasn\'t received a notice to his attention yet.'), $this->user->nickname, $this->user->nickname) . ' ';
+
+        if (common_logged_in()) {
+            $current_user = common_current_user();
+            if ($this->user->id === $current_user->id) {
+                $message .= _('You can engage other users in a conversation, subscribe to more people or [join groups](%%action.groups%%).');
+            } else {
+                $message .= sprintf(_('You can try to [nudge %s](../%s) or [post something to his or her attention](%%%%action.newnotice%%%%?status_textarea=%s).'), $this->user->nickname, $this->user->nickname, '@' . $this->user->nickname);
+            }
+        }
+        else {
+            $message .= sprintf(_('Why not [register an account](%%%%action.register%%%%) and then nudge %s or post a notice to his or her attention.'), $this->user->nickname);
+        }
+
+        $this->elementStart('div', 'guide');
+        $this->raw(common_markup_to_html($message));
+        $this->elementEnd('div');
+    }
+
     function isReadOnly()
     {
         return true;
-- 
2.39.5