aboutsummaryrefslogtreecommitdiffstats
path: root/mod/dirsearch.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-26 18:27:03 -0800
committerfriendica <info@friendica.com>2015-01-26 18:27:03 -0800
commitac594183c6fdc6cf4d5a2a29ade7478a17336397 (patch)
treed38f73727da4d8697b00d2102ae10b501d1909ce /mod/dirsearch.php
parente6bfe3f2c10e851ed5ba49886ec8d0a9a9de2296 (diff)
parent9f5bfca28dde23893156ad36682e20ca2fc0dd45 (diff)
downloadvolse-hubzilla-ac594183c6fdc6cf4d5a2a29ade7478a17336397.tar.gz
volse-hubzilla-ac594183c6fdc6cf4d5a2a29ade7478a17336397.tar.bz2
volse-hubzilla-ac594183c6fdc6cf4d5a2a29ade7478a17336397.zip
Merge branch 'master' into tres and add some work on the item_deleted flag refactor
Conflicts: include/attach.php include/onedirsync.php include/zot.php mod/locs.php
Diffstat (limited to 'mod/dirsearch.php')
-rw-r--r--mod/dirsearch.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 947198466..f62320378 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -148,10 +148,10 @@ function dirsearch_content(&$a) {
// If &return_total=1, we count matching entries and return that as 'total_items' for use in pagination.
// By default we return one page (default 80 items maximum) and do not count total entries
- $logic = ((strlen($sql_extra)) ? 0 : 1);
+ $logic = ((strlen($sql_extra)) ? 'false' : 'true');
if($hash)
- $logic = 1;
+ $logic = 'true';
if($dirmode == DIRECTORY_MODE_STANDALONE) {
$sql_extra .= " and xchan_addr like '%%" . get_app()->get_hostname() . "' ";
@@ -165,7 +165,7 @@ function dirsearch_content(&$a) {
if($limit)
$qlimit = " LIMIT $limit ";
else {
- $qlimit = " LIMIT " . intval($startrec) . " , " . intval($perpage);
+ $qlimit = " LIMIT " . intval($perpage) . " OFFSET " . intval($startrec);
if($return_total) {
$r = q("SELECT COUNT(xchan_hash) AS `total` FROM xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and xchan_network = 'zot' and xchan_hidden = 0 and xchan_orphan = 0 and xchan_deleted = 0 $safesql ");
if($r) {
@@ -347,14 +347,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)
);
}