From 7a45489f090fd2d0086c28c9da7b24736d194c9e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 02:44:32 -0800 Subject: converted peopletag.php to new uiredesign; css still looks bad --- actions/peopletag.php | 44 ++++++++++++-------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) (limited to 'actions') diff --git a/actions/peopletag.php b/actions/peopletag.php index 7bcfcb93e..7c2f2b84c 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), - null, $tag, array($this, 'show_top')); - $this->show_people($tag, $page); + $this->showPeople($tag, $page); - common_show_footer(); + } + + function title() + { + return sprintf(_('Users self-tagged with %s - page %d'), $tag, $page, + null, $tag, array($this, 'show_top')); } - 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; - } } -- cgit v1.2.3-54-g00ecf From 25de8fa06d8c5bc1b2c71975612a1eba0d58ba94 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 03:06:46 -0800 Subject: Okay, let's try that again. uiconversion of peopletag.php --- actions/peopletag.php | 49 ++++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'actions') diff --git a/actions/peopletag.php b/actions/peopletag.php index 7c2f2b84c..221ece2a9 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); + + parent::prepare($args); - parent::handle($args); + $this->tag = $this->trimmed('tag'); - $tag = $this->trimmed('tag'); - - if (!common_valid_profile_tag($tag)) { - $this->clientError(sprintf(_('Not a valid people tag: %s'), $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->showPeople($tag, $page); + $this->page = $this->trimmed('page'); + if (!$this->page) { + $this->page = 1; + } + + $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); } } -- cgit v1.2.3-54-g00ecf From 40928cd27a5747c416dbd3724fb2ea8479f37a2e Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sat, 24 Jan 2009 03:21:39 -0800 Subject: 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(-) (limited to 'actions') diff --git a/actions/peopletag.php b/actions/peopletag.php index 221ece2a9..bf2aacb1c 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(); -- cgit v1.2.3-54-g00ecf From 688d38b1015456ae28cf0ef96bab777a47d5a97a Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Sun, 25 Jan 2009 02:03:49 -0800 Subject: Fixed broken SQL for people tags view --- actions/peopletag.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'actions') diff --git a/actions/peopletag.php b/actions/peopletag.php index bf2aacb1c..3578c53fd 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, -- cgit v1.2.3-54-g00ecf