Jump to content

[SOLVED] Website Users....


Northern Flame

Recommended Posts

Is their a way to have every user that registers to my website automatically register for my forums? and vise versa? For example, lets say someone registers to my website with the username: test123,

is there a way so that the username and password for test123 can automatically be registered for my forums, and also if the username is taken in either my forums or my website, it will tell the user. Does anyone here know how to do this? Thanks for reading, and by the way if it will help anyone answer my question, I am using a phpBB forum

Link to comment
Share on other sites

oh lol.. kk, there is a way to do it, because I did...

 

in your forums/includes/usercp_register.php

 

go down to the line where it says:

 

$sql = "INSERT INTO " . USERS_TABLE . "    (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
                VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";

 

it would be easier to say line 630.

 

create a new $sql, and name it $sql1, on line 632. (Use notepad if you have to.)


$sql1 = "INSERT INTO table_name VALUES (
'', //id
'', //firstname (phpBB doesn't ask for it)
'', //lastname (phpBB doesn't ask)
'" . str_replace("\'", "''", $email) . "', 
'" . str_replace("\'", "''", $username) . "',
'" . str_replace("\'", "''", $new_password) . "', //md5 encrypted password
'" . str_replace("\'", "''", $location) . "',
'" . str_replace("\'", "''", $occupation) . "', 
'" . str_replace("\'", "''", $website) . "', 
)"; 

 

You would obviously need to change the order of them to fit your table

 

and then just

 

mysql_query($sql1);

 

right after the $sql1

Link to comment
Share on other sites

Or, instead of creating users in your own table, write them directly to phpbb_users. This is what I ended up doing. I have a small site with simple requirements so I just get basic info and fill in the other options with what I thought would be default. The users can always edit their profile after. You can also add fields to phpbb_users for extra info. Just be sure to know that adding fields may cause problems later upgrading versions, backup all info before you upgrade. Then use the phpbb login system and you're good to go.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.