WordPress.org

Ready to get started?Download WordPress

Forums

Parse error in my Dashboard (6 posts)

  1. Melodiefabrieknl
    Member
    Posted 7 years ago #

    In my dashboard under Blog Statistics there's an error showing up:

    Parse error: syntax error, unexpected ',' in /home/dapost/domains/marcoraaphorst.nl/public_html/wp-includes/gettext.php(313) : eval()'d code on line 1

    WHat might be the cause of this?

  2. Melodiefabrieknl
    Member
    Posted 7 years ago #

    sorry people, can anyone please help?

  3. bdf
    Member
    Posted 7 years ago #

    I'm getting exactly the same problem on WP 2.1.2, I have upgraded to 2.1.3 but it didn't help... any ideas?

  4. bdf
    Member
    Posted 7 years ago #

    Okay, I've managed to fix it - with a quick and dirty hack...

    I have opened index.php under wp-admin and changed

    $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
    if (0 < $numcomms) $numcomms = number_format($numcomms);

    into

    $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
    if (0 < $numcomms) $numcomms = number_format($numcomms);
    $numcomms = str_replace (",","",$numcomms);

    This is because I have installed WordPress in Italian language, and today I've reached comment #1,000. For some reason, my WordPress installation didn't like the ",".
    So the str_replace strips it out...
    I hope this helps!

  5. Melodiefabrieknl
    Member
    Posted 7 years ago #

    it seems to be a bug. we should report it. thanks bdf!

  6. researcher
    Member
    Posted 7 years ago #

    did you report this already?
    for all international wp blogs it migth be possible to change the line above as well. just start looking at line 101 of the index.php in the wp-admin.

    change both lines to:

    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish'");
    if (0 < $numposts) $numposts = number_format($numposts);
    $numposts = str_replace (",","",$numposts);
    
    $numcomms = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '1'");
    if (0 < $numcomms) $numcomms = number_format($numcomms);
    $numcomms = str_replace (",","",$numcomms);

    and your dashboard is fine again.

    this bug appears when you have more than 1000 entries and comments.
    thnx to BDF everything works fine.

Topic Closed

This topic has been closed to new replies.

About this Topic