View Single Post
  #5  
Old 12-05-2002, 02:53 AM
 
Cefko Cefko is offline
 

Advanced Member
  
Join Date: Nov 2002
Posts: 69
 

Default

Since Boomer posted some code, I think I should too..

To add IP's to customer registration, customer changing profile, and adding to newsletter from profile do following.

In SQL enter
Code:
ALTER TABLE `xcart_customers` ADD `ip` VARCHAR( 15 ) NOT NULL ; ALTER TABLE `xcart_maillist` ADD `ip` VARCHAR( 15 ) NOT NULL ;

Then open INCLUDE/REGISTER.PHP and change (in red)

on line 112
Code:
db_query("delete from $sql_tbl[maillist] where email='$email'"); if($newsletter=="on") db_query("insert into $sql_tbl[maillist] (email, since_date,ip) values ('$email',now(),'$_SERVER[REMOTE_ADDR]')");

on line 122

Code:
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', ip='$_SERVER[REMOTE_ADDR]' where login='$login' and usertype='$login_type'");

on line 155

Code:
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,ip) 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','$_SERVER[REMOTE_ADDR]')");

For displaying IP in customer profile, you can add following in MAIN/REGISTER.TPL

Code:
{if $usertype eq "A" or $usertype eq "P"} <tr valign=middle> <td align=right>IP:</td> <td></td> <td nowrap> {$userinfo.ip} </td> </tr> {/if}
You can remove {if} if you want to show your customers, that you log IPs


I'll post code for capturing IP from 'Newsletter signup box' later.[/code]
__________________
X-cart version 4.1.7
Apache/2.0.52 (CentOS)
My SQL 5.0.58
PHP Version 5.1.6
Reply With Quote