Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Adding a "How Did You Hear About Us" ??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-13-2003, 05:13 PM
 
poboy poboy is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default Adding a "How Did You Hear About Us" ??

I would like to add a text input field on the registration page that displays with the user information. I would like it to be a "How Did You Hear About Us" textarea input multiline. Will someone please give me an example of code to edit and if I need to add a field to my database? I use phpAdmin and I'm pretty good with the database part, just a complete newbie who is eager to learn when it comes to the smarty template. I have a feeling I will add the text input to the register.tpl, then edit some file that writes to the database, probably a php file and then edit a php file that does the query from the database with a display. I have the concept, but I can't afford to mess up the variables. Any help would be greatly appreciated. Thank you.

Chris
Reply With Quote
  #2  
Old 04-13-2003, 05:45 PM
 
poboy poboy is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default I DID IT!!!

This post is kinda wide?
Wow, my first successful edit..I searched for a post and found this:

Quote:
Posted: Wed Apr 09, 2003 9:45 pm Post subject: Steps to add a second address line and province field...

--------------------------------------------------------------------------------

I am in the process of 'hacking' my x-cart to allow for a second address line, and a 'province' line for international (non-US) users.

I have added the fields to the database, in customer and order tables, and modified the register.php script to insert the new lines of data into the database.

However, I fail to find the script to modify to get the new address data into the orders table... all the data is entered into the customers table correctly, but not in the orders table (my added fields are left blank).

Anyone have any suggestions? Thanks!!!

Paul
I don't need to edit it in the order table, it just has to display for my customer and it did. For anyone who is interested, I added a field to the "customers" table called "hear" and here is my register.tpl code:
Code:
{* $Id: register.tpl,v 1.50 2002/11/18 13:17:24 alfiya Exp $ *} {include file="check_email_script.tpl"} {if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"} {assign var="last_location" value="Modify profile"} {elseif $smarty.get.mode eq "delete" or $smarty.post.mode eq "delete"} {assign var="last_location" value="Delete profile"} {elseif $last_location eq ""} {assign var="last_location" value="New member"} {/if} {include file="location.tpl" last_location=$last_location} {if $newbie eq "Y"} {if $registered eq ""} {if $smarty.get.mode eq "update"} This form enables you to modify your profile so that your data is always valid. {else} <font class=Text> {if $usertype eq "B"} The form below allows you to create a profile which is necessary to see banner statistics and see orders and payments. Do not forget that this information is essential to use our services correctly. Fields marked with <font class="TableCenterCustomerFormOrange">*</font> are mandatory. {else} The form below allows you to create a profile which is necessary to place orders. Do not forget that this information is essential to use our services correctly. Fields marked with <font class="TableCenterCustomerFormOrange">*</font> are mandatory. {/if} </font> {/if} {/if} {/if} {capture name=dialog} {if $registered eq ""} {if $reg_error eq "F" } <font class=Star> The form filled with errors ! Check that you have entered all mandatory values. Check that your password match confirmation. </font> {elseif $reg_error eq "E" } <font class=Star>Email address already exists in database ! </font> {elseif $reg_error eq "U" } <font class=Star>User already exists!</font> {/if} {if $error ne ""} <font class=Star>{$error}</font> {/if} <table width=100% border=0 cellspacing=0 cellpadding=2> {include file="check_cc_number_script.tpl"} <form action="{ $register_script_name }?{ $smarty.server.QUERY_STRING }" method=post name=registerform> <tr valign=middle> <td height=20 colspan=3>Personal information<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>Title</td> <td><font class=Star>*</font></td> <td nowrap> <select name=title> {section name=title loop=$name_titles} <option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option> {/section} </select> </td> </tr> <tr valign=middle> <td align=right>First Name</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}"> {if $reg_error ne "" and $userinfo.firstname eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>Last Name</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}"> {if $reg_error ne "" and $userinfo.lastname eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>Company</td> <td></td> <td nowrap> <input type=text name=company size=32 maxlength=32 value="{$userinfo.company}"> </td> </tr> <tr valign=middle> <td align=right>How Did You Hear About Us?</td> <td></td> <td nowrap> <input type=text name=hear size=32 maxlength=255 value="{$userinfo.hear}"> </td> </tr> {* <TR valign=middle> *} {* <TD align=right>SSN</TD> *} {* <TD></TD> *} {* <TD nowrap> *} {* <INPUT type=text name=ssn size=32 maxlength=32 value="{$userinfo.ssn}"> *} {* </TD> *} {* </TR> *} {if $usertype eq "A" or $usertype eq "P"} <tr valign=middle> <td align=right>Refered by:</td> <td></td> <td nowrap> {$userinfo.referer} </td> </tr> {/if} <tr valign=middle> <td height=20 colspan=3>Billing Address<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>Address</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=b_address size=32 maxlength=64 value="{$userinfo.b_address}"> {if $reg_error ne "" and $userinfo.b_address eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>City</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=b_city size=32 maxlength=64 value="{$userinfo.b_city}"> {if $reg_error ne "" and $userinfo.b_city eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>State</td> <td>{if $states ne ""}<font class=Star>*</font>{/if}</td> <td nowrap> {if $states ne ""} <select name=b_state size=1> <option value=" ">Select one...</option> {section name=state_idx loop=$states} <option value={$states[state_idx].state_code} {if $userinfo.b_state eq $states[state_idx].state_code}selected{/if}>{$states[state_idx].state}</option> {/section} </select> {else} <input type=text size=32 name=b_state value="{$userinfo.b_state}"> {/if} </td> </tr> <tr valign=middle> <td align=right>Country</td> <td><font class=Star>*</font></td> <td nowrap> <select name=b_country> {section name=country_idx loop=$countries} <option value={$countries[country_idx].country_code} {if $userinfo.b_country eq $countries[country_idx].country_code}selected{elseif $countries[country_idx].country_code eq $config.General.default_country and $userinfo.b_country eq ""}selected{/if}>{$countries[country_idx].country}</option> {/section} </select> </td> </tr> <tr valign=middle> <td align=right>Zip code</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=b_zipcode size=32 maxlength=32 value="{$userinfo.b_zipcode}"> {if $reg_error ne "" and $userinfo.b_zipcode eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td height=20 colspan=3>Shipping Address (leave empty if same as billing address)<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>Address</td> <td></td> <td nowrap> <input type=text name=s_address size=32 maxlength=64 value="{$userinfo.s_address}"> </td> </tr> <tr valign=middle> <td align=right>City</td> <td></td> <td nowrap> <input type=text name=s_city size=32 maxlength=64 value="{$userinfo.s_city}"> </td> </tr> <tr valign=middle> <td align=right>State</td> <td></td> <td nowrap> {if $states ne ""} <select name=s_state size=1> <option value=" ">Select one...</option> {section name=state_idx loop=$states} <option value={$states[state_idx].state_code} {if $userinfo.s_state eq $states[state_idx].state_code}selected{/if}>{$states[state_idx].state}</option> {/section} </select> {else} <input type=text size=32 name=s_state value="{$userinfo.s_state}"> {/if} </td> </tr> <tr valign=middle> <td align=right>Country</td> <td></td> <td nowrap> <select name=s_country size=1> {section name=country_idx loop=$countries} <option value={$countries[country_idx].country_code} {if $userinfo.s_country eq $countries[country_idx].country_code}selected{elseif $countries[country_idx].country_code eq $config.General.default_country and $userinfo.b_country eq ""}selected{/if}>{$countries[country_idx].country}</option> {/section} </select> </td> </tr> <tr valign=middle> <td align=right>Zip code</td> <td></td> <td nowrap> <input type=text name=s_zipcode size=32 maxlength=32 value="{$userinfo.s_zipcode}"> </td> </tr> <tr valign=middle> <td height=20 colspan=3>Contact Information<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>Phone</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=phone size=32 maxlength=32 value="{$userinfo.phone}"> {if $reg_error ne "" and $userinfo.phone eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>E-Mail</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=email size=32 maxlength=128 value="{$userinfo.email}"> {if $reg_error ne "" and $userinfo.email eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>Fax</td> <td></td> <td nowrap> <input type=text name=fax size=32 maxlength=128 value="{$userinfo.fax}"></td> </tr> <tr valign=middle> <td align=right>Web site</td> <td></td> <td nowrap> <input type=text name=url size=32 maxlength=128 value="{$userinfo.url}"></td> </tr> {if $usertype eq "C" or $smarty.get.usertype eq "C"} {if $config.General.disable_cc ne "Y"} {include file="main/register_ccinfo.tpl"} {/if} {/if} <tr valign=middle> <td height=20 colspan=3>Username & Password<hr size=1 noshade></td> </tr> {if $userinfo.membership eq "Fulfillment staff" and $userinfo.login eq $login} <input type=hidden name=membership value="{$userinfo.membership}"></d> <input type=hidden name=pending_membership value="{$userinfo.pending_membership}"></d> {else} {if $config.General.membership_signup eq "Y" and ($usertype eq "C" or ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A")} {include file="admin/main/membership_signup.tpl"} {/if} {if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")} {include file="admin/main/membership.tpl"} {/if} {/if} {if $anonymous ne ""} {* Anonymous account *} <tr> <td colspan=3>If you want to become a member of our store, please fill Username and Password fields. Please also enter password confirmation to ensure that you have not entered wrong password.</TD> </tr> <tr valign=middle> <td align=right>Username<font color="#FFFFFF">.</font> </td> <td></td> <td nowrap> <input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}"> </td> </tr> <tr valign=middle> <td align=right>Password<font color="#FFFFFF">.</font> </td> <td></td> <td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}"> </td> </tr> <tr valign=middle> <td align=right>Confirm Password</td> <td></td> <td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}"> </td> </tr> {else} {* NOT anonymous account *} <tr valign=middle> <td align=right>Username<font color="#FFFFFF">.</font> </td> <td><font class=Star>*</font></td> <td nowrap> {if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"} {$userinfo.login} <input type=hidden name=uname value="{$userinfo.login}"> {else} <input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}"> {if $reg_error ne "" and $userinfo.login eq ""}<font class=Star>&lt;&lt;</font>{/if} {/if} </td> </tr> <tr valign=middle> <td align=right>Password<font color="#FFFFFF">.</font> </td> <td><font class=Star>*</font></td> <td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}"> {if $reg_error ne "" and $userinfo.passwd1 eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>Confirm Password</td> <td><font class=Star>*</font></td> <td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}"> {if $reg_error ne "" and $userinfo.passwd2 eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> {/if} <tr valign=middle> <td align=right>Password hint</td> <td></td> <td nowrap><input type=text name=password_hint size=32 maxlength=32 value="{$userinfo.password_hint}"></td> </tr> <tr valign=middle> <td align=right>Password hint answer</td> <td></td> <td nowrap><input type=text name=password_hint_answer size=32 maxlength=32 value="{$userinfo.password_hint_answer}"></td> </tr> <tr valign=middle> <td height=20 colspan=3>Newsletter<hr size=1 noshade></td> </tr> <tr valign=middle> <td></td> <td></td> <td> <input type=checkbox name=newsletter {if $userinfo.newsletter eq "Y"}checked{/if}> I agree to receive notification of any promotions and future plans! </td> </tr> <tr valign=middle> <td></td> <td></td> <td> {if $newbie eq "Y"} By clicking "SUBMIT" you are agree with our <font class=Text>Terms & Conditions</font>. {/if} <font class=FormButton> {if $smarty.get.mode eq "update"} <input type=hidden name=mode value=update> {/if} <input type=hidden name=anonymous value={$anonymous}> {include file="buttons/submit.tpl"} </td> </tr> <input type=hidden name=usertype value="{if $smarty.get.usertype ne ""}{$smarty.get.usertype}{else}{$usertype}{/if}"> </form> </table> {if $newbie eq "Y"} <p class=TableCenterTableTitleOrange>Information Your password must be different from your username. We recommend you using passwords of 5 or more characters. Your e-mail address must be valid. We use e-mail for communication purposes (order notifications, etc). Therefore, it is essential to provide a valid e-mail address to be able to use our services correctly. All your private data is confidential. We will never sell, exchange or market it in any way. For further information on the responsibilities of both parts, you may refer to our <font class=Text>Terms & Conditions</font>{include file="buttons/go.tpl"} {/if} {else} {if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"} Your profile has been modified. {elseif $smarty.get.usertype eq "B" or $usertype eq "B"} Thank you, you are registered as a partner of the store. {else} Thank you, your user profile has been successfully created. A confirmation e-mail has been sent to the email address that you entered. You can use these details to log in to our website in future. This will make your purchase even easier. Now that your account is active and you are logged in you may continue with your purchases. {/if} {/if} {/capture} {if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"} {include file="dialog.tpl" title="Modify profile" content=$smarty.capture.dialog extra="width=100%"} {else} {include file="dialog.tpl" title="New member" content=$smarty.capture.dialog extra="width=100%"} {/if}

And here is my includes/register.php code:
Code:
<? /*****************************************************************************\ +-----------------------------------------------------------------------------+ | X-Cart | | Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved. | +-----------------------------------------------------------------------------+ | The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized | | reproduction of software or use of illegally obtained software. Making | | illegal copies of software is prohibited. Individuals who violate copyright | | law and software licensing agreements may be subject to criminal or civil | | action by the owner of the copyright. | | | | 1. It is illegal to copy a software, and install that single program for | | simultaneous use on multiple machines. | | | | 2. Unauthorized copies of software may not be used in any way. This applies | | even though you yourself may not have made the illegal copy. | | | | 3. Purchase of the appropriate number of copies of a software is necessary | | for maintaining legal status. | | | | DISCLAIMER | | | | THIS SOFTWARE IS PROVIDED BY Ruslan R. Fazliev ``AS IS'' AND ANY | | EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | DISCLAIMED. IN NO EVENT SHALL Ruslan R. Fazliev OR ITS | | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev. | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: register.php,v 1.60.2.2 2003/02/20 08:42:02 svowl Exp $ # session_register ("intershipper_recalc"); require "../include/countries.php"; require "../include/states.php"; if ($REQUEST_METHOD == "POST") { # # Do not check password mismatch # #$passwd2 = $passwd1; # # Anonymous registration (x-cart generates username by itself) # $anonymous_user=false; if($anonymous && empty($uname)) { $max_anonimous = func_query_first("select max(replace(login, '$anonymous_username_prefix', '')-0) from $sql_tbl[customers] where login like '$anonymous_username_prefix%'"); if($max_anonimous) { $next_anonimous_number = array_pop($max_anonimous)+1; $uname = $anonymous_username_prefix.$next_anonimous_number; } else $uname = $anonymous_username_prefix."1"; # # All anonymous accounts must be customers # $usertype = "C"; $passwd1 = $anonymous_password; $passwd2 = $anonymous_password; $anonymous_user=true; } # # User registration info passed to register.php via POST method # $existing_user = func_query_first("select password, email from $sql_tbl[customers] where login='$uname'"); if ($mode=="update") $uerror = false; else $uerror = !(empty($uname)) && !empty($existing_user); # # Check for errors # $uname_tmp=stripslashes($uname); if ( strcmp($uname_tmp, $uname) !=0) {$error="Username ".$uname_tmp." is invalid! Please correct"; } else $error=''; $smarty->assign("error",$error); $fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email)); if (!($uerror || $eerror || $fillerror || $error)) { # # Fields filled without errors. User registered successfully # $crypted = text_crypt($passwd1); if (empty($s_address) && empty($s_city) && empty($s_zipcode)) { $s_state = $b_state; $s_country = $b_country; } if (empty($s_address)) $s_address = $b_address; if (empty($s_city)) $s_city = $b_city; if (empty($s_zipcode)) $s_zipcode = $b_zipcode; # # Add new member to newsletter list # db_query("delete from $sql_tbl[maillist] where email='$existing_user[email]'"); if($newsletter=="on") db_query("insert into $sql_tbl[maillist] (email, since_date) values ('$email','".time()."')"); # # Update/Insert user info # if ($mode=="update") { $intershipper_recalc = "Y"; db_query("update $sql_tbl[customers] set password='$crypted', password_hint='$password_hint', password_hint_answer='$password_hint_answer', title='$title', firstname='$firstname', lastname='$lastname', company='$company', b_address='$b_address', b_city='$b_city', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='$s_address', s_city='$s_city', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', url='$url', card_name='$card_name', card_type='$card_type', card_number='".text_crypt($card_number)."', card_expire='$card_expire', card_cvv2='$card_cvv2', pending_membership='$pending_membership', ssn='$ssn' where login='$login' and usertype='$login_type'"); # # Update membership # if($current_area=="A" || ($active_modules["Simple_Mode"] && $current_area=="P")) db_query("update $sql_tbl[customers] set membership='$membership' where login='$login' and usertype='$login_type'"); $registered="Y"; # # Send mail notifications to customer department and signed customer # $newuser_info = func_userinfo($login,$login_type); $mail_smarty->assign("userinfo",$newuser_info); # # Send mail to registered user # $customer_language = func_get_language ($newuser_info["language"]); func_send_mail($newuser_info["email"], "mail/profile_modified_subj.tpl", "mail/profile_modified.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # func_send_mail($config["Company"]["users_department"], "mail/profile_admin_modified_subj.tpl", "mail/profile_admin_modified.tpl", $newuser_info["email"], true); } else { # # Add new person to customers table # $intershipper_recalc = "Y"; db_query("insert into $sql_tbl[customers] (login,usertype,membership,password,password_hint,password_hint_answer,title,firstname,lastname,company,b_address,b_city,b_state,b_country,b_zipcode,s_address,s_city,s_state,s_country,s_zipcode,phone,email,fax,url,card_name,card_type,card_number,card_expire,card_cvv2,first_login,status,referer,pending_membership,ssn,hear) values ('$uname','$usertype','$membership','$crypted','$password_hint','$password_hint_answer','$title','$firstname','$lastname','$company','$b_address','$b_city','$b_state','$b_country','$b_zipcode','$s_address','$s_city','$s_state','$s_country','$s_zipcode','$phone','$email','$fax','$url','$card_name','$card_type','".text_crypt($card_number)."','$card_expire','$card_cvv2','".time()."','Y','$RefererCookie','$pending_membership','$ssn','$hear')"); # # Update store language for new customer from current $store_language # if ($store_language) db_query ("UPDATE $sql_tbl[customers] SET language='$store_language' WHERE login='$uname'"); # # If it is partner, add his information # if ($usertype == "B") { db_query ("INSERT INTO $sql_tbl[partner_commitions] (login, commition) VALUES ('$uname','0.00')"); } # # Set A-status # if($anonymous_user) db_query("update $sql_tbl[customers] set status='A' where login='$uname' and usertype='$usertype'"); $registered="Y"; # # Send mail notifications to customer department and signed customer # $newuser_info = func_userinfo($uname,$usertype); $mail_smarty->assign("userinfo",$newuser_info); # # Send mail to registered user (do not send to anonymous) # if(!$anonymous_user) if ($usertype=="B") func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_partner_notif.tpl", $config["Company"]["users_department"], false); else func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_notification.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/signin_admin_notif_subj.tpl", "mail/signin_admin_notification.tpl", $email, true); # # Auto-log in # #if($anonymous_user && $usertype=="C") { if($usertype=="C" or ($usertype=="B" and $login=="")) { $auto_login = true; $login = $uname; $login_type = $usertype; $logged = ""; } } } else { # # Fields filled with errors # if ($fillerror) $reg_error="F"; if ($eerror) $reg_error="E"; if ($uerror) $reg_error="U"; } if($anonymous_user) { $uname=""; $passwd1=""; $passwd2=""; } # # Fill $userinfo array if error occured # $userinfo=$HTTP_POST_VARS; $userinfo["login"] = $uname; $userinfo["newsletter"] = ($newsletter=="on"?"Y":""); } else { # # REQUEST_METHOD = GET # if ($mode=="update") { $userinfo = func_userinfo($login,$login_type); } elseif ($mode=="delete" && $confirmed=="Y") { $olduser_info = func_userinfo($login,$login_type); $customer_language = func_get_language ($olduser_info); func_delete_profile($login,$login_type); $login=""; $login_type=""; $smarty->clear_assign("login"); # # Send mail notifications to customer department and signed customer # $mail_smarty->assign("userinfo",$olduser_info); # # Send mail to registered user # if (strstr($olduser_info["login"], $anonymous_username_prefix) ) $anonymous_user=true; else $anonymous_user=false; if(!$anonymous_user) func_send_mail($olduser_info["email"], "mail/profile_deleted_subj.tpl", "mail/profile_deleted.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/profile_admin_deleted_subj.tpl", "mail/profile_admin_deleted.tpl", $olduser_info["email"], true); } } #require "../include/countries.php"; #require "../include/states.php"; #$smarty->assign("current_category",$current_category); if ($uerror || $eerror || $fillerror || $error) { $userinfo[firstname]=stripslashes($firstname); $userinfo[lastname]=stripslashes($lastname); $userinfo[company]=stripslashes($company); $userinfo[ssn]=stripslashes($ssn); $userinfo[hear]=stripslashes($hear); $userinfo[b_address]=stripslashes($b_address); $userinfo[b_city]=stripslashes($b_city); $userinfo[b_zipcode]=stripslashes($b_zipcode); $userinfo[s_address]=stripslashes($s_address); $userinfo[s_city]=stripslashes($s_city); $userinfo[s_state]=stripslashes($s_state); $userinfo[s_zipcode]=stripslashes($s_zipcode); $userinfo[phone]=stripslashes($phone); $userinfo[fax]=stripslashes($fax); $userinfo[uname]=stripslashes($uname); $userinfo[login]=stripslashes($uname); $userinfo[passwd1]=stripslashes($passwd1); $userinfo[passwd2]=stripslashes($passwd2); $userinfo[password_hint]=stripslashes($password_hint); $userinfo[password_hint_answer]=stripslashes($password_hint_answer); } if ($userinfo) foreach ($userinfo as $key=>$value){ if (is_string($value)) $userinfo[$key]=htmlspecialchars($value); } $smarty->assign("userinfo",$userinfo); $smarty->assign("registered",$registered); $smarty->assign("reg_error",$reg_error); if($mode=="delete") { $smarty->assign("main","profile_delete"); } elseif($mode=="notdelete") { $smarty->assign("main","profile_notdelete"); } else $smarty->assign("main","register"); ?>

I have one problem, I can't get the input box to display as multiline. I tried changing the input to "textarea" and putting rows=5, but no luck. I guess it doesn't matter. If anyone sees any problems, please let me know. Thanks,
Chris
Reply With Quote
  #3  
Old 05-10-2003, 04:15 PM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

This line was added in 3.3.5 in the original register.php file (v 1.60.2.4) for anti-hacking. If you use the mod from this post, also put in this snippet at line 53:
Code:
if ($current_area != "A" && $current_area!=$usertype && $mode!="checkout") { echo "Hacking attempt!!!!"; exit; }

...also, because it looks like your version of the register.tpl file has the language variables stripped out, I just added this to my version (just above where they commented out the Social Security fields around line 87):
Code:
{* Added How Heard Here *} <tr valign=middle> <td align=right>{$lng.lbl_how_heard}</td> <td></td> <td nowrap> <input type=text name=hear size=32 maxlength=255 value="{$userinfo.hear}"> </td> </tr> {*----------------------*}
...and then added the $lng.lbl_how_heard variable to the languages.
__________________
-Ken
X-Cart User / Developer Since April 2003
(Varying versions, multiple client sites, 3.x through 4.4.x)
www.pointbweb.com
Reply With Quote
  #4  
Old 05-10-2003, 08:30 PM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

Ok - I found a problem with the register.php mods - the "hear" field is not updated when the user or admin modifies the profile. I fixed this.

So - This is the entire final include/register.php for this mod:
Code:
<? /*****************************************************************************\ +-----------------------------------------------------------------------------+ | X-Cart | | Copyright (c) 2001-2002 Ruslan R. Fazliev. All rights reserved. | +-----------------------------------------------------------------------------+ | The Ruslan R. Fazliev forbids, under any circumstances, the unauthorized | | reproduction of software or use of illegally obtained software. Making | | illegal copies of software is prohibited. Individuals who violate copyright | | law and software licensing agreements may be subject to criminal or civil | | action by the owner of the copyright. | | | | 1. It is illegal to copy a software, and install that single program for | | simultaneous use on multiple machines. | | | | 2. Unauthorized copies of software may not be used in any way. This applies | | even though you yourself may not have made the illegal copy. | | | | 3. Purchase of the appropriate number of copies of a software is necessary | | for maintaining legal status. | | | | DISCLAIMER | | | | THIS SOFTWARE IS PROVIDED BY Ruslan R. Fazliev ``AS IS'' AND ANY | | EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | DISCLAIMED. IN NO EVENT SHALL Ruslan R. Fazliev OR ITS | | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | | | The Initial Developer of the Original Code is Ruslan R. Fazliev. | | Portions created by Ruslan R. Fazliev are Copyright (C) 2001-2002 | | Ruslan R. Fazliev. All Rights Reserved. | +-----------------------------------------------------------------------------+ \*****************************************************************************/ # # $Id: register.php,v 1.60.2.2 2003/02/20 08:42:02 svowl Exp $ # session_register ("intershipper_recalc"); require "../include/countries.php"; require "../include/states.php"; if ($REQUEST_METHOD == "POST") { if ($current_area != "A" && $current_area!=$usertype && $mode!="checkout") { echo "Hacking attempt!!!!"; exit; } # # Do not check password mismatch # #$passwd2 = $passwd1; # # Anonymous registration (x-cart generates username by itself) # $anonymous_user=false; if($anonymous && empty($uname)) { $max_anonimous = func_query_first("select max(replace(login, '$anonymous_username_prefix', '')-0) from $sql_tbl[customers] where login like '$anonymous_username_prefix%'"); if($max_anonimous) { $next_anonimous_number = array_pop($max_anonimous)+1; $uname = $anonymous_username_prefix.$next_anonimous_number; } else $uname = $anonymous_username_prefix."1"; # # All anonymous accounts must be customers # $usertype = "C"; $passwd1 = $anonymous_password; $passwd2 = $anonymous_password; $anonymous_user=true; } # # User registration info passed to register.php via POST method # $existing_user = func_query_first("select password, email from $sql_tbl[customers] where login='$uname'"); if ($mode=="update") $uerror = false; else $uerror = !(empty($uname)) && !empty($existing_user); # # Check for errors # $uname_tmp=stripslashes($uname); if ( strcmp($uname_tmp, $uname) !=0) {$error="Username ".$uname_tmp." is invalid! Please correct"; } else $error=''; $smarty->assign("error",$error); $fillerror = (empty($uname) || !empty($error) || empty($passwd1) || empty($passwd2) || ($passwd1 != $passwd2) || empty($firstname) || empty($lastname) || empty($b_address) || empty($b_city) || (!empty($states) && empty($b_state)) || empty($b_country) || empty($b_zipcode) || empty($phone) || empty($email)); if (!($uerror || $eerror || $fillerror || $error)) { # # Fields filled without errors. User registered successfully # $crypted = text_crypt($passwd1); if (empty($s_address) && empty($s_city) && empty($s_zipcode)) { $s_state = $b_state; $s_country = $b_country; } if (empty($s_address)) $s_address = $b_address; if (empty($s_city)) $s_city = $b_city; if (empty($s_zipcode)) $s_zipcode = $b_zipcode; # # Add new member to newsletter list # db_query("delete from $sql_tbl[maillist] where email='$existing_user[email]'"); if($newsletter=="on") db_query("insert into $sql_tbl[maillist] (email, since_date) values ('$email','".time()."')"); # # Update/Insert user info # if ($mode=="update") { $intershipper_recalc = "Y"; db_query("update $sql_tbl[customers] set password='$crypted', password_hint='$password_hint', password_hint_answer='$password_hint_answer', title='$title', firstname='$firstname', lastname='$lastname', company='$company', b_address='$b_address', b_city='$b_city', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='$s_address', s_city='$s_city', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', url='$url', card_name='$card_name', card_type='$card_type', card_number='".text_crypt($card_number)."', card_expire='$card_expire', card_cvv2='$card_cvv2', pending_membership='$pending_membership', ssn='$ssn' , hear='$hear' where login='$login' and usertype='$login_type'"); # # Update membership # if($current_area=="A" || ($active_modules["Simple_Mode"] && $current_area=="P")) db_query("update $sql_tbl[customers] set membership='$membership' where login='$login' and usertype='$login_type'"); $registered="Y"; # # Send mail notifications to customer department and signed customer # $newuser_info = func_userinfo($login,$login_type); $mail_smarty->assign("userinfo",$newuser_info); # # Send mail to registered user # $customer_language = func_get_language ($newuser_info["language"]); func_send_mail($newuser_info["email"], "mail/profile_modified_subj.tpl", "mail/profile_modified.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # func_send_mail($config["Company"]["users_department"], "mail/profile_admin_modified_subj.tpl", "mail/profile_admin_modified.tpl", $newuser_info["email"], true); } else { # # Add new person to customers table # $intershipper_recalc = "Y"; db_query("insert into $sql_tbl[customers] (login,usertype,membership,password,password_hint,password_hint_answer,title,firstname,lastname,company,b_address,b_city,b_state,b_country,b_zipcode,s_address,s_city,s_state,s_country,s_zipcode,phone,email,fax,url,card_name,card_type,card_number,card_expire,card_cvv2,first_login,status,referer,pending_membership,ssn,hear) values ('$uname','$usertype','$membership','$crypted','$password_hint','$password_hint_answer','$title','$firstname','$lastname','$company','$b_address','$b_city','$b_state','$b_country','$b_zipcode','$s_address','$s_city','$s_state','$s_country','$s_zipcode','$phone','$email','$fax','$url','$card_name','$card_type','".text_crypt($card_number)."','$card_expire','$card_cvv2','".time()."','Y','$RefererCookie','$pending_membership','$ssn','$hear')"); # # Update store language for new customer from current $store_language # if ($store_language) db_query ("UPDATE $sql_tbl[customers] SET language='$store_language' WHERE login='$uname'"); # # If it is partner, add his information # if ($usertype == "B") { db_query ("INSERT INTO $sql_tbl[partner_commitions] (login, commition) VALUES ('$uname','0.00')"); } # # Set A-status # if($anonymous_user) db_query("update $sql_tbl[customers] set status='A' where login='$uname' and usertype='$usertype'"); $registered="Y"; # # Send mail notifications to customer department and signed customer # $newuser_info = func_userinfo($uname,$usertype); $mail_smarty->assign("userinfo",$newuser_info); # # Send mail to registered user (do not send to anonymous) # if(!$anonymous_user) if ($usertype=="B") func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_partner_notif.tpl", $config["Company"]["users_department"], false); else func_send_mail($email, "mail/signin_notification_subj.tpl", "mail/signin_notification.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/signin_admin_notif_subj.tpl", "mail/signin_admin_notification.tpl", $email, true); # # Auto-log in # #if($anonymous_user && $usertype=="C") { if($usertype=="C" or ($usertype=="B" and $login=="")) { $auto_login = true; $login = $uname; $login_type = $usertype; $logged = ""; } } } else { # # Fields filled with errors # if ($fillerror) $reg_error="F"; if ($eerror) $reg_error="E"; if ($uerror) $reg_error="U"; } if($anonymous_user) { $uname=""; $passwd1=""; $passwd2=""; } # # Fill $userinfo array if error occured # $userinfo=$HTTP_POST_VARS; $userinfo["login"] = $uname; $userinfo["newsletter"] = ($newsletter=="on"?"Y":""); } else { # # REQUEST_METHOD = GET # if ($mode=="update") { $userinfo = func_userinfo($login,$login_type); } elseif ($mode=="delete" && $confirmed=="Y") { $olduser_info = func_userinfo($login,$login_type); $customer_language = func_get_language ($olduser_info); func_delete_profile($login,$login_type); $login=""; $login_type=""; $smarty->clear_assign("login"); # # Send mail notifications to customer department and signed customer # $mail_smarty->assign("userinfo",$olduser_info); # # Send mail to registered user # if (strstr($olduser_info["login"], $anonymous_username_prefix) ) $anonymous_user=true; else $anonymous_user=false; if(!$anonymous_user) func_send_mail($olduser_info["email"], "mail/profile_deleted_subj.tpl", "mail/profile_deleted.tpl", $config["Company"]["users_department"], false); # # Send mail to customers department # if(!$anonymous_user) func_send_mail($config["Company"]["users_department"], "mail/profile_admin_deleted_subj.tpl", "mail/profile_admin_deleted.tpl", $olduser_info["email"], true); } } #require "../include/countries.php"; #require "../include/states.php"; #$smarty->assign("current_category",$current_category); if ($uerror || $eerror || $fillerror || $error) { $userinfo[firstname]=stripslashes($firstname); $userinfo[lastname]=stripslashes($lastname); $userinfo[company]=stripslashes($company); $userinfo[ssn]=stripslashes($ssn); $userinfo[hear]=stripslashes($hear); $userinfo[b_address]=stripslashes($b_address); $userinfo[b_city]=stripslashes($b_city); $userinfo[b_zipcode]=stripslashes($b_zipcode); $userinfo[s_address]=stripslashes($s_address); $userinfo[s_city]=stripslashes($s_city); $userinfo[s_state]=stripslashes($s_state); $userinfo[s_zipcode]=stripslashes($s_zipcode); $userinfo[phone]=stripslashes($phone); $userinfo[fax]=stripslashes($fax); $userinfo[uname]=stripslashes($uname); $userinfo[login]=stripslashes($uname); $userinfo[passwd1]=stripslashes($passwd1); $userinfo[passwd2]=stripslashes($passwd2); $userinfo[password_hint]=stripslashes($password_hint); $userinfo[password_hint_answer]=stripslashes($password_hint_answer); } if ($userinfo) foreach ($userinfo as $key=>$value){ if (is_string($value)) $userinfo[$key]=htmlspecialchars($value); } $smarty->assign("userinfo",$userinfo); $smarty->assign("registered",$registered); $smarty->assign("reg_error",$reg_error); if($mode=="delete") { $smarty->assign("main","profile_delete"); } elseif($mode=="notdelete") { $smarty->assign("main","profile_notdelete"); } else $smarty->assign("main","register"); ?>

...and here is the complete main/register.tpl file with the appropriate mods:
Code:
{* $Id: register.tpl,v 1.50 2002/11/18 13:17:24 alfiya Exp $ *} {include file="check_email_script.tpl"} {if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"} {assign var="last_location" value=$lng.lbl_modify_profile} {elseif $smarty.get.mode eq "delete" or $smarty.post.mode eq "delete"} {assign var="last_location" value=$lng.lbl_delete_profile} {elseif $last_location eq ""} {assign var="last_location" value=$lng.lbl_new_member} {/if} {include file="location.tpl" last_location=$last_location} {if $newbie eq "Y"} {if $registered eq ""} {if $smarty.get.mode eq "update"} {$lng.txt_modify_profile_msg} {else} <font class=Text> {if $usertype eq "B"} {$lng.txt_create_profile_msg_partner} {else} {$lng.txt_create_profile_msg} {/if} </font> {/if} {/if} {/if} {capture name=dialog} {if $registered eq ""} {if $reg_error eq "F" } <font class=Star> {$lng.txt_registration_error} </font> {elseif $reg_error eq "E" } <font class=Star>{$lng.txt_email_already_exists} </font> {elseif $reg_error eq "U" } <font class=Star>{$lng.txt_user_already_exists}</font> {/if} {if $error ne ""} <font class=Star>{$error}</font> {/if} <table width=100% border=0 cellspacing=0 cellpadding=2> {include file="check_cc_number_script.tpl"} <form action="{ $register_script_name }?{ $smarty.server.QUERY_STRING }" method=post name=registerform> <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_personal_information}<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_title}</td> <td><font class=Star>*</font></td> <td nowrap> <select name=title> {section name=title loop=$name_titles} <option {if $userinfo.title eq $name_titles[title]}selected{/if}>{$name_titles[title]}</option> {/section} </select> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_first_name}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=firstname size=32 maxlength=32 value="{$userinfo.firstname}"> {if $reg_error ne "" and $userinfo.firstname eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_last_name}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=lastname size=32 maxlength=32 value="{$userinfo.lastname}"> {if $reg_error ne "" and $userinfo.lastname eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_company}</td> <td></td> <td nowrap> <input type=text name=company size=32 maxlength=32 value="{$userinfo.company}"> </td> </tr> {* Added How Heard Here *} <tr valign=middle> <td align=right>{$lng.lbl_how_heard}</td> <td></td> <td nowrap> <input type=text name=hear size=32 maxlength=255 value="{$userinfo.hear}"> </td> </tr> {*----------------------*} {* <TR valign=middle> *} {* <TD align=right>{$lng.lbl_ssn}</TD> *} {* <TD></TD> *} {* <TD nowrap> *} {* <INPUT type=text name=ssn size=32 maxlength=32 value="{$userinfo.ssn}"> *} {* </TD> *} {* </TR> *} {if $usertype eq "A" or $usertype eq "P"} <tr valign=middle> <td align=right>Refered by:</td> <td></td> <td nowrap> {$userinfo.referer} </td> </tr> {/if} <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_billing_address}<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_address}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=b_address size=32 maxlength=64 value="{$userinfo.b_address}"> {if $reg_error ne "" and $userinfo.b_address eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_city}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=b_city size=32 maxlength=64 value="{$userinfo.b_city}"> {if $reg_error ne "" and $userinfo.b_city eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_state}</td> <td>{if $states ne ""}<font class=Star>*</font>{/if}</td> <td nowrap> {if $states ne ""} <select name=b_state size=1> <option value=" ">{$lng.lbl_select_one}</option> {section name=state_idx loop=$states} <option value={$states[state_idx].state_code} {if $userinfo.b_state eq $states[state_idx].state_code}selected{/if}>{$states[state_idx].state}</option> {/section} </select> {else} <input type=text size=32 name=b_state value="{$userinfo.b_state}"> {/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_country}</td> <td><font class=Star>*</font></td> <td nowrap> <select name=b_country> {section name=country_idx loop=$countries} <option value={$countries[country_idx].country_code} {if $userinfo.b_country eq $countries[country_idx].country_code}selected{elseif $countries[country_idx].country_code eq $config.General.default_country and $userinfo.b_country eq ""}selected{/if}>{$countries[country_idx].country}</option> {/section} </select> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_zip_code}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=b_zipcode size=32 maxlength=32 value="{$userinfo.b_zipcode}"> {if $reg_error ne "" and $userinfo.b_zipcode eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_shipping_address_registration}<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_address}</td> <td></td> <td nowrap> <input type=text name=s_address size=32 maxlength=64 value="{$userinfo.s_address}"> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_city}</td> <td></td> <td nowrap> <input type=text name=s_city size=32 maxlength=64 value="{$userinfo.s_city}"> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_state}</td> <td></td> <td nowrap> {if $states ne ""} <select name=s_state size=1> <option value=" ">{$lng.lbl_select_one}</option> {section name=state_idx loop=$states} <option value={$states[state_idx].state_code} {if $userinfo.s_state eq $states[state_idx].state_code}selected{/if}>{$states[state_idx].state}</option> {/section} </select> {else} <input type=text size=32 name=s_state value="{$userinfo.s_state}"> {/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_country}</td> <td></td> <td nowrap> <select name=s_country size=1> {section name=country_idx loop=$countries} <option value={$countries[country_idx].country_code} {if $userinfo.s_country eq $countries[country_idx].country_code}selected{elseif $countries[country_idx].country_code eq $config.General.default_country and $userinfo.b_country eq ""}selected{/if}>{$countries[country_idx].country}</option> {/section} </select> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_zip_code}</td> <td></td> <td nowrap> <input type=text name=s_zipcode size=32 maxlength=32 value="{$userinfo.s_zipcode}"> </td> </tr> <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_contact_information}<hr size=1 noshade></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_phone}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=phone size=32 maxlength=32 value="{$userinfo.phone}"> {if $reg_error ne "" and $userinfo.phone eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_email}</td> <td><font class=Star>*</font></td> <td nowrap> <input type=text name=email size=32 maxlength=128 value="{$userinfo.email}"> {if $reg_error ne "" and $userinfo.email eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_fax}</td> <td></td> <td nowrap> <input type=text name=fax size=32 maxlength=128 value="{$userinfo.fax}"></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_web_site}</td> <td></td> <td nowrap> <input type=text name=url size=32 maxlength=128 value="{$userinfo.url}"></td> </tr> {if $usertype eq "C" or $smarty.get.usertype eq "C"} {if $config.General.disable_cc ne "Y"} {include file="main/register_ccinfo.tpl"} {/if} {/if} <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_username_n_password}<hr size=1 noshade></td> </tr> {if $userinfo.membership eq "Fulfillment staff" and $userinfo.login eq $login} <input type=hidden name=membership value="{$userinfo.membership}"></d> <input type=hidden name=pending_membership value="{$userinfo.pending_membership}"></d> {else} {if $config.General.membership_signup eq "Y" and ($usertype eq "C" or ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A")} {include file="admin/main/membership_signup.tpl"} {/if} {if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")} {include file="admin/main/membership.tpl"} {/if} {/if} {if $anonymous ne ""} {* Anonymous account *} <tr> <td colspan=3>{$lng.txt_anonymous_account_msg}</TD> </tr> <tr valign=middle> <td align=right>{$lng.lbl_username}</td> <td></td> <td nowrap> <input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}"> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_password}</td> <td></td> <td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}"> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_confirm_password}</td> <td></td> <td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}"> </td> </tr> {else} {* NOT anonymous account *} <tr valign=middle> <td align=right>{$lng.lbl_username}</td> <td><font class=Star>*</font></td> <td nowrap> {if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"} {$userinfo.login} <input type=hidden name=uname value="{$userinfo.login}"> {else} <input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}"> {if $reg_error ne "" and $userinfo.login eq ""}<font class=Star>&lt;&lt;</font>{/if} {/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_password}</td> <td><font class=Star>*</font></td> <td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}"> {if $reg_error ne "" and $userinfo.passwd1 eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_confirm_password}</td> <td><font class=Star>*</font></td> <td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}"> {if $reg_error ne "" and $userinfo.passwd2 eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> {/if} <tr valign=middle> <td align=right>{$lng.lbl_password_hint}</td> <td></td> <td nowrap><input type=text name=password_hint size=32 maxlength=32 value="{$userinfo.password_hint}"></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_password_hint_answer}</td> <td></td> <td nowrap><input type=text name=password_hint_answer size=32 maxlength=32 value="{$userinfo.password_hint_answer}"></td> </tr> <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_newsletter}<hr size=1 noshade></td> </tr> <tr valign=middle> <td></td> <td></td> <td> <input type=checkbox name=newsletter {if $userinfo.newsletter eq "Y"}checked{/if}> {$lng.txt_newsletter_msg} </td> </tr> <tr valign=middle> <td></td> <td></td> <td> {if $newbie eq "Y"} {$lng.txt_you_are_agree} <font class=Text>{$lng.lbl_terms_n_conditions}</font>. {/if} <font class=FormButton> {if $smarty.get.mode eq "update"} <input type=hidden name=mode value=update> {/if} <input type=hidden name=anonymous value={$anonymous}> {include file="buttons/submit.tpl"} </td> </tr> <input type=hidden name=usertype value="{if $smarty.get.usertype ne ""}{$smarty.get.usertype}{else}{$usertype}{/if}"> </form> </table> {if $newbie eq "Y"} {$lng.txt_newbie_registration_bottom} <font class=Text>{$lng.lbl_terms_n_conditions}</font>{include file="buttons/go.tpl"} {/if} {else} {if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"} {$lng.txt_profile_modified} {elseif $smarty.get.usertype eq "B" or $usertype eq "B"} {$lng.txt_partner_created} {else} {$lng.txt_profile_created} {/if} {/if} {/capture} {if $smarty.post.mode eq "update" or $smarty.get.mode eq "update"} {include file="dialog.tpl" title=$lng.lbl_modify_profile content=$smarty.capture.dialog extra="width=100%"} {else} {include file="dialog.tpl" title=$lng.lbl_new_member content=$smarty.capture.dialog extra="width=100%"} {/if}

The only other things to remember to do is:
- Add the field hear to the xcart_customers table
- Add the lbl_how_heard variable to the languages
__________________
-Ken
X-Cart User / Developer Since April 2003
(Varying versions, multiple client sites, 3.x through 4.4.x)
www.pointbweb.com
Reply With Quote
  #5  
Old 05-10-2003, 09:57 PM
 
poboy poboy is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default You the man.

Thanks for the help, I sure hope we helped some others. What is your site you are working on, mines is http://www.pfgpromotionals.com.
Have a nice day.
Chris
Reply With Quote
  #6  
Old 05-11-2003, 09:15 AM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

Quote:
I sure hope we helped some others.
Me too. I have to admit that I got a lot of excellent mods from this forum. I feel obligated to "give back to the community" so to speak.

I'll post my project info in the Member Websites area with details when it is completed.

Your site looks awesome! Excellent job! Is this your business or a client?
__________________
-Ken
X-Cart User / Developer Since April 2003
(Varying versions, multiple client sites, 3.x through 4.4.x)
www.pointbweb.com
Reply With Quote
  #7  
Old 05-11-2003, 05:55 PM
 
poboy poboy is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default Thanks.

Thanks, the site is for a client. I can't take too much credit, I am a designer and my home site right now, just to be a place holder is http://www.iexweb.com. The pfgpromotionals.com was a template that I modified a great deal and had x-cart implement the design. I do not usually use templates, but this one just struck my eye and I figure I have a business, so its the best work I can provide at the lowest cost and still make my margins. Your point b site is really professional. My new site I am working on will be more professional and what I have had in mind the whole time, its just now coming out of me. Thanks for your help.

Chris
Reply With Quote
  #8  
Old 05-12-2003, 10:56 AM
 
jdebler jdebler is offline
 

Member
  
Join Date: Apr 2003
Posts: 26
 

Default

Okay, this is very cool and is exactly what I am looking for. Thanks for supplying this! I do have one problem...

Quote:
Originally Posted by kpriest
The only other things to remember to do is:
- Add the field hear to the xcart_customers table
- Add the lbl_how_heard variable to the languages

I had no problem adding the lbl_how_heard variable to the languages, but I am still super new to other parts. So new in fact, that I have no idea how to add the "hear" field to the "xcart_customers" table.

Would someone mind helping me out with how to do this? It would be very much appreciated!

Jason
Reply With Quote
  #9  
Old 05-12-2003, 02:32 PM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

You can use the phpMyAdmin interface to add a field or use the Patch/Upgrade area of your xcart admin - at the bottom of the screen, paste this code into the Query box and click Apply:
Code:
ALTER TABLE `xcart_customers` ADD `hear` VARCHAR(255) NOT NULL;

That should do it!
__________________
-Ken
X-Cart User / Developer Since April 2003
(Varying versions, multiple client sites, 3.x through 4.4.x)
www.pointbweb.com
Reply With Quote
  #10  
Old 05-13-2003, 05:48 AM
 
jdebler jdebler is offline
 

Member
  
Join Date: Apr 2003
Posts: 26
 

Default

Quote:
Originally Posted by kpriest
use the Patch/Upgrade area of your xcart admin - at the bottom of the screen, paste this code into the Query box and click Apply:
Code:
ALTER TABLE `xcart_customers` ADD `hear` VARCHAR(255) NOT NULL;

That should do it!

I used the Patch/Upgrade area of xcart admin (I know nothing about phpmyadmin) and when I went to test my store, I get a connection refused error on step 2 of the checkout process after selecting credit card and clicking continue.

This was copying the code exactly from your post.

I restored my database and tried to enter the code again, but this time changing the
Code:
`
characters from

ALTER TABLE `xcart_customers` ADD `hear` VARCHAR(255) NOT NULL;

TO

ALTER TABLE 'xcart_customers' ADD 'hear' VARCHAR(255) NOT NULL;

I did thins thinking thios message board software converted some of the characters when displaying a post. In doing that, I get an error:

Quote:
SQL PATCH FAILED AT QUERY:
ALTER TABLE 'xcart_customers' ADD 'hear' VARCHAR(255) NOT NULL

Remember how I said I am new at this?

Any idea what I am doing wrong?

Jason
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:02 PM.

   

 
X-Cart forums © 2001-2020