View Single Post
  #5  
Old 07-18-2007, 01:33 PM
 
FFI FFI is offline
 

Newbie
  
Join Date: Jun 2007
Posts: 3
 

Default Re: Custom templates

I am trying to get this to work in x-cart version 4.1.8. I have created the mail/rigging_contactus_subj.tpl and mail/rigging_contactus.tpl, and help/rigging.tpl (copy of contactus.tpl). I have also copied the code in include/help.php and pasted the following,

Code:
## Start Rigging Quote System Test ### if ($REQUEST_METHOD=="POST" && $action=="rigging") { # # Send mail to support # $body = $HTTP_POST_VARS["body"] = stripslashes($HTTP_POST_VARS["body"]); foreach ($HTTP_POST_VARS as $key=>$val) { if ($key != 'additional_values') $contact[$key]=$val; } $contact['titleid'] = func_detect_title($contact['title']); x_session_register("antibot_contactus_err"); $page = "on_contact_us"; if (!empty($active_modules['Image_Verification']) && $show_antibot_arr[$page] == 'Y') { if (isset($antibot_input_str) && !empty($antibot_input_str)) { $antibot_contactus_err = func_validate_image($antibot_validation_val[$page], $antibot_input_str); } else { $antibot_contactus_err = true; } } $fillerror = false; foreach ($default_fields as $k => $v) { if ($k == "b_county" && $v['avail'] == 'Y' && ($v['required'] == 'Y' || !empty($contact['b_county']))) { if ($config["General"]["use_counties"] != "Y") continue; if (!func_check_county($contact[$k], stripslashes($contact["b_state"]), $contact['b_country'])) $fillerror = true; } elseif ($k == "b_state" && $v['avail'] == 'Y' && ($v['required'] == 'Y' || !empty($contact['b_state']))) { $has_states = (func_query_first_cell("SELECT display_states FROM $sql_tbl[countries] WHERE code = '".$contact['b_country']."'") == 'Y'); if (is_array($states) && $has_states && !func_check_state($states, stripslashes($contact["b_state"]), $contact['b_country'])) $fillerror = true; } elseif ($k == "email" && $v['avail'] == 'Y' && ($v['required'] == 'Y' || !empty($contact['email']))) { if (!func_check_email($contact['email'])) $fillerror = true; } elseif (empty($contact[$k]) && $v['required'] == 'Y' && $v['avail'] == 'Y') { $fillerror = true; } } if (!$fillerror && is_array($additional_fields)) { foreach($additional_fields as $k => $v) { $additional_fields[$k]['value'] = stripslashes($HTTP_POST_VARS['additional_values'][$v['fieldid']]); if (empty($HTTP_POST_VARS['additional_values'][$v['fieldid']]) && $v['required'] == 'Y' && $v['avail'] == 'Y') $fillerror = true; } } 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/rigging_contactus_subj.tpl", "mail/rigging_contactus.tpl", $contact["email"], true)) { $top_message = array("type" => "E"); $top_message['content'] = func_get_langvar_by_name("lbl_send_mail_error"); $userinfo = $HTTP_POST_VARS; $userinfo["login"] = $userinfo["uname"]; $store_contactus = $userinfo; } else { $store_contactus = false; } func_header_location("help.php?section=contactus&mode=update&err"); } else { func_unset($HTTP_POST_VARS,'additional_values'); $userinfo = $HTTP_POST_VARS; $userinfo["login"] = $userinfo["uname"]; $userinfo['fillerror'] = $fillerror; $userinfo['antibot_contactus_err'] = $antibot_contactus_err; $store_contactus = $userinfo; $top_message = array("type" => "E"); if ($fillerror) { $top_message["content"] = func_get_langvar_by_name("txt_registration_error"); } else { $top_message["content"] = func_get_langvar_by_name("msg_err_antibot"); } func_header_location("help.php?section=contactus&mode=update&err"); } } ## End Rigging Quote System Test ###

I cant seem to get it to take me to this new page no matter what I do. If anyone can shed some light on this, I would greatly appreciate it.
__________________
x-cart - 4.1.8
[linux]
Reply With Quote