Nuke2Xoops Very Simple (Users Table)
Date 2006/12/26 8:10:00 | Topic: Hacks
| Today I need these php codes for transferring nuke users to a xoops site..and I wrote these codes and wanted to share with you
It is very simple..just use it
$MysqlHost = "localhost"; // your mysql host $MysqlKullanici = "root"; // your mysql user name $MysqlSifre = ""; // your mysql password $NukeVeritabaniAdi = "nuke"; // your nuke database name $NukeVeritabaniOneki = "nuke"; // your nuke prefix $XoopsVeritabaniAdi = "xoops"; // your xoops database name $XoopsVeritabaniOneki = "xoops"; // your xoops prefix $veriyolu = mysql_connect($MysqlHost, $MysqlKullanici, $MysqlSifre); mysql_select_db($NukeVeritabaniAdi, $veriyolu); $nukeuyelerinisor = mysql_query("SELECT * FROM ".$NukeVeritabaniOneki."_users ORDER BY user_id ASC"); while($nukeuyeleri = mysql_fetch_array($nukeuyelerinisor)) { mysql_select_db($XoopsVeritabaniAdi); $kayit = mysql_query("INSERT INTO ".$XoopsVeritabaniOneki."_users (uid, uname, email, user_regdate, pass, umode) VALUES('".$nukeuyeleri['user_id']."', '".$nukeuyeleri['username']."', '".$nukeuyeleri['user_email']."', '".time()."', '".$nukeuyeleri['user_password']."', 'flat');"); if($kayit) { mysql_query("INSERT INTO ".$XoopsVeritabaniOneki."_groups_users_link (groupid, uid) VALUES ('2', '".$nukeuyeleri['user_id']."');"); echo $nukeuyeleri['username']." added successfully "; } else { echo $nukeuyeleri['username']." passd because this id has already exists "; } } echo " That's all .... http://www.xoopshocasi.com">XoopSHoCasI"; mysql_close($veriyolu); ?>
Bora Canbula -- xoopshocasi@xoopshocasi.com Uncertified XOOPS Support
|
|