Thanks, I will try this
|
I'm getting this error when I make the changes above to func.php
"INVALID SQL: 1136 : Column count doesn't match value count at row 1" Running 3.5.3 Gold Any ideas anyone? Randy |
Make sure the columns specified in the SQL query exist and match the values. "insert into $sql_tbl[orders] (columns, columns2) VALUES (values, values2)"
|
i m getting MYSQL 1136 Error here is my func.php
Quote:
|
Code:
db_query("insert into $sql_tbl[orders] (login, membership, total, giftcert_discount, giftcert_ids, subtotal, shipping_cost, shippingid, tax, tax_gst, tax_pst, total_vat, taxes_applyed, discount, coupon, coupon_discount, date, status, payment_method, flag, details, title, firstname, lastname, company, b_title, b_firstname, b_lastname, b_address, b_city, b_state, b_country, b_zipcode, s_title, s_firstname, s_lastname, s_address, s_city, s_state, s_country, s_zipcode, phone, fax, email, url, reg_numbers, vat_applied, ip) values ('".addslashes($userinfo["login"])."', '".addslashes($userinfo["membership"])."', '$current_order[total_cost]', '$giftcert_discount', '".@$giftcert_str."', '$current_order[subtotal]','$current_order[shipping_cost]', '$cart[shippingid]', '$current_order[tax_cost]', '$current_order[tax_gst]', '$current_order[tax_pst]', '$current_order[total_vat]', '$taxes_applyed', '$current_order[discount]', '".addslashes(@$current_order["coupon"])."', '$current_order[coupon_discount]', '".time()."', '$order_status', '".addslashes($payment_method)."', 'N', '".addslashes(text_crypt($order_details))."', '".addslashes($userinfo["title"])."', '".addslashes($userinfo["firstname"])."', '".addslashes($userinfo["lastname"])."', '".addslashes($userinfo["company"])."', '".addslashes($userinfo["b_title"])."', '".addslashes($userinfo["b_firstname"])."', '".addslashes($userinfo["b_lastname"])."', '".addslashes($userinfo["b_address"])."', '".addslashes($userinfo["b_city"])."', '".addslashes($userinfo["b_state"])."', '".addslashes($userinfo["b_country"])."', '".addslashes($userinfo["b_zipcode"])."', '".addslashes($userinfo["s_title"])."', '".addslashes($userinfo["s_firstname"])."', '".addslashes($userinfo["s_lastname"])."', '".addslashes($userinfo["s_address"])."', '".addslashes($userinfo["s_city"])."', '".addslashes($userinfo["s_state"])."', '".addslashes($userinfo["s_country"])."', '".addslashes($userinfo["s_zipcode"])."', '".addslashes($userinfo["phone"])."', '".addslashes($userinfo["fax"])."', '$userinfo[email]', '".addslashes($userinfo["url"])."','$reg_numbers', '$current_order[vat_applied]','$_SERVER[REMOTE_ADDR]')"); |
Here is a slight improvement for this mod. Add the following directly above "db_query("INSERT INTO $sql_tbl[orders]" in func.php...
Code:
$full_remote_address = $HTTP_SERVER_VARS['REMOTE_ADDR']; // Add all remote address information. (6/9/2004) Change... Code:
'$_SERVER[REMOTE_ADDR]' Code:
'".addslashes($full_remote_address)."' After that, you will need to change the IP field of your database to be VARCHAR 48. This code is 3.5.8 compatible. If you are using a different version of Xcart, and don't plan to upgrade to 3.5.8, you may wish to change $HTTP_SERVER_VARS to $_SERVER. If you want more thorough login failure reports, you can also replace the contents of "skin1/mail/html/login_error.tpl" with the following... Code:
In the file "skin1/mail/login_error.tpl", replace the contents with the following... Code:
{include file="mail/mail_header.tpl" email_needs="no_header"} You will also need to create the language variable "lbl_http_client_ip" which should contain the text "HTTP_CLIENT_IP". I do give the Xcart developers explicit permission to use these code snippets in the Xcart software and or modify them for their uses. If anyone has any improvements on this, then please post them here. Thanks! :) |
You can also add this:
Code:
<tr valign=middle> also add Code:
{$lng.lbl_user_ip}: {$order.ip} skin1/mail/order_invoice.tpl then create an entry in languages/labels/lbl_user_ip (User IP) Here's what you get--> http://www.goldmisers.com/customer/register.php [update] I stayed up all night and incorporated this into my whole site but unfortunately didn't keep track of what I did :oops: anyway, you can figure it out (ie. skin1/mail etc.) I made seperate email forms for different things like "Suggestions" and simple questions with minimul forms for the user to fill out, all the way to the full blown "contact us" form that I use for shipping enquiries only and I incorporated this mod into it to help prevent fraud on that level. It's actually pretty easy to figure out, just play around with it. One variable would be for example: Code:
{$lng.lbl_user_ip}: {$userinfo.ip} |
Stopped working from some reason
The IP logging mod suddenly stopped working on v3.5.8
Any ideas? Thanks, Dan. |
Re: Stopped working from some reason
Quote:
Same here! :( |
First if you haven't patched the database apply the following SQL query in the patch/upgrade area of the X-Cart admin:
Code:
ALTER TABLE `xcart_orders` ADD `ip` VARCHAR( 15 ) NOT NULL ; After the patch is successful... Next, Edit include/func.php find: Code:
return $orderids; insert: Code:
db_query("UPDATE $sql_tbl[orders] SET ip='$_SERVER[REMOTE_ADDR]' WHERE orderid = '$orderid'"); Above the first found line of code "return $orderids;". This should make the mod work on all future versions as well since its not apart of the original insert for orders to avoid future confusion. |
All times are GMT -8. The time now is 11:53 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.