WordPress.org

Forums

[resolved] Broken stats field in control panel of WP 2.1 (11 posts)

  1. domenSLO
    Member
    Posted 8 years ago #

    The following error appeared after I upgraded to 2.1

    ---

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

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

    ---
    Any clues? The stats are functioning (number of posts, number of comments), just this error won`t go away.

    help.

  2. Pattty
    Member
    Posted 8 years ago #

    me too, im having this problem with 2.1

  3. crisdias
    Member
    Posted 8 years ago #

    I have the same error. I disabled my localization (WP_LANG on wp-config.php) and the error is gone for the time being.

  4. Pattty
    Member
    Posted 8 years ago #

    wow. you are true, i desabled too my (WP_LANG)-it was in spanish- and its fine everything. but, well its not ok, i mean, my other blogs are ok, and this one was the only having this problem.

    ...

  5. dcaceres
    Member
    Posted 8 years ago #

    I have the same problem, but I don't want disable my spanish language file...

  6. peter-noster
    Member
    Posted 8 years ago #

    sorry for double post. my solution below-

  7. peter-noster
    Member
    Posted 8 years ago #

    I figured a temporary solution is a new 'str_replace' added to the 'gettext.php' in the wp-includes folder (function select_string()):


    // NEW AT LINE 306
    $string = str_replace(’,',”;”,$string);

    That does it for me at the moment with a german localization.

  8. Rodrigo M
    Member
    Posted 8 years ago #

    Your solution works perfectly peter-noster.

    I' ve published it in spanish in my blog.
    (solución en castellano): http://www.pandeblog.net/blogosfera/2007/01/error-en-el-tablero-de-wordpress-21-problemas-con-el-fichero-wp-includesgettextphp313/

    Thanks a lot

  9. domenSLO
    Member
    Posted 8 years ago #

    Erm...can you put that in a more "verbose" mode? Not very good with php and when I added your line to the line 306 in the gettext.php, everything crashed.

    So..little more help pls. :)

  10. peter-noster
    Member
    Posted 8 years ago #

    Here is the complete code of the function select_string. Replace this (make sure to do a back up):

    /**
    * Detects which plural form to take
    *
    * @access private
    * @param n count
    * @return int array index of the right plural form
    */
    function select_string($n) {
    $string = $this->get_plural_forms();
    $string = str_replace('nplurals',"\$total",$string);
    $string = str_replace("n",$n,$string);
    $string = str_replace('plural',"\$plural",$string);

    // New
    $string = str_replace(',',";",$string);

    # poEdit doesn't put any semicolons, which
    # results in parse error in eval
    $string .= ';';

    $total = 0;
    $plural = 0;

    eval("$string");

    if ($plural >= $total) $plural = $total - 1;
    return $plural;
    }

    Hope it works for you. Otherwise download my version of the gettext.php here and replace it:
    http://www.peter-noster.de/tmp/gettext.zip

  11. domenSLO
    Member
    Posted 8 years ago #

    Thanks a million, peter-noster. Your file did the trick!

Topic Closed

This topic has been closed to new replies.

About this Topic