header

Gallery 1.5, redeclaring _() function

I recently upgraded Pat’s photo gallery from Gallery 1.4.4 to the latest version released 2/15/05, 1.5 RC1.

After installing and reconfiguring, I get this message:

Fatal error: Cannot redeclare _() (previously declared in /home/raybdbom/public_html/pat/lib/lang.php:192) in /home/raybdbom/public_html/pat/lib/lang.php on line 192

I googled it and wasn’t able to find a solution. Some fool with a .com had a same problem when integrating his gallery with Wordpress, but his solution didn’t work for me (probably because I’m not using WP’s ‘_’ function).

Anyway, the problem was it was trying to redefine the ‘_’ function when it was already defined. So I fixed it. Here’s what it was previously:

          if (!gettext_installed()) {
                  function _($string) {
                          return $string ;
                  }
          }

And here’s what I changed it to that made it work

          if (!gettext_installed()
               && !function_exists('_')) {
                  function _($string) {
                         return $string ;
                  }
          }

1 Comment »

  1. gravatar

    lukasz Said,

    January 2, 2006 @ 12:25 pm

    thanks for solution :) i moved some stuff to a new machine and needed to fix this issue as soon as possible. so googled for a while and found this post :) cheers! :)

RSS feed for comments on this post

Leave a Comment

blogtimes