PHP error in WP

Discussion in 'Programming' started by basscleff, Sep 17, 2007.

  1. #1
    Fatal error: Cannot redeclare class snoopy in .../wp-includes/class-snoopy.php on line 40

    anyone have any expertise in fixing this?
     
    basscleff, Sep 17, 2007 IP
  2. sitefever

    sitefever Banned

    Messages:
    782
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What are you trying to do?? What were you doing that made that error appear??
     
    sitefever, Sep 17, 2007 IP
  3. basscleff

    basscleff Active Member

    Messages:
    1,161
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    I'm running a tubepress plugin on a wp blog. The error appears in my sidebar on the very bottom here:
    www.topbabes.info

    I'm still building the blog, but there seems to be little help.
    the error points to the class-snoopy.php file, and the line in question is calling
    "class snoopy"
    other than that... I have no idea :)
     
    basscleff, Sep 17, 2007 IP
  4. sitefever

    sitefever Banned

    Messages:
    782
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you're running PHP from the sidebar, you'll have to use the execPHP plugin unless it's coded straight into your theme.

    I've got execPHP's URL posted at http://sitefever.com/plugins-used/

    Thats the only thing I can think of right off the top of my head.
     
    sitefever, Sep 17, 2007 IP
  5. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #5
    This error means you're declaring the same class twice or more. (Perhaps you're including the file in a loop). Or it just has been declared in another file or somewhere. It's hard to say without seeing your code. Or maybe another plugin is using the snoopy class...
     
    nico_swd, Sep 17, 2007 IP
  6. basscleff

    basscleff Active Member

    Messages:
    1,161
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #6
    I'm running standard wordpress, and I believe it's sidebar.php. (I pasted html into the sidebar widget)
    does that help at all?


    thx

     
    basscleff, Sep 17, 2007 IP
  7. basscleff

    basscleff Active Member

    Messages:
    1,161
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #7
    any idea how I can search for another instance or call to the class? makes sense to error out when trying to redeclare.

    thx

     
    basscleff, Sep 17, 2007 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    Hard to say without seeing the code. But what you could try is putting the class (the one you know where it is) between a little if condition that goes like:
    
    if (!class_exists('Snoopy'))
    {
    
        // Put here all code for the class
    
    }
    
    PHP:
     
    nico_swd, Sep 18, 2007 IP