Make WordPress Core


Ignore:
Timestamp:
05/05/2004 07:34:41 AM (22 years ago)
Author:
saxmatt
Message:

Some style cleanup. Category base and additional URI options from Jay McCarthy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-blog-header.php

    r1186 r1227  
    5151}
    5252
    53 $wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name', 'category_name', 'feed', 'author_name');
     53$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name');
    5454
    5555    for ($i=0; $i<count($wpvarstoreset); $i += 1) {
     
    133133$wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)";
    134134
    135 // if a month is specified in the querystring, load that month
    136 if ($m != '') {
    137     $m = ''.intval($m);
    138     $where .= ' AND YEAR(post_date)='.substr($m,0,4);
     135// If a month is specified in the querystring, load that month
     136if ('' != $m) {
     137    $m = '' . preg_replace('|[^0-9]|', '', $m);
     138    $where .= ' AND YEAR(post_date)=' . substr($m, 0, 4);
    139139    if (strlen($m)>5)
    140         $where .= ' AND MONTH(post_date)='.substr($m,4,2);
     140        $where .= ' AND MONTH(post_date)=' . substr($m, 4, 2);
    141141    if (strlen($m)>7)
    142         $where .= ' AND DAYOFMONTH(post_date)='.substr($m,6,2);
     142        $where .= ' AND DAYOFMONTH(post_date)=' . substr($m, 6, 2);
    143143    if (strlen($m)>9)
    144         $where .= ' AND HOUR(post_date.)='.substr($m,8,2);
     144        $where .= ' AND HOUR(post_date)=' . substr($m, 8, 2);
    145145    if (strlen($m)>11)
    146         $where .= ' AND MINUTE(post_date)='.substr($m,10,2);
     146        $where .= ' AND MINUTE(post_date)=' . substr($m, 10, 2);
    147147    if (strlen($m)>13)
    148         $where .= ' AND SECOND(post_date)='.substr($m,12,2);
    149 
    150 }
    151 
    152 if ($year != '') {
     148        $where .= ' AND SECOND(post_date)=' . substr($m, 12, 2);
     149}
     150
     151if ('' != $hour) {
     152    $hour = '' . intval($hour);
     153    $where .= " AND HOUR(post_date)='$hour'";
     154}
     155
     156if ('' != $minute) {
     157    $minute = '' . intval($minute);
     158    $where .= " AND MINUTE(post_date)='$minute'";
     159}
     160
     161if ('' != $second) {
     162    $second = '' . intval($second);
     163    $where .= " AND SECOND(post_date)='$second'";
     164}
     165
     166if ('' != $year) {
    153167    $year = '' . intval($year);
    154168    $where .= " AND YEAR(post_date)='$year'";
    155169}
    156170
    157 if ($monthnum != '') {
     171if ('' != $monthnum) {
    158172    $monthnum = '' . intval($monthnum);
    159173    $where .= " AND MONTH(post_date)='$monthnum'";
    160174}
    161175
    162 if ($day != '') {
     176if ('' != $day) {
    163177    $day = '' . intval($day);
    164178    $where .= " AND DAYOFMONTH(post_date)='$day'";
    165179}
    166180
    167 if ($name != '') {
     181if ('' != $name) {
    168182    $name = preg_replace('/[^a-z0-9-]/', '', $name);
    169183    $where .= " AND post_name = '$name'";
    170184}
    171185
    172 if ($w != '') {
     186if ('' != $w) {
    173187    $w = ''.intval($w);
    174188    $where .= " AND WEEK(post_date, 1)='$w'";
Note: See TracChangeset for help on using the changeset viewer.