| 1 |
<?php |
<?php |
| 2 |
// $Id: archive.pages.inc,v 1.17 2007/12/26 20:40:38 susurrus Exp $ |
// $Id: archive.pages.inc,v 1.18 2008/01/04 12:25:33 susurrus Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Fetch nodes for the selected date, or current date if none selected. |
* Fetch nodes for the selected date, or current date if none selected. |
| 84 |
} |
} |
| 85 |
// Handle URLs that are incorrectly typed and try to parse info out of them |
// Handle URLs that are incorrectly typed and try to parse info out of them |
| 86 |
else { |
else { |
| 87 |
if ($date->days[$date->day]) { |
if (isset($date->days[$date->day])) { |
| 88 |
drupal_goto(_archive_url($type, $date->year, $date->month, $date->day)); |
drupal_goto(_archive_url($type, $date->year, $date->month, $date->day)); |
| 89 |
} |
} |
| 90 |
else if ($date->months[$date->month]) { |
else if (isset($date->months[$date->month])) { |
| 91 |
drupal_goto(_archive_url($type, $date->year, $date->month)); |
drupal_goto(_archive_url($type, $date->year, $date->month)); |
| 92 |
} |
} |
| 93 |
else if ($date->years[$date->year]) { |
else if (isset($date->years[$date->year])) { |
| 94 |
drupal_goto(_archive_url($type, $date->year)); |
drupal_goto(_archive_url($type, $date->year)); |
| 95 |
} |
} |
| 96 |
else { |
else if ($_GET['q'] != ($url = _archive_url($type))){ |
| 97 |
drupal_goto(_archive_url($type)); |
drupal_goto($url); |
| 98 |
} |
} |
| 99 |
} |
} |
| 100 |
|
|
| 174 |
$end = 0; |
$end = 0; |
| 175 |
} |
} |
| 176 |
if ($start && $end) { |
if ($start && $end) { |
| 177 |
$result = db_query(db_rewrite_sql('SELECT t.type, t.name, COUNT(n.nid) AS node_count FROM {node} n INNER JOIN {node_type} t ON t.type = n.type WHERE n.status = 1 AND t.type IN ("'. join($types, '", "') .'") AND n.created BETWEEN %d AND %d GROUP BY n.type ORDER BY n.created'), $start - $date->tz, $end - $date->tz); |
$result = db_query(db_rewrite_sql('SELECT t.type, t.name, COUNT(n.nid) AS node_count FROM {node} n INNER JOIN {node_type} t ON t.type = n.type WHERE n.status = 1 AND t.type IN (\''. join($types, '\', \'') .'\') AND n.created BETWEEN %d AND %d GROUP BY n.type ORDER BY n.created'), $start - $date->tz, $end - $date->tz); |
| 178 |
} |
} |
| 179 |
else { |
else { |
| 180 |
$result = db_query(db_rewrite_sql('SELECT t.type, t.name, COUNT(n.nid) AS node_count FROM {node} n INNER JOIN {node_type} t ON t.type = n.type WHERE n.status = 1 AND t.type IN ("'. join($types, '", "') .'") GROUP BY n.type ORDER BY n.created')); |
$result = db_query(db_rewrite_sql('SELECT t.type, t.name, COUNT(n.nid) AS node_count FROM {node} n INNER JOIN {node_type} t ON t.type = n.type WHERE n.status = 1 AND t.type IN (\''. join($types, '\', \'') .'\') GROUP BY n.type ORDER BY n.created')); |
| 181 |
} |
} |
| 182 |
|
|
| 183 |
$n_types = array(); |
$n_types = array(); |