From 1a151ff6f686da198aac72a0adb5001f5d6dcd43 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 26 Jun 2009 22:13:41 +1200 Subject: used SQL standard LIMIT/OFFSET, because every database can understand that --- lib/popularnoticesection.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/popularnoticesection.php b/lib/popularnoticesection.php index e47c9b385..167a6ff8d 100644 --- a/lib/popularnoticesection.php +++ b/lib/popularnoticesection.php @@ -74,11 +74,7 @@ class PopularNoticeSection extends NoticeSection $offset = 0; $limit = NOTICES_PER_SECTION + 1; - if (common_config('db', 'type') == 'pgsql') { - $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; - } else { - $qry .= ' LIMIT ' . $offset . ', ' . $limit; - } + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; $notice = Memcached_DataObject::cachedQuery('Notice', sprintf($qry, common_config('popular', 'dropoff')), -- cgit v1.2.3-54-g00ecf From 15042ed50b72804eaeefd0c60aa63674bdefe8b4 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 27 Jun 2009 10:24:59 +1200 Subject: added user_group.design_id into the group by clause --- lib/groupsbymemberssection.php | 2 +- lib/groupsbypostssection.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/groupsbymemberssection.php b/lib/groupsbymemberssection.php index 963e21f15..ad4884bf8 100644 --- a/lib/groupsbymemberssection.php +++ b/lib/groupsbymemberssection.php @@ -48,7 +48,7 @@ class GroupsByMembersSection extends GroupSection $qry = 'SELECT user_group.*, count(*) as value ' . 'FROM user_group JOIN group_member '. 'ON user_group.id = group_member.group_id ' . - 'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified ' . + 'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified,user_group.design_id ' . 'ORDER BY value DESC '; $limit = GROUPS_PER_SECTION; diff --git a/lib/groupsbypostssection.php b/lib/groupsbypostssection.php index 325b4033f..dc7925d5e 100644 --- a/lib/groupsbypostssection.php +++ b/lib/groupsbypostssection.php @@ -48,7 +48,7 @@ class GroupsByPostsSection extends GroupSection $qry = 'SELECT user_group.*, count(*) as value ' . 'FROM user_group JOIN group_inbox '. 'ON user_group.id = group_inbox.group_id ' . - 'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified ' . + 'GROUP BY user_group.id,user_group.nickname,user_group.fullname,user_group.homepage,user_group.description,user_group.location,user_group.original_logo,user_group.homepage_logo,user_group.stream_logo,user_group.mini_logo,user_group.created,user_group.modified,user_group.design_id ' . 'ORDER BY value DESC '; $limit = GROUPS_PER_SECTION; -- cgit v1.2.3-54-g00ecf From 3722b90a27b2fd53d77c60d51c53cc3e548ffcf9 Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Sat, 27 Jun 2009 10:32:50 +1200 Subject: use single quotes in sql --- lib/grouptagcloudsection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/grouptagcloudsection.php b/lib/grouptagcloudsection.php index 9b7a10f6b..0e0cbdd63 100644 --- a/lib/grouptagcloudsection.php +++ b/lib/grouptagcloudsection.php @@ -73,7 +73,7 @@ class GroupTagCloudSection extends TagCloudSection $quoted = array(); foreach ($names as $name) { - $quoted[] = "\"$name\""; + $quoted[] = "'$name'"; } $namestring = implode(',', $quoted); -- cgit v1.2.3-54-g00ecf From a9613e999f0c55830269daaf0f76fddc6b26d329 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 21 Jul 2009 13:52:59 -0400 Subject: Detect xmpp uri's and make them into hyperlinks http://laconi.ca/trac/ticket/1592 --- lib/util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/util.php b/lib/util.php index 9e8ec41d2..f23f10e2c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -414,9 +414,9 @@ function common_replace_urls_callback($text, $callback, $notice_id = null) { $regex = '#'. '(?:'. '(?:'. - '(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|xmpp|irc)://'. + '(?:https?|ftps?|mms|rtsp|gopher|news|nntp|telnet|wais|file|prospero|webcal|irc)://'. '|'. - '(?:mailto|aim|tel):'. + '(?:mailto|aim|tel|xmpp):'. ')'. '[^.\s]+\.[^\s]+'. '|'. -- cgit v1.2.3-54-g00ecf From 10a6751ddb22ba960f8313acac130c5c63b30086 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 21 Jul 2009 14:03:08 -0400 Subject: Fixed: If the site name contains "." or "@" (and perhaps others), then notification emails (such as the email confirmation email) fail with the error "LOG_ERR: PEAR error: Validation failed for: SITE_NAME :" Thanks jk3us http://laconi.ca/trac/ticket/1356 --- lib/mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/mail.php b/lib/mail.php index 90ee3c992..262f788ee 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -121,7 +121,7 @@ function mail_notify_from() $domain = mail_domain(); - $notifyfrom = common_config('site', 'name') .' '; + $notifyfrom = '"'.common_config('site', 'name') .'" '; } return $notifyfrom; -- cgit v1.2.3-54-g00ecf From 52d51fad3c4716a1978553921ececee571cf9971 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 21 Jul 2009 15:10:00 -0400 Subject: Fixed: Browser language preference's not used when using Google Chrome Thanks bambeeq http://laconi.ca/trac/ticket/620 --- lib/language.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/language.php b/lib/language.php index 3ea3dd2aa..9ad2d31bd 100644 --- a/lib/language.php +++ b/lib/language.php @@ -53,7 +53,7 @@ function client_prefered_language($httplang) if (!empty($httplang[2][$i])) { // if no q default to 1.0 $client_langs[$httplang[2][$i]] = - ($httplang[6][$i]? (float) $httplang[6][$i] : 1.0); + ($httplang[6][$i]? (float) $httplang[6][$i] : 1.0 - ($i*0.01)); } if (!empty($httplang[3][$i]) && empty($client_langs[$httplang[3][$i]])) { // if a catchall default 0.01 lower -- cgit v1.2.3-54-g00ecf