WordPress.org

Ready to get started?Download WordPress

Forums

1.0: problems with archives. they've disppeared. (17 posts)

  1. seraph
    Member
    Posted 10 years ago #

    December has disappeared. Can someone help me fix this?
    I am using the mod_rewrite htaccess stuff with these settings:
    /archives/%year%/%monthnum%/%day%/%postname%/
    I didn't change them till the problem occured on the 28th I think it was, when I posted something after a week of not having done so. All of a sudden, the site only displayed that one post. I deleted the post, thinking maybe something had gone wrong, and the other's disappeared. Now, there are only posts from January 2004.
    Any help would be appreciated.

  2. seraph
    Member
    Posted 10 years ago #

    here is the rewrite rule generated:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^archives/([0-9]{4})?/?([0-9]{1,2})?/?([0-9]{1,2})?/?([0-9a-z-]+)?/?([0-9]+)?/?$ /index.php?year=$1&monthnum=$2&day=$3&name=$4&page=$5 [QSA]
    RewriteRule ^archives/category/(.*) /index.php?category_name=$1 [QSA]

  3. Laughinglizard
    Member
    Posted 10 years ago #

    I dont think your problem is the mod_rewrite rules. Your old archives work just fine. Your new archives dont work even without the mod_rewrite rules.
    For example:
    http://denial.loose-screws.com/index.php?m=200312 - works, 0.72 style
    http://denial.loose-screws.com/index.php?year=2003&monthnum=12 - does not
    Which leads me to believe that you might not have replaced all the require links in your index.php. I see that wp-blog-header.php is on your server. Is it part of the require in your index.php?

  4. Nothlit
    Member
    Posted 10 years ago #

    I'm having a similar problem. I just upgraded from 0.72 to 1.0 last night, and the new mod-rewrite archive style works fine for January 2004 and December 2003 entries, but anything older than that yields a "no posts matched criteria" message.
    After seeing LaughingLizard's example in the previous post, I checked and my blog is exhibiting the same behavior. Old-school 0.72 style archive query strings (like "m=200311") work fine, but mod-rewrite strings and 1.0 style query strings (like "year=2003&monthnum=11") do not.
    I have required "wp-blog-header.php" so I don't know what else to check for...

  5. Laughinglizard
    Member
    Posted 10 years ago #

    It is very difficult to troubleshoot because I dont have access to your databases. However, try this:
    Put this line at the end of your wp-blog-header.php before the ending php tags (?>):
    echo $where;
    It should look like this on top of your page:
    AND YEAR(post_date)=2003 AND post_date <= '2004-01-03 12:21:53' AND (post_status = "publish")
    when using index.php?year=2003

  6. Nick Momrik
    Member
    Posted 10 years ago #

    Same here for me. I've checked my index.php and I can't find any missing require links before this line:
    <?php if ($posts) { foreach ($posts as $post) { start_wp(); ?> I have modified the index.php to match my old one, but I can't find anything I would have missed.
    I don't think it would be anything after this line since the else part of this is what gives the message: Sorry, no posts matched your criteria.

  7. Nick Momrik
    Member
    Posted 10 years ago #

    LL,
    I put that line in my file if you need an example to look at.
    http://mtdewvirus.com/
    Thanks!

  8. Nick Momrik
    Member
    Posted 10 years ago #

    This is what shows at the top of my page with your string LL:
    AND YEAR(post_date)=2003 AND post_date > '2003-12-28 00:00:00' AND post_date <= '2004-01-03 12:25:46' AND (post_status = "publish")
    For some reason 12/28 is in there! Now...how to fix it?

  9. Laughinglizard
    Member
    Posted 10 years ago #

    This might be a temporary fix for you guys till allusion comes up with a better solution. Off the top of my head:
    Find this line in your wp-blog-header.php:
    } elseif ($what_to_show == 'days') {
    and replace it with this line:
    } elseif ($what_to_show == 'days' && empty($monthnum) && empty($year) && empty($day)) {
    Hope this helps.
    Peace

  10. Nick Momrik
    Member
    Posted 10 years ago #

    That line is in two places...

  11. Nick Momrik
    Member
    Posted 10 years ago #

    Well, I found out where this goofy date is coming from....
    if ((!$whichcat) && (!$m) && (!$p) && (!$w) && (!$s) && empty($poststart) && empty($postend)) {
    if ($what_to_show == 'posts') {
    $limits = ' LIMIT '.$posts_per_page;
    } elseif ($what_to_show == 'days') {
    $lastpostdate = get_lastpostdate();
    echo $lastpostdate;
    $lastpostdate = mysql2date('Y-m-d 00:00:00',$lastpostdate);
    echo $lastpostdate;
    $lastpostdate = mysql2date('U',$lastpostdate);
    echo $lastpostdate;
    $otherdate = date('Y-m-d H:i:s', ($lastpostdate - (($posts_per_page-1) * 86400)));
    echo $otherdate;
    $where .= ' AND post_date > \''.$otherdate.'\'';
    }
    }

    I added the echos to see what was being calculated and here it is:
    2004-01-03 03:55:08
    2004-01-03 00:00:00
    1073116800
    2003-12-28 00:00:00

  12. Nick Momrik
    Member
    Posted 10 years ago #

    LL, the temporary fix worked. Thanks!

  13. Nothlit
    Member
    Posted 10 years ago #

    The fix worked for me as well. I'll keep checking back to see if Matt has any "official" comments to make, but I'm happy now. Thanks for the help. :-)

  14. Laughinglizard
    Member
    Posted 10 years ago #

    Glad it worked! I was off with my girlfriend for her birthday so I could not respond...sorry!

  15. seraph
    Member
    Posted 10 years ago #

    didn't work here :/

  16. Laughinglizard
    Member
    Posted 10 years ago #

    Seraph...I can see December now...did anything change?

  17. Nick Momrik
    Member
    Posted 10 years ago #

    This has been fixed in the latest CVS.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.