aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/dirsearch.php5
-rw-r--r--mod/sitelist.php3
2 files changed, 5 insertions, 3 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 4a44feb7d..06d530849 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -355,14 +355,15 @@ function dir_parse_query($s) {
function list_public_sites() {
+ $rand = db_getfunc('rand');
$realm = get_directory_realm();
if($realm == DIRECTORY_REALM) {
- $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') order by rand()",
+ $r = q("select * from site where site_access != 0 and site_register !=0 and ( site_realm = '%s' or site_realm = '') order by $rand",
dbesc($realm)
);
}
else {
- $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' order by rand()",
+ $r = q("select * from site where site_access != 0 and site_register !=0 and site_realm = '%s' order by $rand",
dbesc($realm)
);
}
diff --git a/mod/sitelist.php b/mod/sitelist.php
index 95cf862df..4e52f0463 100644
--- a/mod/sitelist.php
+++ b/mod/sitelist.php
@@ -9,8 +9,9 @@ function sitelist_init(&$a) {
$sql_order = " order by site_url ";
+ $rand = db_getfunc('rand');
if($order == 'random')
- $sql_order = " order by rand() ";
+ $sql_order = " order by $rand ";
$sql_limit = " limit $start, $limit ";