Undefined variable message with mod_owned.php

Home Forums Scripts Enthusiast Undefined variable message with mod_owned.php

This topic contains 1 reply, has 1 voice, and was last updated by  Azurite 2 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15510

    Azurite
    Participant

    I’m getting REALLY close to being able to bridge WordPress and Enthusiast–for real. I think there have been tutorials, but for whatever reason, they either aren’t around anymore (don’t apply to the current versions of WP and/or Enthusiast), or don’t work (for me, at least).

    I’m at the point where I have the Insert PHP WordPress plugin working on a Multisite/Network install of WordPress. I have a page I’ve created for the code of a fanlisting’s members list. However, after the code is inserted, I get this:

    Notice: Undefined variable: db_server in /home/username/public_html/e3/mod_owned.php on line 71
    
    Notice: Undefined variable: db_user in /home/username/public_html/e3/mod_owned.php on line 71
    
    Notice: Undefined variable: db_password in /home/username/public_html/e3/mod_owned.php on line 71
    
    Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /home/username/public_html/e3/mod_owned.php on line 71
    Cannot connect to the database. Check your config file and try again. MySQL said:

    So it can obviously read the code to the point of getting to mod_owned.php, but it stumbles on this line:

    $db_link = mysql_connect( $db_server, $db_user, $db_password )

    From what I understand, it’s because it has no idea what $db_link is, which is defined above in the line

    require 'config.php';

    Or at least the database, username, and password are. Is it really not talking to config.php AT ALL, or is it specifically looking for $db_link and not seeing it, and therefore failing?

    Help!

    #15512

    Azurite
    Participant

    Fixed. For anyone wanting to know, when you try and bridge Enthusiast and WordPress, of course the config.php file for Enthusiast will be in a different folder (along with the show_ and mod_ .php files) than the WordPress installation.

    So what I did was go throughout all the Enthusiast core scripts and update those lines that “required” config.php for either the Fanlisting (rare) or the Core (my Enthusiast folder, in other words), and I changed it like so:

    require $_SERVER['DOCUMENT_ROOT'].'/e3/config.php'

    Where e3 is my Enthusiast folder. Your server’s document root will typically be something like home/username/public_html or similar; there are a bunch of other PHP variables that can point to different locations, but this is the one that I’ve found works the best and doesn’t impact other parts of the code (by turning it into a website, e.g. http://mydomain.com/… or including a filename with the config.php appended to it)!

    This does, however, mean that the bridging changes I’m making are going to be unique to me, and that I’m commenting pretty much every single place where I make them, so I know that this is different from the original code (and would therefore need to be changed by YOU if you wanted to try this).

    Just a heads up. :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.