diff --git a/docs/NEWS b/docs/NEWS index ff0131f0..38cb8388 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.5 () ------------------------------------------------------------------------ + * Added 'orderby' parameter to plugin API hooks for the serendipity + fulltext search function (garvinhicking) + * Added new event hook frontend_sidebar_plugins to iterate through sidebar plugins and modify their output. $eventData is the array of their data. (garvinhicking) diff --git a/include/functions_entries.inc.php b/include/functions_entries.inc.php index d8f29c65..33df7dcd 100644 --- a/include/functions_entries.inc.php +++ b/include/functions_entries.inc.php @@ -787,6 +787,7 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') { } } + $cond['orderby'] = "timestamp DESC"; $cond['and'] = " AND isdraft = 'false' " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND timestamp <= " . serendipity_db_time() : ''); serendipity_plugin_api::hook_event('frontend_fetchentries', $cond, array('source' => 'search', 'term' => $term)); serendipity_ACL_SQL($cond, 'limited'); @@ -823,7 +824,7 @@ function &serendipity_searchEntries($term, $limit = '', $searchresults = '') { {$serendipity['fullCountQuery']} {$cond['group']} {$cond['having']} - ORDER BY timestamp DESC + ORDER BY {$cond['orderby']} $limit"; $search =& serendipity_db_query($querystring);