• Plugin URL: https://www.cheekyboots.com/?page_id=15
    (The author of the plugin is not interested in supporting it)

    I was using this plugin prior to the installation of WP 2.1, after the install this plugin writes out the wrong days (it says that my blog has been up for 2614 days, and it has only been up for 23 days).

    Any ideas on how I could fix this?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Try changing:

    $first_post = $wpdb->get_results(”SELECT post_date_gmt FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date < '$now' ORDER BY post_date ASC Limit 1");

    to

    $first_post = $wpdb->get_results(”SELECT post_date_gmt FROM wp2_posts WHERE post_status = 'publish' ORDER BY post_date ASC Limit 1");

    Thread Starter cythera

    (@cythera)

    I tried that, and it resulted in an error, could it be from a space somewere?

    “Parse error: syntax error, unexpected T_STRING in /home/jenny/public_html/comatose/wp-content/plugins/days_old.php on line 14”

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    No, the query was correct before, change it back to the default. You don’t want to specify the table exactly, since the prefix may be different.

    The plugin looks like it works okay to me. Basically, it pulls out the date of the oldest post and then does the math to figure out the difference between now and then. What’s the date on your oldest post? Might want to double check it in your Manage->Posts screen.

    Thread Starter cythera

    (@cythera)

    January 3rd I wrote my first post, and according to Manage-> Posts: 2007-01-03.

    That’s 23 days ago, and not 2624 as the output of the plugin is (tried it a minute ago with the default coding).

    @otto42
    No, that was just an error in my copy and paste. I forgot to change it back. The code itself broke with 2.1 because wordpress now uses a post status of future rather than $now for posts from the past.

    @cythera
    The code itself is correct, the forums gave it a magic quote which invalidated it. if it doesn’t work this time, just manually change type in the quote.
    $first_post = $wpdb->get_results("SELECT post_date_gmt FROM $wpdb->pposts WHERE post_status = 'publish' ORDER BY post_date ASC Limit 1")

    Thread Starter cythera

    (@cythera)

    I saw the quote and edited it, however when pasting it back in it gives me the same error but on line 15 which is this:

    if ($first_post) {

    Checked the coding for spaces and no spaces where found.

    I just set up that plugin and it worked fine. But I am still using 2.0.7. So, something changed in WP 2.1 (I’ll take a look). I looked at your blog and the first post was on April 6, 2006, if I’m not mistaken.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    No, that was just an error in my copy and paste. I forgot to change it back. The code itself broke with 2.1 because wordpress now uses a post status of future rather than $now for posts from the past.

    Umm.. Wha? ??

    Sorry, I can’t quite parse that. It almost made sense to me, but I’m going to have to ask you to clarify. Please? ??

    Thread Starter cythera

    (@cythera)

    jwurster: I’m using the plugin on a different blog (same domain name, different extension). comatose.nu is still running on 2.0.7 and is quite dead atm…

    @cythera: Since I don’t have WP 2.1 installed yet, I can’t help you there. But if you do still have the 2.0.7 blog running, I will try to help.

    I also had an error after I copied and pasted the original code. I had to go through the code and change all the single and double quotes. Then it worked.

    Thread Starter cythera

    (@cythera)

    On my blog that is running on 2.0.7, I’m not using this plugin. So, no problems there.

    On the one that’s running on 2.1, I have the problem described in the first post in this thread…

    I’ve finally written my first releasable WordPress plugin and it has this same function and more. It’s called Running Time and can be found on Google Code for now.

    It works with WordPress 2.1, in fact it’s the only version it’s been tested with.

    Hope you find it useful,

    / Hami

    Thread Starter cythera

    (@cythera)

    Thank you Hami, I will try it out right away!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Days since Birth plugin’ is closed to new replies.