Make WordPress Core

Changeset 470 for trunk/blog.header.php


Ignore:
Timestamp:
10/26/2003 05:25:26 AM (22 years ago)
Author:
saxmatt
Message:

Alpha functionality of new permalink structure as per previous discussions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/blog.header.php

    r404 r470  
    1414require_once ($curpath.$b2inc.'/xmlrpcs.inc');
    1515
    16 $b2varstoreset = array('m','p','posts','w','c', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby');
     16$b2varstoreset = array('m','p','posts','w','c', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'monthnum');
    1717
    1818    for ($i=0; $i<count($b2varstoreset); $i += 1) {
     
    8383}
    8484
     85if ($year != '') {
     86    $year = '' . intval($year);
     87    $where .= ' AND YEAR(post_date)=' . $year;
     88}
     89
     90if ($monthnum != '') {
     91    $monthnum = '' . intval($monthnum);
     92    $where .= ' AND MONTH(post_date)=' . $monthnum;
     93}
     94
     95if ($day != '') {
     96    $hay = '' . intval($day);
     97    $where .= ' AND DAYOFMONTH(post_date)=' . $day;
     98}
     99
     100if ($name != '') {
     101    $name = preg_replace('/[^a-z0-9-]/', '', $name);
     102    $where .= " AND post_name = '$name'";
     103}
     104
    85105if ($w != '') {
    86106    $w = ''.intval($w);
    87     $where .= ' AND WEEK(post_date,1)='.$w;
     107    $where .= ' AND WEEK(post_date, 1)=' . $w;
    88108}
    89109
     
    207227}
    208228
    209 if ( !empty($postend) && ($postend > $poststart) && (!$m) &&(!$w) && (!$whichcat) && (!$s) && (!$p)) {
     229if ( !empty($postend) && ($postend > $poststart) && (!$m) && !$month && !$year && !$day &&(!$w) && (!$whichcat) && (!$s) && (!$p)) {
    210230    if ($what_to_show == 'posts' || ($what_to_show == 'paged' && (!$paged))) {
    211231        $poststart = intval($poststart);
     
    244264        }
    245265    }
    246     elseif (($m) || ($p) || ($w) || ($s) || ($whichcat) || ($author)) {
     266    elseif (($m) || ($p) || ($w) || ($s) || ($whichcat) || ($author) || $month || $year || $day) {
    247267        $limits = '';
    248268    }
     
    282302}
    283303
    284 //error_log("$request");
    285 //echo $request;
     304// error_log("$request");
     305// echo $request;
    286306$posts = $wpdb->get_results($request);
     307
     308if (1 == count($posts)) {
     309    $more = 1; $c = 1; $single = 1;
     310}
    287311?>
Note: See TracChangeset for help on using the changeset viewer.