Jump to content

makenoiz

Members
  • Posts

    20
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

makenoiz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Perfect... thank you!
  2. Thanks... greatly appreciate your responses. Really any help is great
  3. This code is from a program that autopopulates a zencart store. This part reads one of the config tables. When I run this query directly against my database I get about 50 pairs of data (there are 50 records). Im confused why there is no array defined to hold these results. It just does not make sense to me. How can all those 50 pairs of data be held in $stats when $stats is not defined as an array? Thank you....
  4. I am having a hard time undestanding this code snippit. Can someone help translate it for me. I guess I dont understand how -> works. and how executing a mysql statement can be a variable Thank you $stats = $db->Execute('select stats_key as stsKey, stats_value as stsValue from myCurrentStats'); while (!$stats->EOF) { if (!defined($stats->fields['stsKey'])) { define($stats->fields['stsKey'], $stats->fields['stsValue']); } $stats->MoveNext(); }
  5. I'm an intermediate php coder however I have a new situation. I need to do some remapping of categories from CSV files we get from our supplier for our php ecommerce store. We use mySQL back end. We are importing data from a Supplier and need to remap the category names for our online store. There are 16,000 entries in the CSV file. This is what I need to do. 1) grab the CSV from the suppliers (from their ftp location) 2) remap the suppliers category names on the acquired CSV to our stores category names. I can either create a new table with the category name relation ships (probably best?) or read my mapping CSV ? 3) save the new CSV to our server where our auto import program can grab it. Eventually, Id like a cron to run the new script but for now Ill do it manually during testing period. Thats it! but... as simple as it sounds, I dont know how to start this. Below is an example of what needs to be dont just to clarify. PHP Code: Our Category(A) | Their Category(B) | Product © | Product Cat (D) | New Product Cat (E) 1. dog/leash/long | Pet/walking | Item A | Pet/sleeping|bed ** This is what we need to get** 2. dog/leash|long | Pet/walking | Item B | Pet/walking 3. dog/leash|long | Pet/sleeping bed | Item C | Pet/walking Here is my pseudo code: for each value in Column D (run the test on each value in Column D) for each value in B as i ( check each value in Column B) if B(i) = D1 then E1 =A(i) end for end for The new path in this example for Item A would be A3 and would be written to E1. I have 15,000 entries to do. Thank you for any help
  6. I am using x-cart 4.4.3. The default contact us form allows the viewer to choose from several departments to send the mail form to however, the x-cart developers have decided that it is a "feature" that all emails from the form, regardless of which department is chosen on the form, go to One email address that is defined in the settings. Its really ridiculous however I cannot seem to modify it. If anyone has time, Id love some assistance on making the work "right". Here is one part of the code that Im sure is integral in making the modification: include/help.php if ($REQUEST_METHOD == 'POST' && $action == 'contactus') { // Send mail to support $body = $_POST['body'] = stripslashes($_POST['body']); $contact = $_POST; $contact['titleid'] = func_detect_title($contact['title']); x_session_register('antibot_contactus_err'); $antibot_contactus_err = (!empty($active_modules['Image_Verification']) && func_validate_image("on_contact_us", $antibot_input_str)); // For email as login option, replace username with email if ($default_fields['username']['avail'] == 'Y' && $config['email_as_login'] == 'Y') { $contact['username'] = $contact['email']; } //Fill values for func_check_required_fields/emails templates if (is_array($additional_fields)) { $contact['additional_fields'] = array(); foreach ($additional_fields as $k => $v) $additional_fields[$k]['value'] = $contact['additional_fields'][$k]['value'] = stripslashes($contact['additional_values'][$k]); } // Check required fields $fillerror = !func_check_required_fields($contact, $current_area, 'contact_us'); // Check email if ( ( $default_fields['email']['required'] == 'Y' || !empty($contact['email']) ) && !func_check_email($contact['email']) ) { $fillerror = true; } // Check subject and body if (!$fillerror) { $fillerror = (empty($subject) || empty($body)); } if (!$fillerror && !$antibot_contactus_err) { $contact['b_statename'] = func_get_state(stripslashes($contact['b_state']), stripslashes($contact['b_country'])); $contact['b_countryname'] = func_get_country(stripslashes($contact['b_country'])); if ($config['General']['use_counties'] == 'Y') $contact['b_countyname'] = func_get_county($contact['b_county']); $contact = func_stripslashes($contact); if (!empty($active_modules['SnS_connector']) && $current_area == 'C') func_generate_sns_action('FillContactForm'); $mail_smarty->assign('contact', $contact); $mail_smarty->assign('default_fields', $default_fields); $mail_smarty->assign('is_areas', $is_areas); $mail_smarty->assign('additional_fields', $additional_fields); if ( !func_send_mail( $config['Company']['support_department'], 'mail/help_contactus_subj.tpl', 'mail/help_contactus.tpl', $contact['email'], false ) ) { $top_message = array( 'type' => 'E', 'content' => func_get_langvar_by_name("lbl_send_mail_error") ); $userinfo = $_POST; $userinfo['login'] = $userinfo['uname']; $store_contactus = $userinfo; } else { $store_contactus = false; func_header_location("help.php?section=contactus&mode=sent"); } } else { $userinfo = func_stripslashes($_POST); $userinfo['login'] = $userinfo['uname']; $userinfo['fillerror'] = $fillerror; $userinfo['antibot_contactus_err'] = $antibot_contactus_err; $store_contactus = $userinfo; $top_message = array( 'type' => 'E', 'content' => func_get_langvar_by_name($fillerror ? 'txt_registration_error' : 'msg_err_antibot') ); } func_header_location("help.php?section=contactus&mode=update&err=1"); } My site is not live yet or I would post the URL, however you can look at the x-cart demo: http://xcart-demo.qtmsoft.com/demo/help.php?section=contactus&mode=update Here is the thread confirming that all departs go to the same address: http://forum.x-cart.com/showthread.php?t=9520&page=2 Any help would be greatly appreciated
  7. Can someone tell me what some of the purposes of this would be? global $PHP_SELF; its defined right after a function like this function myFunction(module =' '){ global $PHP_SELF; .... } Thanks
×
×
  • 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.