From 7a45489f090fd2d0086c28c9da7b24736d194c9e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 02:44:32 -0800 Subject: [PATCH 1/5] converted peopletag.php to new uiredesign; css still looks bad --- actions/peopletag.php | 44 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/actions/peopletag.php b/actions/peopletag.php index 7bcfcb93e3..7c2f2b84c2 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -19,7 +19,7 @@ if (!defined('LACONICA')) { exit(1); } -require_once(INSTALLDIR.'/lib/profilelist.php'); +require_once INSTALLDIR.'/lib/profilelist.php'; class PeopletagAction extends Action { @@ -41,18 +41,18 @@ class PeopletagAction extends Action if (!$page) { $page = 1; } - - # Looks like we're good; show the header - common_show_header(sprintf(_('Users self-tagged with %s - page %d'), $tag, $page), + $this->showPeople($tag, $page); + + } + + function title() + { + return sprintf(_('Users self-tagged with %s - page %d'), $tag, $page, null, $tag, array($this, 'show_top')); - - $this->show_people($tag, $page); - - common_show_footer(); } - function show_people($tag, $page) + function showPeople($tag, $page) { $profile = new Profile(); @@ -76,34 +76,14 @@ class PeopletagAction extends Action 'ORDER BY profile_tag.modified DESC ' . $lim, $tag)); - $pl = new ProfileList($profile); - $cnt = $pl->show_list(); + $pl = new ProfileList($profile, null, $this); + $cnt = $pl->show(); - common_pagination($page > 1, + $this->pagination($page > 1, $cnt > PROFILES_PER_PAGE, $page, $this->trimmed('action'), array('tag' => $tag)); } - function show_top($tag) - { - $instr = sprintf(_('These are users who have tagged themselves "%s" ' . - 'to show a common interest, characteristic, hobby or job.'), $tag); - $this->elementStart('div', 'instructions'); - $this->elementStart('p'); - $this->text($instr); - $this->elementEnd('p'); - $this->elementEnd('div'); - } - - function get_title() - { - return null; - } - - function show_header($arr) - { - return; - } } From 25de8fa06d8c5bc1b2c71975612a1eba0d58ba94 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 03:06:46 -0800 Subject: [PATCH 2/5] Okay, let's try that again. uiconversion of peopletag.php --- actions/peopletag.php | 51 +++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/actions/peopletag.php b/actions/peopletag.php index 7c2f2b84c2..221ece2a9a 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -24,35 +24,33 @@ require_once INSTALLDIR.'/lib/profilelist.php'; class PeopletagAction extends Action { + var $tag = null; + var $page = null; + function handle($args) { - - parent::handle($args); - - $tag = $this->trimmed('tag'); + parent::handle($args); - if (!common_valid_profile_tag($tag)) { - $this->clientError(sprintf(_('Not a valid people tag: %s'), $tag)); + parent::prepare($args); + + $this->tag = $this->trimmed('tag'); + + if (!common_valid_profile_tag($this->tag)) { + $this->clientError(sprintf(_('Not a valid people tag: %s'), $this->tag)); return; } - $page = $this->trimmed('page'); - - if (!$page) { - $page = 1; + $this->page = $this->trimmed('page'); + + if (!$this->page) { + $this->page = 1; } - - $this->showPeople($tag, $page); - + + $this->showPage(); } - function title() - { - return sprintf(_('Users self-tagged with %s - page %d'), $tag, $page, - null, $tag, array($this, 'show_top')); - } - - function showPeople($tag, $page) + + function showContent() { $profile = new Profile(); @@ -74,16 +72,21 @@ class PeopletagAction extends Action 'WHERE profile_tag.tagger = profile_tag.tagged ' . 'AND tag = "%s" ' . 'ORDER BY profile_tag.modified DESC ' . - $lim, $tag)); + $lim, $this->tag)); $pl = new ProfileList($profile, null, $this); $cnt = $pl->show(); - $this->pagination($page > 1, + $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, - $page, + $this->page, $this->trimmed('action'), - array('tag' => $tag)); + array('tag' => $this->tag)); + } + + function title() + { + return sprintf( _('Users self-tagged with %s - page %d'), $this->tag, $this->page); } } From 40928cd27a5747c416dbd3724fb2ea8479f37a2e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 03:21:39 -0800 Subject: [PATCH 3/5] Wow, let's try this once more. peopletag.php should be converted to new uiredesign now --- actions/peopletag.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions/peopletag.php b/actions/peopletag.php index 221ece2a9a..bf2aacb1c2 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -71,8 +71,8 @@ class PeopletagAction extends Action 'ON profile.id = profile_tag.tagger ' . 'WHERE profile_tag.tagger = profile_tag.tagged ' . 'AND tag = "%s" ' . - 'ORDER BY profile_tag.modified DESC ' . - $lim, $this->tag)); + 'ORDER BY profile_tag.modified DESC ', + 'LIMIT 0, %s'), $this->tag, $lim); $pl = new ProfileList($profile, null, $this); $cnt = $pl->show(); From e2a965c999e1d8096195d063c808a15759ecf5c6 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 22:08:27 -0800 Subject: [PATCH 4/5] Rss10Action::showImage() was trying to call pre-uiredesign XML output functions --- lib/rssaction.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rssaction.php b/lib/rssaction.php index f19c8e1c54..2bd7f1f19d 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -178,11 +178,11 @@ class Rss10Action extends Action $image = $this->getImage(); if ($image) { $channel = $this->getChannel(); - common_element_start('image', array('rdf:about' => $image)); - common_element('title', null, $channel['title']); - common_element('link', null, $channel['link']); - common_element('url', null, $image); - common_element_end('image'); + $this->elementStart('image', array('rdf:about' => $image)); + $this->element('title', null, $channel['title']); + $this->element('link', null, $channel['link']); + $this->element('url', null, $image); + $this->elementEnd('image'); } } From 688d38b1015456ae28cf0ef96bab777a47d5a97a Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 25 Jan 2009 02:03:49 -0800 Subject: [PATCH 5/5] Fixed broken SQL for people tags view --- actions/peopletag.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/actions/peopletag.php b/actions/peopletag.php index bf2aacb1c2..3578c53fdf 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -49,7 +49,6 @@ class PeopletagAction extends Action $this->showPage(); } - function showContent() { @@ -66,17 +65,18 @@ class PeopletagAction extends Action # XXX: memcached this - $profile->query(sprintf('SELECT profile.* ' . - 'FROM profile JOIN profile_tag ' . - 'ON profile.id = profile_tag.tagger ' . - 'WHERE profile_tag.tagger = profile_tag.tagged ' . - 'AND tag = "%s" ' . - 'ORDER BY profile_tag.modified DESC ', - 'LIMIT 0, %s'), $this->tag, $lim); + $qry = 'SELECT profile.* ' . + 'FROM profile JOIN profile_tag ' . + 'ON profile.id = profile_tag.tagger ' . + 'WHERE profile_tag.tagger = profile_tag.tagged ' . + 'AND tag = "%s" ' . + 'ORDER BY profile_tag.modified DESC'; + + $profile->query(sprintf($qry, $this->tag, $lim)); $pl = new ProfileList($profile, null, $this); $cnt = $pl->show(); - + $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, $this->page,