mirror of
https://github.com/Universal-Omega/DynamicPageList3
synced 2024-11-14 11:16:52 +00:00
Fix usage of scroll and order in the same query (#88)
This commit is contained in:
parent
ce64f763a3
commit
a0a2b862bc
|
@ -2052,23 +2052,25 @@ class Query {
|
|||
* @param mixed $option
|
||||
*/
|
||||
private function _titlegt( $option ) {
|
||||
$where = '(';
|
||||
|
||||
if ( substr( $option, 0, 2 ) == '=_' ) {
|
||||
if ( $this->parameters->getParameter( 'openreferences' ) ) {
|
||||
$where .= 'pl_title >= ' . $this->DB->addQuotes( substr( $option, 2 ) );
|
||||
} else {
|
||||
$where .= $this->tableNames['page'] . '.page_title >= ' . $this->DB->addQuotes( substr( $option, 2 ) );
|
||||
}
|
||||
} else {
|
||||
if ( $this->parameters->getParameter( 'openreferences' ) ) {
|
||||
$where .= 'pl_title > ' . $this->DB->addQuotes( $option );
|
||||
} else {
|
||||
$where .= $this->tableNames['page'] . '.page_title > ' . $this->DB->addQuotes( $option );
|
||||
}
|
||||
$operator = '>';
|
||||
if ( substr( $option, 0, 2 ) === '=_' ) {
|
||||
$option = substr( $option, 2 );
|
||||
$operator = '>=';
|
||||
}
|
||||
|
||||
if ( $option === '' ) {
|
||||
$operator = 'LIKE';
|
||||
$option = '%';
|
||||
} else {
|
||||
$option = $this->DB->addQuotes( $option );
|
||||
}
|
||||
|
||||
if ( $this->parameters->getParameter( 'openreferences' ) ) {
|
||||
$where = "(pl_title {$operator} {$option})";
|
||||
} else {
|
||||
$where = "({$this->tableNames['page']}.page_title {$operator} {$option})";
|
||||
}
|
||||
|
||||
$where .= ')';
|
||||
$this->addWhere( $where );
|
||||
}
|
||||
|
||||
|
@ -2078,23 +2080,25 @@ class Query {
|
|||
* @param mixed $option
|
||||
*/
|
||||
private function _titlelt( $option ) {
|
||||
$where = '(';
|
||||
|
||||
if ( substr( $option, 0, 2 ) == '=_' ) {
|
||||
if ( $this->parameters->getParameter( 'openreferences' ) ) {
|
||||
$where .= 'pl_title <= ' . $this->DB->addQuotes( substr( $option, 2 ) );
|
||||
} else {
|
||||
$where .= $this->tableNames['page'] . '.page_title <= ' . $this->DB->addQuotes( substr( $option, 2 ) );
|
||||
}
|
||||
} else {
|
||||
if ( $this->parameters->getParameter( 'openreferences' ) ) {
|
||||
$where .= 'pl_title < ' . $this->DB->addQuotes( $option );
|
||||
} else {
|
||||
$where .= $this->tableNames['page'] . '.page_title < ' . $this->DB->addQuotes( $option );
|
||||
}
|
||||
$operator = '<';
|
||||
if ( substr( $option, 0, 2 ) === '=_' ) {
|
||||
$option = substr( $option, 2 );
|
||||
$operator = '<=';
|
||||
}
|
||||
|
||||
if ( $option === '' ) {
|
||||
$operator = 'LIKE';
|
||||
$option = '%';
|
||||
} else {
|
||||
$option = $this->DB->addQuotes( $option );
|
||||
}
|
||||
|
||||
if ( $this->parameters->getParameter( 'openreferences' ) ) {
|
||||
$where = "(pl_title {$operator} {$option})";
|
||||
} else {
|
||||
$where = "({$this->tableNames['page']}.page_title {$operator} {$option})";
|
||||
}
|
||||
|
||||
$where .= ')';
|
||||
$this->addWhere( $where );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue