used SQL standard LIMIT/OFFSET, because every database can understand that

This commit is contained in:
Brenda Wallace 2009-06-26 22:13:41 +12:00
parent 63ea2b7c45
commit 1a151ff6f6

View File

@ -74,11 +74,7 @@ class PopularNoticeSection extends NoticeSection
$offset = 0; $offset = 0;
$limit = NOTICES_PER_SECTION + 1; $limit = NOTICES_PER_SECTION + 1;
if (common_config('db', 'type') == 'pgsql') { $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
$qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
} else {
$qry .= ' LIMIT ' . $offset . ', ' . $limit;
}
$notice = Memcached_DataObject::cachedQuery('Notice', $notice = Memcached_DataObject::cachedQuery('Notice',
sprintf($qry, common_config('popular', 'dropoff')), sprintf($qry, common_config('popular', 'dropoff')),