Hi there,
I have this hook:
<?php
function setupweb($vars) {
$password= $vars["params"][password];
$email= $vars["params"][email];
$domain= $vars["params"][domain];
$subdomain=str_replace(".$main_domain", "", $vars["params"][domain]);
exec("mysql -uroot -p$root_pass $subdomain < /home/master/master.sql");
$date = date("Y-m-d H:i:s");
$connection = mysql_connect("localhost","root","S4ha5do0w");
mysql_select_db("dbmydnsconfig", $connection);
$sql="INSERT INTO `dns_rr` VALUES('', 1, 0, 'riud', 'riud', '', 1, 5, '$subdomain', 'A', '$server_ip', 0, 86400, 'Y', '2010-04-30 17:21:16', 2010043002)";
$sqlb="INSERT INTO `hosting` VALUES('', '$subdomain', '$password','$date' ,'0','$_SERVER[HTTP_REFERER]','$_SERVER[REMOTE_ADDR]','$data')";
mysql_query($sql,$connection);
mysql_query($sqlb,$connection);
mysql_close($connection);
}
add_hook("AfterModuleCreate",1,"setupweb");
?>
And it makes it right. It creates a Database and also a folder and insert some data in a DB table. But then, I needed to insert more code which is:
mysql_select_db($subdomain, $connection);
$mailsql="UPDATE 'config' set config_value='$email' where config_name like 'admin_email'";
mysql_query($mailsql,$connection);
The DB "selected" is the one created in this step:
exec("mysql -uroot -p$root_pass $subdomain < /home/master/master.sql");
I've tried to put in another function and execute it using
add_hook("AfterModuleCreate",2,"setupanotherfunction");
And also inside the function at the top but it doesn't do anything... anyone have any clues?