I want those who add a listing also be signed up as a user. I have added a field called username to the idx_link table. Then during the add listing process, I want to compare the email address and the user name in the idx_users table to the information being submitted thru add.php to make sure the email address and user name will be the same. They have to be in idx_users table first but I am not requiring the user to logged in at this point. But I will probably make that requirement shortly.
In the ProcessFormAddUrl() function of add.php just before the line if(empty($error_msg)) { , I added the following:
Just a few lines above that, make the folllowing change:// mod to look for user name and email
$conn = ConnectDB();
$query = "select username, email from idx_users where email = '$email'";
$result = $conn->Execute($query);
if($result) {
$u_email = $result->Fields("email");
$u_username = $result->Fields("username");
}
if($u_email != $email) $error_msg = $msg["10101a"];
if($u_username != $username) $error_msg = $msg["10101b"];
NOTE: the global line should be just one line. I made it two lines for the forum because I hate to scroll to the right on the screen.Code:// vars template // mod for $username global $error_msg, $password, $link_id, $title, $url, $description, $contact_name, $email, $bid, $category, $add_cat1, $add_cat2, $keywords, $username ;
Finally, in the msg.php file in the /themes/default folder, add the following after $msg["10107"] about line 467
Code:// mod for user name $msg["10101a"] = "Email does not match the email in the user file"; $msg["10101b"] = "Username does not match username in the user file";



