migrated autoresponder-cron to new PDO database class, beautify sql-query in paging-class, fix typos in traffic-cron (thx to Dessa), refs #1287

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-20 08:15:30 +01:00
parent 55185aab5c
commit 345ba3a202
3 changed files with 56 additions and 64 deletions

View File

@@ -316,7 +316,12 @@ class paging {
|| ($natSorting === null && $this->natSorting == true)
) {
// Acts similar to php's natsort(), found in one comment at http://my.opera.com/cpr/blog/show.dml/160556
$sortcode = 'ORDER BY CONCAT( IF( ASCII( LEFT( ' . $sortfield . ', 5 ) ) > 57, LEFT( ' . $sortfield . ', 1 ), \'0\' ), IF( ASCII( RIGHT( ' . $sortfield . ', 1 ) ) > 57, LPAD( ' . $sortfield . ', 255, \'0\' ), LPAD( CONCAT( ' . $sortfield . ', \'-\' ), 255, \'0\' ) ) ) ' . $sortorder;
$sortcode = "ORDER BY CONCAT( IF( ASCII( LEFT( " . $sortfield . ", 5 ) ) > 57,
LEFT( " . $sortfield . ", 1 ), 0 ),
IF( ASCII( RIGHT( " . $sortfield . ", 1 ) ) > 57,
LPAD( " . $sortfield . ", 255, '0' ),
LPAD( CONCAT( " . $sortfield . ", '-' ), 255, '0' )
)) " . $sortorder;
} else {
$sortcode = 'ORDER BY ' . $sortfield . ' ' . $sortorder;
}