PDA

View Full Version : integrating users


Jedi Knight
02-15-2008, 06:24 AM
Sorry, the search feature seems to be broken.

I need to insert users from table phpbb_users into table users.
I don't want my board members to have to register both at my board and at my image host.

I have tried using an insert_user funtion, but haven't figured it out.
So I thought maybe this would be simplier.

A php script would probably be better in the long run to automatically insert the data into the db, but without the knowledge to get it going, I'm willing to update the db as often as it takes. Unless a script can be created to combine the two tables as new members register.Either way, it's way over my head.

Any help would be greatly appreciated.

Andrew Johnson
02-15-2008, 07:02 PM
Why don't you just choose one table to use.. ?

outseeker
02-15-2008, 07:44 PM
Hey Jedi, if you're having trouble administering your SQL databases using command line you should try this front end! http://www.sql-front.com/download.html

It's a Windows GUI for SQL and my god it makes life sooo easy. You would like to move all users from phpnbb_users to users? Select the entries and drag them to where you want them. If you want to see the SQL code used to do the transfer, you can right click and hit properties on the table with newly created entries! Enjoy :D

Jedi Knight
02-15-2008, 09:21 PM
Why don't you just choose one table to use.. ?

I've certainly been trying to do this, but haven't got it yet. Thanks.

Hey Jedi, if you're having trouble administering your SQL databases using command line you should try this front end! http://www.sql-front.com/download.html

It's a Windows GUI for SQL and my god it makes life sooo easy. You would like to move all users from phpnbb_users to users? Select the entries and drag them to where you want them. If you want to see the SQL code used to do the transfer, you can right click and hit properties on the table with newly created entries! Enjoy :D

I'll giveit a try and see what it'll allow me to do. Thanks.

Jedi Knight
02-15-2008, 11:14 PM
seems like there should be a

else if($loggedin)


somewhere in there.
<?
include("include/common.php");

if(!$loggedin){
ob_start();
header("Location: login.php");
}

$query = "SELECT * FROM phpbb_users WHERE user_id='$myuid'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if ( ($result) && (mysql_num_rows($result) > 0) ){
$row = mysql_fetch_object($result);
}
include("include/header.php");
include("include/accmenu.php");

$c=mysql_query("select * from phpbb_users where user_id='$myuid'");
$d=mysql_fetch_object($c);
if(is_object($d)) {
$cusername = $d->username;
$cpassword = $d->user_password;
$cemail = $d->user_email;
$csignup_date = $d->user_regdate;
}

$a = $HTTP_POST_VARS[a];
if (!$a) { $a = $HTTP_GET_VARS[a]; }
$in = $HTTP_POST_VARS[in];
if (!$in) { $in = $HTTP_GET_VARS[in]; }

$citem_name=stripslashes($citem_name);
$citem_price=stripslashes($citem_price);
$citem_goal=stripslashes($citem_goal);
$citem_currency=stripslashes($citem_currency);
$cemail_subject=stripslashes($cemail_subject);
$cemail_message=stripslashes($cemail_message);
$csuccess=stripslashes($csuccess);
$ccancelled=stripslashes($ccancelled);
$cbusiness=stripslashes($cbusiness);

switch($a){
case "vp":
include("include/g_vp.inc");
break;
case "cp":
include("include/g_cp.inc");
break;
case "cp2":
include("include/g_cp2.inc");
break;
case "gdc":
include("include/g_gdc.inc");
break;
case "dm":
include("include/g_dm.inc");
break;
case "sl":
include("include/g_sl.inc");
break;
default:
echo "<h3>Welcome $cusername</h3>";
echo $table2."<tr align=center><td colspan=2>Please choose an option from the menu above.<p></td></tr></table>";
break;
}
# echo "</table>";
include("include/footer.php");
?>

anyways, it is reading from the right table now. because when I try to register a user, I get 'username already in use'. but when I login, the login page reappears. so it's got to be something in the above code.

EricaStar
02-16-2008, 08:29 PM
I'm assuming your using MySql. If 5 or later, why not create a trigger using After Insert?

StupidRalph
02-16-2008, 08:39 PM
seems like there should be a

else if($loggedin)


somewhere in there.


They aren't using elseif($loggedin) b/c if a person isn't logged in then they are sent to the login page and everything else below that never occurs. Everything after that statement works if they are logged in.

Jedi Knight
02-17-2008, 06:06 PM
I want to thank everyone for helping, but I have decided to try to find a script that is already integrated in phpbb2.
Since I am new to coding, making this one work is way over my head.

outseeker
02-19-2008, 12:50 PM
Hey man, are you using phpnuke and phpbb by any chance? If so, there is already a ported phpbb called bb2nuke I believe. That uses only the one out of 2 user tables properly. It has phpbb use the phpnuke user setup.