/[drupal]/contributions/modules/archive/archive.pages.inc
ViewVC logotype

Diff of /contributions/modules/archive/archive.pages.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.18 by susurrus, Fri Jan 4 12:25:33 2008 UTC revision 1.19 by susurrus, Tue May 6 18:41:01 2008 UTC
# Line 1  Line 1 
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.
# Line 84  function archive_page($type = 'all', $ye Line 84  function archive_page($type = 'all', $ye
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    
# Line 174  function _archive_node_types($date) { Line 174  function _archive_node_types($date) {
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();

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.3