From 8f64c247fd64e1cce12489c212e55dae16e28c39 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 19 Mar 2009 11:36:24 -0400 Subject: redirect to original URL or URI for remote notices --- actions/shownotice.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'actions') diff --git a/actions/shownotice.php b/actions/shownotice.php index d5f35cd84..ccae49bb3 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -177,10 +177,17 @@ class ShownoticeAction extends Action { parent::handle($args); - $this->showPage(); + if ($this->notice->is_local == 0) { + if (!empty($this->notice->url)) { + common_redirect($this->notice->url, 301); + } else if (!empty($this->notice->uri) && preg_match('/^https?:/', $this->notice->uri)) { + common_redirect($this->notice->uri, 301); + } + } else { + $this->showPage(); + } } - /** * Don't show local navigation * @@ -191,7 +198,6 @@ class ShownoticeAction extends Action { } - /** * Fill the content area of the page * @@ -208,8 +214,6 @@ class ShownoticeAction extends Action $this->elementEnd('ul'); } - - /** * Don't show page notice * @@ -220,7 +224,6 @@ class ShownoticeAction extends Action { } - /** * Don't show aside * @@ -230,7 +233,6 @@ class ShownoticeAction extends Action function showAside() { } - /** * Extra content * -- cgit v1.2.3-54-g00ecf From 1116526f0855af47b353722907c57e1b4285cddc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 25 Mar 2009 12:32:46 -0400 Subject: fixed pagination variable problem --- actions/noticesearch.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/noticesearch.php b/actions/noticesearch.php index eb4a072de..9058cf53c 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -122,9 +122,10 @@ class NoticesearchAction extends SearchAction $cnt = $nl->show(); - $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, - $this->page, 'noticesearch', array('q' => $q)); + $this->pagination($page > 1, $cnt > NOTICES_PER_PAGE, + $page, 'noticesearch', array('q' => $q)); } + function isReadOnly() { return true; -- cgit v1.2.3-54-g00ecf From 73fbf6580045939bfe9276820476be01d72c0687 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 Mar 2009 09:58:28 -0400 Subject: full name in title and h1 of the personal profile --- actions/showstream.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index b83f45d53..f5886f3d3 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -67,11 +67,17 @@ class ShowstreamAction extends Action function title() { + if (!empty($this->profile->fullname)) { + $base = $this->profile->fullname . ' (' . $this->user->nickname . ') '; + } else { + $base = $this->user->nickname; + } + if ($this->page == 1) { - return $this->user->nickname; + return $base; } else { return sprintf(_("%s, page %d"), - $this->user->nickname, + $base, $this->page); } } @@ -140,16 +146,6 @@ class ShowstreamAction extends Action $nav->show(); } - function showPageTitle() - { - $user =& common_current_user(); - if ($user && ($user->id == $this->profile->id)) { - $this->element('h1', NULL, _("Your profile")); - } else { - $this->element('h1', NULL, sprintf(_('%s\'s profile'), $this->profile->nickname)); - } - } - function showPageNoticeBlock() { return; -- cgit v1.2.3-54-g00ecf From ce212c3903cfa7a81aa130dc8d1dff6ae890572e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 Mar 2009 09:58:28 -0400 Subject: full name in title and h1 of the personal profile --- actions/showstream.php | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'actions') diff --git a/actions/showstream.php b/actions/showstream.php index 65482167e..9b6536293 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -67,11 +67,17 @@ class ShowstreamAction extends Action function title() { + if (!empty($this->profile->fullname)) { + $base = $this->profile->fullname . ' (' . $this->user->nickname . ') '; + } else { + $base = $this->user->nickname; + } + if ($this->page == 1) { - return $this->user->nickname; + return $base; } else { return sprintf(_("%s, page %d"), - $this->user->nickname, + $base, $this->page); } } @@ -140,16 +146,6 @@ class ShowstreamAction extends Action $nav->show(); } - function showPageTitle() - { - $user =& common_current_user(); - if ($user && ($user->id == $this->profile->id)) { - $this->element('h1', NULL, _("Your profile")); - } else { - $this->element('h1', NULL, sprintf(_('%s\'s profile'), $this->profile->nickname)); - } - } - function showPageNoticeBlock() { return; -- cgit v1.2.3-54-g00ecf From 650a86d79aacb0657a562183e5b5e37ace6127f3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 30 Mar 2009 10:28:44 -0400 Subject: add fullname to title and h1 for groups --- actions/showgroup.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/showgroup.php b/actions/showgroup.php index b6022840b..95d2914ba 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -73,11 +73,17 @@ class ShowgroupAction extends Action function title() { + if (!empty($this->group->fullname)) { + $base = $this->group->fullname . ' (' . $this->group->nickname . ')'; + } else { + $base = $this->group->nickname; + } + if ($this->page == 1) { - return sprintf(_("%s group"), $this->group->nickname); + return sprintf(_("%s group"), $base); } else { return sprintf(_("%s group, page %d"), - $this->group->nickname, + $base, $this->page); } } -- cgit v1.2.3-54-g00ecf