directory server dba sql fixes
This commit is contained in:
parent
90fbfb313e
commit
6d291d880e
@ -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 not ( xchan_flags & %d)>0 and not ( xchan_flags & %d )>0 and not ( xchan_flags & %d )>0 $safesql ",
|
||||
intval(XCHAN_FLAGS_HIDDEN),
|
||||
|
Reference in New Issue
Block a user