2012-05-15, 09:03 PM
EDIT: ****** FULL WORKING PLUGIN is in post #3 *********
I'm trying to make a plugin to check user name against a out side database. I am using the "hello world" plugin as a staring point. I made the changes to do the work I need but it dose not seem to run. I enabled error reporting and got not errors but it is not showing on the plugins page for me to active.
here is the code
the only thing not showen is some vars for DB info.
why is this not activating or even showing in the plugins page.
Thanks.
I'm trying to make a plugin to check user name against a out side database. I am using the "hello world" plugin as a staring point. I made the changes to do the work I need but it dose not seem to run. I enabled error reporting and got not errors but it is not showing on the plugins page for me to active.
here is the code
$plugins->add_hook("member_do_register_start", "check_user_in_game");
function check_user_in_game_info()
{
return array(
"name" => "Check User In Game",
"description" => "Check Users IGN (in game name) for minecraft",
"version" => "1.0",
"guid" => "",
"compatibility" => "1.6.7"
);
}
function check_user_in_game($this)
{
$conUserName = mysql_connect($check_user_in_game_DB_location,$check_user_in_game_DB_name,$check_user_in_game_DB_pass);
mysql_select_db($check_user_in_game_DB_name, $conUserName);
$checkUserNameCall = "SELECT playername FROM `".$check_user_in_game_DB_table."` WHERE playername = '".mysql_real_escape_string($this->data['username'])."' LIMIT 1";
$checkUserNameResult = mysql_query($checkUserNameCall,$conUserName) or $this->set_error("Oh, snap! Something went wrong if HordeCraft Member. dang!");
if($checkUserNameResult && mysql_num_rows($checkUpdateResult) < 1)
{
mysql_close($conUserName);
$this->set_error("Not A HordeCraft Member.");
return false;
}
mysql_close($conUserName);
return true;
}
the only thing not showen is some vars for DB info.
why is this not activating or even showing in the plugins page.
Thanks.