Commit b169cbed authored by merlinofchaos's avatar merlinofchaos

Sigh. totally broke a bunch of arguments with the postgres fixes.

parent c7c6368e
......@@ -519,7 +519,7 @@ function views_handler_arg_year($op, &$query, $argtype, $arg = '') {
return $fieldinfo;
break;
case 'sort':
$query->add_orderby(NULL, 'year', $argtype);
$query->add_orderby(NULL, "YEAR(FROM_UNIXTIME(node.created+$timezone))", $argtype, 'year');
break;
case 'filter':
$year = intval($arg);
......@@ -542,7 +542,7 @@ function views_handler_arg_month($op, &$query, $argtype, $arg = '') {
return $fieldinfo;
break;
case 'sort':
$query->add_orderby(NULL, 'name', $argtype);
$query->add_orderby(NULL, "MONTH(FROM_UNIXTIME(node.created+$timezone))", $argtype, 'name');
break;
case 'filter':
$month = intval($arg);
......@@ -567,7 +567,7 @@ function views_handler_arg_week($op, &$query, $argtype, $arg = '') {
return $fieldinfo;
break;
case 'sort':
$query->add_orderby(NULL, 'name', $argtype);
$query->add_orderby(NULL, "WEEK(FROM_UNIXTIME(node.created+$timezone), 3)", $argtype, 'name');
break;
case 'filter':
// The 3 makes the week 1-53, the first week of the year has at least 3 days
......@@ -591,7 +591,7 @@ function views_handler_arg_monthyear($op, &$query, $argtype, $arg = '') {
return $fieldinfo;
break;
case 'sort':
$query->add_orderby(NULL, "name", $argtype);
$query->add_orderby(NULL, "DATE_FORMAT(FROM_UNIXTIME(node.created+$timezone), '%Y%m')", $argtype, 'name');
break;
case 'filter':
$query->add_where("DATE_FORMAT(FROM_UNIXTIME(node.created+$timezone), '%Y%m') = '%s'", $arg);
......@@ -613,7 +613,7 @@ function views_handler_arg_fulldate($op, &$query, $argtype, $arg = '') {
return $fieldinfo;
break;
case 'sort':
$query->add_orderby(NULL, 'name', $argtype);
$query->add_orderby(NULL, "DATE_FORMAT(FROM_UNIXTIME(node.created+$timezone), '%Y%m%%d')", $argtype, 'name');
break;
case 'filter':
$query->add_where("DATE_FORMAT(FROM_UNIXTIME(node.created+$timezone), '%Y%m%%d') = '%s'", $arg);
......
......@@ -1803,9 +1803,9 @@ function views_handler_sort_date($op, &$query, $sortinfo, $sort) {
$alias = $field;
}
$query->add_field($field, $table, $as);
$query->orderby[] = "$alias $sort[sortorder]";
// $query->add_orderby($table, $field, $sort['sortorder']);
// $query->add_field($field, $table, $as);
// $query->orderby[] = "$alias $sort[sortorder]";
$query->add_orderby($table, $field, $sort['sortorder'], $as);
}
function views_handler_sort_date_minute($op, &$query, $sortinfo, $sort) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment