summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobin Millette <millette@controlyourself.ca>2009-05-18 17:18:57 -0400
committerRobin Millette <millette@controlyourself.ca>2009-05-18 17:18:57 -0400
commit0271859c2425daff6fbaeac74aee6d6a9fcdce16 (patch)
treea93565653ec11237b71a2bcf87d6fbe2fcbcb9f8 /lib
parent5897dfa4c37d6a44bcde5dc7569c8b0d30f21b84 (diff)
Added personal tag page: http://example.com/MY_NICK/tag/A_TAG
Diffstat (limited to 'lib')
-rw-r--r--lib/profileaction.php13
-rw-r--r--lib/router.php5
-rw-r--r--lib/tagcloudsection.php6
3 files changed, 17 insertions, 7 deletions
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()