aboutsummaryrefslogtreecommitdiff
path: root/mod/search/search_hooks.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2013-03-13 02:13:17 +0100
committerSem <sembrestels@riseup.net>2013-03-13 02:13:17 +0100
commitd730a0c5861c2e79faa3e58dd2b171ca4d197c6f (patch)
treecb4658e1c60a60c5f663845d49b108dd4608a89a /mod/search/search_hooks.php
parent0fb3e5396d10d21323eb3bbc04727fd4a5a6d06d (diff)
parent34b14b305f5a106316fdc403c4ce80b25e89b51d (diff)
downloadelgg-d730a0c5861c2e79faa3e58dd2b171ca4d197c6f.tar.gz
elgg-d730a0c5861c2e79faa3e58dd2b171ca4d197c6f.tar.bz2
Merge tag '1.8.14' of git://github.com/Elgg/Elgg into foxglove-3
Elgg 1.8.14 Conflicts: mod/tinymce/vendor/tinymce/jscripts/tiny_mce/langs/en.js mod/tinymce/vendor/tinymce/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js
Diffstat (limited to 'mod/search/search_hooks.php')
-rw-r--r--mod/search/search_hooks.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php
index 62058abf1..47351fb8a 100644
--- a/mod/search/search_hooks.php
+++ b/mod/search/search_hooks.php
@@ -35,6 +35,7 @@ function search_objects_hook($hook, $type, $value, $params) {
}
$params['count'] = FALSE;
+ $params['order_by'] = search_get_order_by_sql('e', 'oe', $params['sort'], $params['order']);
$entities = elgg_get_entities($params);
// add the volatile data for why these entities have been returned.
@@ -89,6 +90,7 @@ function search_groups_hook($hook, $type, $value, $params) {
}
$params['count'] = FALSE;
+ $params['order_by'] = search_get_order_by_sql('e', 'ge', $params['sort'], $params['order']);
$entities = elgg_get_entities($params);
// add the volatile data for why these entities have been returned.
@@ -159,6 +161,7 @@ function search_users_hook($hook, $type, $value, $params) {
}
$params['count'] = FALSE;
+ $params['order_by'] = search_get_order_by_sql('e', 'ue', $params['sort'], $params['order']);
$entities = elgg_get_entities($params);
// add the volatile data for why these entities have been returned.
@@ -261,6 +264,7 @@ function search_tags_hook($hook, $type, $value, $params) {
}
$params['count'] = FALSE;
+ $params['order_by'] = search_get_order_by_sql('e', null, $params['sort'], $params['order']);
$entities = elgg_get_entities($params);
// add the volatile data for why these entities have been returned.
@@ -398,6 +402,11 @@ function search_comments_hook($hook, $type, $value, $params) {
return array ('entities' => array(), 'count' => 0);
}
+ $order_by = search_get_order_by_sql('e', null, $params['sort'], $params['order']);
+ if ($order_by) {
+ $order_by = "ORDER BY $order_by";
+ }
+
$q = "SELECT DISTINCT a.*, msv.string as comment FROM {$db_prefix}annotations a
JOIN {$db_prefix}metastrings msn ON a.name_id = msn.id
JOIN {$db_prefix}metastrings msv ON a.value_id = msv.id
@@ -407,7 +416,8 @@ function search_comments_hook($hook, $type, $value, $params) {
AND $e_access
AND $a_access
$container_and
-
+
+ $order_by
LIMIT $offset, $limit
";