From 896dbfaf675c4a91f2bc5a22fe2eac6f6461ec0f Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 12 Mar 2009 14:59:36 +1300 Subject: [PATCH 1/9] fixed quoting of the table named "user" --- lib/featureduserssection.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/featureduserssection.php b/lib/featureduserssection.php index aed94b1a55..4b9238d471 100644 --- a/lib/featureduserssection.php +++ b/lib/featureduserssection.php @@ -57,9 +57,14 @@ class FeaturedUsersSection extends ProfileSection $quoted[] = "'$nick'"; } + $table = "user"; + if(common_config('db','quote_identifiers')) { + $table = '"' . $table . '"'; + } + $qry = 'SELECT profile.* ' . - 'FROM profile JOIN user on profile.id = user.id ' . - 'WHERE user.nickname in (' . implode(',', $quoted) . ') ' . + 'FROM profile JOIN '. $table .' on profile.id = '. $table .'.id ' . + 'WHERE '. $table .'.nickname in (' . implode(',', $quoted) . ') ' . 'ORDER BY profile.created DESC '; $limit = PROFILES_PER_SECTION + 1; From ea5e7ed2ff0873655a8399c5001686bea8a4adf7 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Thu, 12 Mar 2009 15:20:50 +1300 Subject: [PATCH 2/9] When deleting a notice, null the reply_to fields that point to notice --- classes/Notice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/Notice.php b/classes/Notice.php index 3087e39a78..6573c337c5 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -67,6 +67,8 @@ class Notice extends Memcached_DataObject $this->blowSubsCache(true); $this->query('BEGIN'); + //Null any notices that are replies to this notice + $this->query(sprintf("UPDATE notice set reply_to = null WHERE reply_to = %d", $this->id)); $related = array('Reply', 'Fave', 'Notice_tag', From c2e529c72b17b61f2203466b2bfd73f07b8371f0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 17 Mar 2009 10:25:47 +1300 Subject: [PATCH 3/9] quoted the users table --- actions/featured.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/actions/featured.php b/actions/featured.php index f3bade6a5e..14d653cea2 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 +} From 18c8a55ba61e507f08162149273a9a33b9b73ca0 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Tue, 17 Mar 2009 10:36:12 +1300 Subject: [PATCH 4/9] 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(-) diff --git a/actions/featured.php b/actions/featured.php index 14d653cea2..86fd3f374a 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 6341438cae..19637d5465 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 From 1ac66b39969f8d67805afff5cca88040a625e30c Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 8 Apr 2009 19:59:59 +0000 Subject: [PATCH 5/9] Using 800px width and using document.title if no text is selected. --- doc-src/bookmarklet | 3 +-- theme/base/css/display.css | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc-src/bookmarklet b/doc-src/bookmarklet index a7f459eecc..a2aaf943d8 100644 --- a/doc-src/bookmarklet +++ b/doc-src/bookmarklet @@ -3,6 +3,5 @@ A bookmarklet is a small piece of javascript code used as a bookmark. This one w Drag-and-drop the following link to your bookmarks bar or right-click it and add it to your browser favorites to keep it handy. -Post to %%site.name%% +Post to %%site.name%% - diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 03b6880737..aa5655369a 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -1158,4 +1158,4 @@ display:none; } .guide { clear:both; -} +} \ No newline at end of file From 420c94e7d30745eabe18397a404f284e18bf6588 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 8 Apr 2009 20:36:50 +0000 Subject: [PATCH 6/9] Using encodeURIComponent for document.title --- doc-src/bookmarklet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/bookmarklet b/doc-src/bookmarklet index a2aaf943d8..6cd2c08f90 100644 --- a/doc-src/bookmarklet +++ b/doc-src/bookmarklet @@ -3,5 +3,5 @@ A bookmarklet is a small piece of javascript code used as a bookmark. This one w Drag-and-drop the following link to your bookmarks bar or right-click it and add it to your browser favorites to keep it handy. -Post to %%site.name%% +Post to %%site.name%% From 070cd3533c3474dc065c6681befb92dac51f4bf7 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 8 Apr 2009 20:54:37 +0000 Subject: [PATCH 7/9] Fixes the issue mentioned in commit 7fc90d5. Changed the margin value that's specific to the Inbox/Outbox page only. --- theme/base/css/display.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 1166ae63b7..8ea2befb4c 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -443,6 +443,7 @@ padding:7px 7px 16px 7px; display:block; float:left; font-size:1.3em; +margin-bottom:7px; } #form_notice #notice_submit label { display:none; @@ -471,7 +472,7 @@ bottom:0; right:0; } #form_notice label[for=to] { -margin-top:11px; +margin-top:7px; } #form_notice select[id=to] { margin-bottom:7px; From 6afda46402694e42b0c2e6dfbcfcb2a17a60b2b0 Mon Sep 17 00:00:00 2001 From: CiaranG Date: Thu, 9 Apr 2009 18:29:31 +0100 Subject: [PATCH 8/9] Corrected error in README relating to ['newuser']['welcome'] --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index f18d9c7c16..09d9d301c5 100644 --- a/README +++ b/README @@ -1125,7 +1125,7 @@ default: nickname of a user account to automatically subscribe new service updates or announcements. Users are able to unsub if they want. Default is null; no auto subscribe. welcome: nickname of a user account that sends welcome messages to new - users. Can be the same as 'subscribe' account, although on + users. Can be the same as 'default' account, although on busy servers it may be a good idea to keep that one just for 'urgent' messages. Default is null; no message. From 6cdc2ff444b8c76a3cdc5b8c6e9e7e7539d9b6cc Mon Sep 17 00:00:00 2001 From: Meitar Moscovitz Date: Thu, 9 Apr 2009 13:52:39 -0400 Subject: [PATCH 9/9] 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(-) diff --git a/actions/subscriptions.php b/actions/subscriptions.php index b0c0a9b8df..e6f3c54db8 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 8ea2befb4c..3b4a2a4b30 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 2da3e5e444..d76dd608c4 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; }