hegy
16.04.2006, 17:11
Hallo,
ich bin ein PHP Anfäger der Hilfe braucht.
Wie kann ich in dem Modul "ask_a_question.php" ein neues
Feld einfügen (Telefonnummer)
für Hilfe wäre ich dankbar.
<?php
/
**$Id: ask_a_question.php,v 2.1 2006/01/24 23.55:01 pl-xtcs Exp $
**osCommerce, Open Source E-Commerce Solutions
**http://www.oscommerce.com
**Copyright (c) 2003 osCommerce
**Released under the GNU General Public License
**Credits: Marg Davison, Loïc Richard, FaNaTiC, C. Bouwmeester
**Version 1.1 u. Version 2.0 für XT:Commerce 3.0.4 SP1: 2005/2006 BSB Beratung+Software Bleicher
**ASK_A_QUESTION.GIF Grafikdesign (c) 2005/2005 BSB Beratung+Software Bleicher
**Anpassungen für XT:Commerce 3.0.4 SP1 inkl. Standard SUMA Funktion: 24.01.2006 Leemann Patrick xtc-services.ch
/
require ('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include needed functions
require_once (DIR_FS_INC. 'xtc_validate_email.inc.php');
**$valid_product = false;
****$product_info_query = xtc_db_query("select FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd where p.products_status = '1' and p.products_id = '".(int) $_GET['products_id']."' and pd.products_id = p.products_id and pd.language_id = '".(int) $_SESSION['languages_id']."'");
****if (xtc_db_num_rows($product_info_query)) {
******$valid_product = true;
******$product_info = xtc_db_fetch_array($product_info_query);
****}
**require(DIR_WS_LANGUAGES .$_SESSION['language'].'/ask_a_question.php');
**if (isset ($_GET['action']) && $_GET['action'] == 'process') {
****$error = false;
****$to_email_address = xtc_db_prepare_input($HTTP_POST_VARS['to_email_address']);
****$to_name = xtc_db_prepare_input($HTTP_POST_VARS['to_name']);
****$from_email_address = xtc_db_prepare_input($HTTP_POST_VARS['from_email_address']);
****$from_name = xtc_db_prepare_input($HTTP_POST_VARS['from_name']);
****$message = xtc_db_prepare_input($HTTP_POST_VARS['message']);
****if (empty($from_name)) {
******$error = true;
******$messageStack->add('friend', ERROR_FROM_NAME);
****}
****if (!xtc_validate_email($from_email_address)) {
******$error = true;
******$messageStack->add('friend', ERROR_FROM_ADDRESS);
****}
****if (empty($to_name)) {
******$error = true;
******$messageStack->add('friend', ERROR_TO_NAME);
****}
****if (!xtc_validate_email($to_email_address)) {
******$error = true;
******$messageStack->add('friend', ERROR_TO_ADDRESS);
****}
****if ($error == false) {
****// Assign XT:Commerce Mail-Variables
****$smarty->assign('MESSAGE', $_POST['message']);
****$smarty->assign('TEXT_NAME', $_POST['from_name']);
****$smarty->assign('FROM_EMAIL_ADDRESS', $_POST['from_email_address']);
****$smarty->assign('PRODUCT_NAME', $product_info['products_name']);
****$smarty->assign('PRODUCT_LINK', xtc_href_link(FILENAME_PRODUCT_INFO,'products_id=' .$product->data['products_id']));
****$smarty->caching = 0;
****$html_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/ask_a_question.html');
****$smarty->caching = 0;
****$txt_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/ask_a_question.txt');
********xtc_php_mail(EMAIL_SUPPORT_ADDRESS, EMAIL_SUPPORT_NAME, $to_email_address, $to_name, EMAIL_SUPPORT_FORWARDING_STRING, EMAIL_SUPPORT_REPLY_ADDRESS, EMAIL_SUPPORT_REPLY_ADDRESS_NAME, '', '', 'Produktanfrage', $html_mail, $txt_mail);
****xtc_redirect(xtc_href_link('ask_a_question_ok. html'));
****}
**} elseif (xtc_session_is_registered('customer_id')) {
****$account_query = xtc_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
****$account = xtc_db_fetch_array($account_query);
****$from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
****$from_email_address = $account['customers_email_address'];
**}
**$breadcrumb->add(NAVBAR_TITLE, xtc_href_link(FILENAME_ASK_QUESTION, 'products_id='.$product->data['products_id']));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Tranistional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link href="templates/sand/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
</p>
<table width="500"**border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="25" height="25" align="left" valign="bottom" class="rahmen_or"> </td>
<td height="25" class="rahmen_om"> </td>
<td width="25" height="25" align="left" valign="bottom" class="rahmen_ol"> </td>
</tr>
<tr>
<td width="25" align="left" valign="top" class="rahmen_ml"> </td>
<td height="25" align="left" valign="top" >
<div align="left">
<table width="400" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td width="100%" valign="top">
<?php echo xtc_draw_form('email_friend', xtc_href_link(FILENAME_ASK_QUESTION, 'action=process&products_id=' . $product->data['products_id'])); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="preis"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo xtc_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
**if ($messageStack->size('friend') > 0) {
?>
<tr>
<td><?php echo $messageStack->output('friend'); ?></td>
</tr>
<?php
**}
?>
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
<td class="main"><?php echo xtc_draw_input_field('from_name'); ?></td>
</tr>
<tr>
<td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
<td class="main"><?php echo xtc_draw_input_field('from_email_address'); ?></td>
</tr>
<tr>
<td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
<td class="main"><?php echo xtc_draw_input_field('from_email_address'); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo xtc_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php echo xtc_draw_hidden_field('to_email_address', STORE_OWNER_EMAIL_ADDRESS) . ' ' . ''; ?><?php echo xtc_draw_hidden_field('to_name', STORE_OWNER) . ' ' . ''; ?></td>
</tr>
<tr> </tr>
<tr>
<td class="main"><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><?php echo xtc_draw_textarea_field('message', 'soft', 40, 8); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo xtc_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><?php echo '' . xtc_image_submit('button_back.gif', IMAGE_BUTTON_BACK) . ' (#)'; ?></td>
<td align="right"><?php echo xtc_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
<td width="10"><?php echo xtc_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<td width="25" align="left" valign="top" class="rahmen_mr"> </td>
</tr>
<tr>
<td width="25" height="25" align="left" valign="top" class="rahmen_ul"> </td>
<td height="25" align="left" valign="top" class="rahmen_um"> </td>
<td width="25" height="25" align="left" valign="top" class="rahmen_ur"> </td>
</tr>
</table>
</body>
</html>
gruss hegy
ich bin ein PHP Anfäger der Hilfe braucht.
Wie kann ich in dem Modul "ask_a_question.php" ein neues
Feld einfügen (Telefonnummer)
für Hilfe wäre ich dankbar.
<?php
/
**$Id: ask_a_question.php,v 2.1 2006/01/24 23.55:01 pl-xtcs Exp $
**osCommerce, Open Source E-Commerce Solutions
**http://www.oscommerce.com
**Copyright (c) 2003 osCommerce
**Released under the GNU General Public License
**Credits: Marg Davison, Loïc Richard, FaNaTiC, C. Bouwmeester
**Version 1.1 u. Version 2.0 für XT:Commerce 3.0.4 SP1: 2005/2006 BSB Beratung+Software Bleicher
**ASK_A_QUESTION.GIF Grafikdesign (c) 2005/2005 BSB Beratung+Software Bleicher
**Anpassungen für XT:Commerce 3.0.4 SP1 inkl. Standard SUMA Funktion: 24.01.2006 Leemann Patrick xtc-services.ch
/
require ('includes/application_top.php');
// create smarty elements
$smarty = new Smarty;
// include needed functions
require_once (DIR_FS_INC. 'xtc_validate_email.inc.php');
**$valid_product = false;
****$product_info_query = xtc_db_query("select FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd where p.products_status = '1' and p.products_id = '".(int) $_GET['products_id']."' and pd.products_id = p.products_id and pd.language_id = '".(int) $_SESSION['languages_id']."'");
****if (xtc_db_num_rows($product_info_query)) {
******$valid_product = true;
******$product_info = xtc_db_fetch_array($product_info_query);
****}
**require(DIR_WS_LANGUAGES .$_SESSION['language'].'/ask_a_question.php');
**if (isset ($_GET['action']) && $_GET['action'] == 'process') {
****$error = false;
****$to_email_address = xtc_db_prepare_input($HTTP_POST_VARS['to_email_address']);
****$to_name = xtc_db_prepare_input($HTTP_POST_VARS['to_name']);
****$from_email_address = xtc_db_prepare_input($HTTP_POST_VARS['from_email_address']);
****$from_name = xtc_db_prepare_input($HTTP_POST_VARS['from_name']);
****$message = xtc_db_prepare_input($HTTP_POST_VARS['message']);
****if (empty($from_name)) {
******$error = true;
******$messageStack->add('friend', ERROR_FROM_NAME);
****}
****if (!xtc_validate_email($from_email_address)) {
******$error = true;
******$messageStack->add('friend', ERROR_FROM_ADDRESS);
****}
****if (empty($to_name)) {
******$error = true;
******$messageStack->add('friend', ERROR_TO_NAME);
****}
****if (!xtc_validate_email($to_email_address)) {
******$error = true;
******$messageStack->add('friend', ERROR_TO_ADDRESS);
****}
****if ($error == false) {
****// Assign XT:Commerce Mail-Variables
****$smarty->assign('MESSAGE', $_POST['message']);
****$smarty->assign('TEXT_NAME', $_POST['from_name']);
****$smarty->assign('FROM_EMAIL_ADDRESS', $_POST['from_email_address']);
****$smarty->assign('PRODUCT_NAME', $product_info['products_name']);
****$smarty->assign('PRODUCT_LINK', xtc_href_link(FILENAME_PRODUCT_INFO,'products_id=' .$product->data['products_id']));
****$smarty->caching = 0;
****$html_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/ask_a_question.html');
****$smarty->caching = 0;
****$txt_mail = $smarty->fetch(CURRENT_TEMPLATE.'/mail/'.$_SESSION['language'].'/ask_a_question.txt');
********xtc_php_mail(EMAIL_SUPPORT_ADDRESS, EMAIL_SUPPORT_NAME, $to_email_address, $to_name, EMAIL_SUPPORT_FORWARDING_STRING, EMAIL_SUPPORT_REPLY_ADDRESS, EMAIL_SUPPORT_REPLY_ADDRESS_NAME, '', '', 'Produktanfrage', $html_mail, $txt_mail);
****xtc_redirect(xtc_href_link('ask_a_question_ok. html'));
****}
**} elseif (xtc_session_is_registered('customer_id')) {
****$account_query = xtc_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
****$account = xtc_db_fetch_array($account_query);
****$from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
****$from_email_address = $account['customers_email_address'];
**}
**$breadcrumb->add(NAVBAR_TITLE, xtc_href_link(FILENAME_ASK_QUESTION, 'products_id='.$product->data['products_id']));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Tranistional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<link href="templates/sand/stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
</p>
<table width="500"**border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="25" height="25" align="left" valign="bottom" class="rahmen_or"> </td>
<td height="25" class="rahmen_om"> </td>
<td width="25" height="25" align="left" valign="bottom" class="rahmen_ol"> </td>
</tr>
<tr>
<td width="25" align="left" valign="top" class="rahmen_ml"> </td>
<td height="25" align="left" valign="top" >
<div align="left">
<table width="400" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td width="100%" valign="top">
<?php echo xtc_draw_form('email_friend', xtc_href_link(FILENAME_ASK_QUESTION, 'action=process&products_id=' . $product->data['products_id'])); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="preis"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo xtc_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
**if ($messageStack->size('friend') > 0) {
?>
<tr>
<td><?php echo $messageStack->output('friend'); ?></td>
</tr>
<?php
**}
?>
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo FORM_TITLE_CUSTOMER_DETAILS; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
<td class="main"><?php echo xtc_draw_input_field('from_name'); ?></td>
</tr>
<tr>
<td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
<td class="main"><?php echo xtc_draw_input_field('from_email_address'); ?></td>
</tr>
<tr>
<td class="main"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
<td class="main"><?php echo xtc_draw_input_field('from_email_address'); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><?php echo xtc_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><?php echo xtc_draw_hidden_field('to_email_address', STORE_OWNER_EMAIL_ADDRESS) . ' ' . ''; ?><?php echo xtc_draw_hidden_field('to_name', STORE_OWNER) . ' ' . ''; ?></td>
</tr>
<tr> </tr>
<tr>
<td class="main"><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
<tr class="infoBoxContents">
<td><?php echo xtc_draw_textarea_field('message', 'soft', 40, 8); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="10"><?php echo xtc_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td><?php echo '' . xtc_image_submit('button_back.gif', IMAGE_BUTTON_BACK) . ' (#)'; ?></td>
<td align="right"><?php echo xtc_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
<td width="10"><?php echo xtc_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</td>
<td width="25" align="left" valign="top" class="rahmen_mr"> </td>
</tr>
<tr>
<td width="25" height="25" align="left" valign="top" class="rahmen_ul"> </td>
<td height="25" align="left" valign="top" class="rahmen_um"> </td>
<td width="25" height="25" align="left" valign="top" class="rahmen_ur"> </td>
</tr>
</table>
</body>
</html>
gruss hegy