From c2e529c72b17b61f2203466b2bfd73f07b8371f0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 17 Mar 2009 10:25:47 +1300 Subject: quoted the users table --- actions/featured.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/featured.php b/actions/featured.php index f3bade6a5..14d653cea 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -107,6 +107,7 @@ class FeaturedAction extends Action $featured_nicks = common_config('nickname', 'featured'); + if (count($featured_nicks) > 0) { $quoted = array(); @@ -115,10 +116,15 @@ class FeaturedAction extends Action $quoted[] = "'$nick'"; } + $table = "user"; + if(common_config('db','quote_identifiers')) { + $table = '"' . $table . '"'; + } + $user = new User; $user->whereAdd(sprintf('nickname IN (%s)', implode(',', $quoted))); $user->limit(($this->page - 1) * PROFILES_PER_PAGE, PROFILES_PER_PAGE + 1); - $user->orderBy('user.nickname ASC'); + $user->orderBy($table .'.nickname ASC'); $user->find(); @@ -145,4 +151,4 @@ class FeaturedAction extends Action $this->page, 'featured'); } } -} \ No newline at end of file +} -- cgit v1.2.3-54-g00ecf From 18c8a55ba61e507f08162149273a9a33b9b73ca0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 17 Mar 2009 10:36:12 +1300 Subject: use common_database_tablename instead of repeating that if structure everywhere --- actions/featured.php | 7 +------ lib/util.php | 13 +++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'actions') diff --git a/actions/featured.php b/actions/featured.php index 14d653cea..86fd3f374 100644 --- a/actions/featured.php +++ b/actions/featured.php @@ -116,15 +116,10 @@ class FeaturedAction extends Action $quoted[] = "'$nick'"; } - $table = "user"; - if(common_config('db','quote_identifiers')) { - $table = '"' . $table . '"'; - } - $user = new User; $user->whereAdd(sprintf('nickname IN (%s)', implode(',', $quoted))); $user->limit(($this->page - 1) * PROFILES_PER_PAGE, PROFILES_PER_PAGE + 1); - $user->orderBy($table .'.nickname ASC'); + $user->orderBy(common_database_tablename('user') .'.nickname ASC'); $user->find(); diff --git a/lib/util.php b/lib/util.php index 6341438ca..19637d546 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1300,3 +1300,16 @@ function common_compatible_license($from, $to) // XXX: better compatibility check needed here! return ($from == $to); } + +/** + * returns a quoted table name, if required according to config + */ +function common_database_tablename($tablename) +{ + + if(common_config('db','quote_identifiers')) { + $tablename = '"'. $tablename .'"'; + } + //table prefixes could be added here later + return $tablename; +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 579332aa247140d4da720b6c756c97bffdbf955d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 7 Apr 2009 23:57:45 -0400 Subject: don't use count() to check for empty page --- actions/favorited.php | 17 +++++++++-------- actions/public.php | 17 +++++------------ actions/publictagcloud.php | 10 +++++----- 3 files changed, 19 insertions(+), 25 deletions(-) (limited to 'actions') diff --git a/actions/favorited.php b/actions/favorited.php index 27da25435..09ab1216a 100644 --- a/actions/favorited.php +++ b/actions/favorited.php @@ -104,9 +104,9 @@ class FavoritedAction extends Action { parent::prepare($args); $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1; - + common_set_returnto($this->selfUrl()); - + return true; } @@ -143,13 +143,10 @@ class FavoritedAction extends Action $this->elementStart('div', 'instructions'); $this->raw($output); $this->elementEnd('div'); + } - $favorite = new Fave; - - if ($favorite->count()) { - return; - } - + function showEmptyList() + { $message = _('Favorite notices appear on this page but no one has favorited one yet.') . ' '; if (common_logged_in()) { @@ -217,6 +214,10 @@ class FavoritedAction extends Action $cnt = $nl->show(); + if ($cnt == 0) { + $this->showEmptyList(); + } + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'favorited'); } diff --git a/actions/public.php b/actions/public.php index b7b7fc6b7..5a380de9a 100644 --- a/actions/public.php +++ b/actions/public.php @@ -166,19 +166,8 @@ class PublicAction extends Action $nav->show(); } - function showPageNotice() + function showEmptyList() { - $notice = new Notice; - - if (!$notice) { - $this->serverError(_('Could not retrieve public stream.')); - return; - } - - if ($notice->count()) { - return; - } - $message = _('This is the public timeline for %%site.name%% but no one has posted anything yet.') . ' '; if (common_logged_in()) { @@ -216,6 +205,10 @@ class PublicAction extends Action $cnt = $nl->show(); + if ($cnt == 0) { + $this->showEmptyList(); + } + $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'public'); } diff --git a/actions/publictagcloud.php b/actions/publictagcloud.php index 0cd8940d4..855cfed9b 100644 --- a/actions/publictagcloud.php +++ b/actions/publictagcloud.php @@ -62,12 +62,10 @@ class PublictagcloudAction extends Action $this->element('p', 'instructions', sprintf(_('These are most popular recent tags on %s '), common_config('site', 'name'))); + } - $tags = new Notice_tag; - if ($tags->count()) { - return; - } - + function showEmptyList() + { $message = _('No one has posted a notice with a [hashtag](%%doc.tags%%) yet.') . ' '; if (common_logged_in()) { @@ -144,6 +142,8 @@ class PublictagcloudAction extends Action $this->elementEnd('dd'); $this->elementEnd('dl'); $this->elementEnd('div'); + } else { + $this->showEmptyList(); } } -- cgit v1.2.3-54-g00ecf From 6cdc2ff444b8c76a3cdc5b8c6e9e7e7539d9b6cc Mon Sep 17 00:00:00 2001 From: Meitar Moscovitz Date: Thu, 9 Apr 2009 13:52:39 -0400 Subject: Fixes ticket:1409; correct typo 'subcription' to 'subscription' in HTML and CSS. --- actions/subscriptions.php | 2 +- theme/base/css/display.css | 4 ++-- theme/base/css/print.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'actions') diff --git a/actions/subscriptions.php b/actions/subscriptions.php index b0c0a9b8d..e6f3c54db 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -139,7 +139,7 @@ class SubscriptionsList extends ProfileList $this->out->elementStart('form', array('id' => 'subedit-' . $profile->id, 'method' => 'post', - 'class' => 'form_subcription_edit', + 'class' => 'form_subscription_edit', 'action' => common_local_url('subedit'))); $this->out->hidden('token', common_session_token()); $this->out->hidden('profile', $profile->id); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 8ea2befb4..3b4a2a4b3 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -689,7 +689,7 @@ float:none; .profile .entity_profile .entity_note, .profile .entity_profile .entity_url, .profile .entity_profile .entity_tags, -.profile .entity_profile .form_subcription_edit { +.profile .entity_profile .form_subscription_edit { margin-left:59px; clear:none; display:block; @@ -701,7 +701,7 @@ margin-right:11px; } -.profile .entity_profile .form_subcription_edit label { +.profile .entity_profile .form_subscription_edit label { font-weight:normal; margin-right:11px; } diff --git a/theme/base/css/print.css b/theme/base/css/print.css index 2da3e5e44..d76dd608c 100644 --- a/theme/base/css/print.css +++ b/theme/base/css/print.css @@ -21,7 +21,7 @@ p { orphans: 2; widows: 1; } .entity_actions, .notice-options, #aside_primary, -.form_subcription_edit .submit { +.form_subscription_edit .submit { display:none; } -- cgit v1.2.3-54-g00ecf From 925ac16e1f878b44940b1a2970b91bcf9c09e314 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 10 Apr 2009 22:47:40 -0400 Subject: tag stream is read-only --- actions/tag.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actions') diff --git a/actions/tag.php b/actions/tag.php index d15f64498..c413bf8c3 100644 --- a/actions/tag.php +++ b/actions/tag.php @@ -86,4 +86,9 @@ class TagAction extends Action $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, $this->page, 'tag', array('tag' => $this->tag)); } + + function isReadOnly() + { + return true; + } } -- cgit v1.2.3-54-g00ecf From f934cf2ac0cab8be26e5108c51fe0dcbef5b8517 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 12 Apr 2009 15:34:38 -0400 Subject: Update XML generation and list of actions in public XRDS Updated the XML generation calls and list of actions in the public XRDS document. --- actions/publicxrds.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'actions') diff --git a/actions/publicxrds.php b/actions/publicxrds.php index aad59d779..2c52f1246 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -51,7 +51,7 @@ class PublicxrdsAction extends Action { /** * Is read only? - * + * * @return boolean true */ function isReadOnly() @@ -61,7 +61,7 @@ class PublicxrdsAction extends Action /** * Class handler. - * + * * @param array $args array of arguments * * @return nothing @@ -70,24 +70,24 @@ class PublicxrdsAction extends Action { parent::handle($args); header('Content-Type: application/xrds+xml'); - common_start_xml(); + $this->startXML(); $this->elementStart('XRDS', array('xmlns' => 'xri://$xrds')); $this->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); $this->element('Type', null, 'xri://$xrds*simple'); - foreach (array('finishopenidlogin', 'finishaddopenid', 'finishimmediate') as $finish) { + foreach (array('finishopenidlogin', 'finishaddopenid') as $finish) { $this->showService(Auth_OpenID_RP_RETURN_TO_URL_TYPE, common_local_url($finish)); } $this->elementEnd('XRD'); $this->elementEnd('XRDS'); - common_end_xml(); + $this->endXML(); } /** * Show service. - * + * * @param string $type XRDS type * @param string $uri URI * @param array $params type parameters, null by default -- cgit v1.2.3-54-g00ecf From e9e7671d5fbb6e3e66c8629ac78246cd9a47ceda Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 12 Apr 2009 21:40:29 +0000 Subject: Updated markup for entity_profile on Authorize subscription page. --- actions/userauthorization.php | 87 ++++++++++++++++++++++++++++++++----------- 1 file changed, 65 insertions(+), 22 deletions(-) (limited to 'actions') diff --git a/actions/userauthorization.php b/actions/userauthorization.php index 8723848c7..c8c679dcd 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -97,47 +97,90 @@ class UserauthorizationAction extends Action $location = $params['omb_listenee_location']; $avatar = $params['omb_listenee_avatar']; - $this->elementStart('div', 'profile'); + $this->elementStart('div', array('class' => 'profile')); + $this->elementStart('div', 'entity_profile vcard'); + $this->elementStart('a', array('href' => $profile, + 'class' => 'url')); if ($avatar) { $this->element('img', array('src' => $avatar, - 'class' => 'avatar', + 'class' => 'photo avatar', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $nickname)); } - $this->element('a', array('href' => $profile, - 'class' => 'external profile nickname'), - $nickname); + $hasFN = ($fullname !== '') ? 'nickname' : 'fn nickname'; + $this->elementStart('span', $hasFN); + $this->raw($nickname); + $this->elementEnd('span'); + $this->elementEnd('a'); + if (!is_null($fullname)) { - $this->elementStart('div', 'fullname'); - if (!is_null($homepage)) { - $this->element('a', array('href' => $homepage), - $fullname); - } else { - $this->text($fullname); - } - $this->elementEnd('div'); + $this->elementStart('dl', 'entity_fn'); + $this->elementStart('dd'); + $this->elementStart('span', 'fn'); + $this->raw($fullname); + $this->elementEnd('span'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } if (!is_null($location)) { - $this->element('div', 'location', $location); + $this->elementStart('dl', 'entity_location'); + $this->element('dt', null, _('Location')); + $this->elementStart('dd', 'label'); + $this->raw($location); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + if (!is_null($homepage)) { + $this->elementStart('dl', 'entity_url'); + $this->element('dt', null, _('URL')); + $this->elementStart('dd'); + $this->elementStart('a', array('href' => $homepage, + 'class' => 'url')); + $this->raw($homepage); + $this->elementEnd('a'); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } + if (!is_null($bio)) { - $this->element('div', 'bio', $bio); + $this->elementStart('dl', 'entity_note'); + $this->element('dt', null, _('Note')); + $this->elementStart('dd', 'note'); + $this->raw($bio); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + if (!is_null($license)) { + $this->elementStart('dl', 'entity_license'); + $this->element('dt', null, _('License')); + $this->elementStart('dd', 'license'); + $this->element('a', array('href' => $license, + 'class' => 'license'), + $license); + $this->elementEnd('dd'); + $this->elementEnd('dl'); } - $this->elementStart('div', 'license'); - $this->element('a', array('href' => $license, - 'class' => 'license'), - $license); - $this->elementEnd('div'); $this->elementEnd('div'); + + $this->elementStart('div', 'entity_actions'); + $this->elementStart('ul'); + $this->elementStart('li', 'entity_subscribe'); $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); $this->hidden('token', common_session_token()); - $this->submit('accept', _('Accept')); - $this->submit('reject', _('Reject')); + + $this->submit('accept', _('Accept'), 'submit accept', null, _('Subscribe to this user')); + $this->submit('reject', _('Reject'), 'submit reject', null, _('Reject this subscription')); $this->elementEnd('form'); + $this->elementEnd('li'); + $this->elementEnd('ul'); + $this->elementEnd('div'); + $this->elementEnd('div'); } function sendAuthorization() -- cgit v1.2.3-54-g00ecf From 7a00dc749da9bcc003aad5f90b0346ba164680df Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Sun, 12 Apr 2009 21:50:14 +0000 Subject: Updated styles for the Authrization subscription form inputs --- actions/userauthorization.php | 1 + theme/base/css/display.css | 6 ++++-- theme/default/css/display.css | 3 ++- theme/identica/css/display.css | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) (limited to 'actions') diff --git a/actions/userauthorization.php b/actions/userauthorization.php index c8c679dcd..168019149 100644 --- a/actions/userauthorization.php +++ b/actions/userauthorization.php @@ -170,6 +170,7 @@ class UserauthorizationAction extends Action $this->elementStart('li', 'entity_subscribe'); $this->elementStart('form', array('method' => 'post', 'id' => 'userauthorization', + 'class' => 'form_user_authorization', 'name' => 'userauthorization', 'action' => common_local_url('userauthorization'))); $this->hidden('token', common_session_token()); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 3b4a2a4b3..9c0980ec6 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -607,7 +607,9 @@ border-radius:4px; -moz-border-radius:4px; -webkit-border-radius:4px; } - +.entity_actions .accept { +margin-bottom:18px; +} .entity_tags ul { list-style-type:none; @@ -1158,4 +1160,4 @@ display:none; } .guide { clear:both; -} \ No newline at end of file +} diff --git a/theme/default/css/display.css b/theme/default/css/display.css index 42e29374f..5523a331e 100644 --- a/theme/default/css/display.css +++ b/theme/default/css/display.css @@ -164,7 +164,8 @@ background-color:#A9BF4F; color:#fff; } .form_user_unsubscribe input.submit, -.form_group_leave input.submit { +.form_group_leave input.submit, +.form_user_authorization input.reject { background-color:#97BFD1; } diff --git a/theme/identica/css/display.css b/theme/identica/css/display.css index 8edb005a6..e4f582b6c 100644 --- a/theme/identica/css/display.css +++ b/theme/identica/css/display.css @@ -164,7 +164,8 @@ background-color:#9BB43E; color:#fff; } .form_user_unsubscribe input.submit, -.form_group_leave input.submit { +.form_group_leave input.submit, +.form_user_authorization input.reject { background-color:#87B4C8; } -- cgit v1.2.3-54-g00ecf