From 0271859c2425daff6fbaeac74aee6d6a9fcdce16 Mon Sep 17 00:00:00 2001 From: Robin Millette Date: Mon, 18 May 2009 17:18:57 -0400 Subject: Added personal tag page: http://example.com/MY_NICK/tag/A_TAG --- lib/profileaction.php | 13 +++++++------ lib/router.php | 5 +++++ lib/tagcloudsection.php | 6 +++++- 3 files changed, 17 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/profileaction.php b/lib/profileaction.php index 1f2e30994..a3437ff4d 100644 --- a/lib/profileaction.php +++ b/lib/profileaction.php @@ -49,16 +49,17 @@ require_once INSTALLDIR.'/lib/groupminilist.php'; class ProfileAction extends Action { - var $user = null; - var $page = null; + var $user = null; + var $page = null; var $profile = null; + var $tag = null; function prepare($args) { parent::prepare($args); $nickname_arg = $this->arg('nickname'); - $nickname = common_canonical_nickname($nickname_arg); + $nickname = common_canonical_nickname($nickname_arg); // Permanent redirect on non-canonical nickname @@ -85,10 +86,9 @@ class ProfileAction extends Action return false; } + $this->tag = $this->trimmed('tag'); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; - common_set_returnto($this->selfUrl()); - return true; } @@ -244,4 +244,5 @@ class ProfileAction extends Action $this->elementEnd('div'); } -} \ No newline at end of file +} + diff --git a/lib/router.php b/lib/router.php index 635e1d77e..f07e59373 100644 --- a/lib/router.php +++ b/lib/router.php @@ -426,6 +426,11 @@ class Router array('size' => '(original|96|48|24)', 'nickname' => '[a-zA-Z0-9]{1,64}')); + $m->connect(':nickname/tag/:tag', + array('action' => 'showstream'), + array('nickname' => '[a-zA-Z0-9]{1,64}'), + array('tag' => '[a-zA-Z0-9]+')); + $m->connect(':nickname', array('action' => 'showstream'), array('nickname' => '[a-zA-Z0-9]{1,64}')); diff --git a/lib/tagcloudsection.php b/lib/tagcloudsection.php index ff2aca6d6..62f7d8961 100644 --- a/lib/tagcloudsection.php +++ b/lib/tagcloudsection.php @@ -114,7 +114,11 @@ class TagCloudSection extends Section function tagUrl($tag) { - return common_local_url('tag', array('tag' => $tag)); + if ('showstream' === $this->out->trimmed('action')) { + return common_local_url('showstream', array('nickname' => $this->out->profile->nickname, 'tag' => $tag)); + } else { + return common_local_url('tag', array('tag' => $tag)); + } } function divId() -- cgit v1.2.3-54-g00ecf