AudiV8 Posted April 19, 2004 Report Share Posted April 19, 2004 Hallo, Habe 7 neue db Felder angelegt, und die entsprechenden ?nderungen dazu durchgef?hrt, In Datei: categories.php $sql_data_array = array('products_name' => xtc_db_prepare_input($_POST['products_name'][$language_id]), 'products_car_manu' => xtc_db_prepare_input($_POST['products_car_manu'.$language_id]), 'products_car_model' => xtc_db_prepare_input($_POST['products_car_model'.$language_id]), 'products_car_typ' => xtc_db_prepare_input($_POST['products_car_typ'.$language_id]), 'products_fw_tlrate' => xtc_db_prepare_input($_POST['products_fw_tlrate'.$language_id]), 'products_fw_comment' => xtc_db_prepare_input($_POST['products_fw_comment'.$language_id]), 'products_fw_abe' => xtc_db_prepare_input($_POST['products_fw_abe'.$language_id]), 'products_fw_notes' => xtc_db_prepare_input($_POST['products_fw_notes'.$language_id]), 'products_description' => xtc_db_prepare_input($_POST['products_description_'.$language_id]), 'products_short_description' => xtc_db_prepare_input($_POST['products_short_description_'.$language_id]), 'products_url' => xtc_db_prepare_input($_POST['products_url'][$language_id]), 'products_meta_title' => xtc_db_prepare_input($_POST['products_meta_title'][$language_id]), 'products_meta_description' => xtc_db_prepare_input($_POST['products_meta_description'][$language_id]), 'products_meta_keywords' => xtc_db_prepare_input($_POST['products_meta_keywords'][$language_id])); und: $description_query = xtc_db_query("select language_id, products_name, products_car_manu, products_car_model, products_car_typ, products_fw_tlrate, products_fw_comment, products_fw_abe, products_fw_notes, products_description, products_short_description, products_meta_title, products_meta_description, products_meta_keywords, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . xtc_db_input($products_id) . "'"); $old_products_id=xtc_db_input($products_id); while ($description = xtc_db_fetch_array($description_query)) { xtc_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_car_manu, products_car_model, products_car_typ, products_fw_tlrate, products_fw_comment, products_fw_abe, products_fw_notes, products_description, products_short_description, products_meta_title, products_meta_description, products_meta_keywords, products_url, products_viewed) values ( '" . $dup_products_id . "', '" . $description['language_id'] . "', '" . addslashes($description['products_name']) . "', '" . addslashes($description['products_car_manu']) . "', '" . addslashes($description['products_car_model']) . "', '" . addslashes($description['products_car_typ']) . "', '" . addslashes($description['products_fw_tlrate']) . "', '" . addslashes($description['products_fw_comment']) . "', '" . addslashes($description['products_fw_abe']) . "', '" . addslashes($description['products_fw_notes']) . "', '" . addslashes($description['products_description']) . "', '" . addslashes($description['products_short_description']) . "', '" . addslashes($description['products_meta_title']) . "', '" . addslashes($description['products_meta_description']) . "', '" . addslashes($description['products_meta_keywords']) . "', '" . $description['products_url'] . "', '0')"); } und in der Datei new_product.php if ( ($_GET['pID']) && (!$_POST) ) { $product_query = xtc_db_query("select p.products_fsk18, p.product_template, p.options_template, pd.products_name, pd.products_car_manu, pd.products_car_model, pd.products_car_typ, pd.products_fw_tlrate, pd.products_fw_comment, pd.products_fw_abe, pd.products_fw_notes, pd.products_description, pd.products_short_description, pd.products_meta_title, pd.products_meta_description, pd.products_meta_keywords, pd.products_url, p.products_id, p.group_ids, p.products_sort, p.products_shippingtime, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_discount_allowed, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . $_SESSION['languages_id'] . "'"); $product = xtc_db_fetch_array($product_query); $pInfo = new objectInfo($product); } elseif ($_POST) { $pInfo = new objectInfo($_POST); $products_name = $_POST['products_name']; $products_car_manu = $_POST['products_car_manu']; $products_car_model = $_POST['products_car_model']; $products_car_typ = $_POST['products_car_typ']; $products_fw_tlrate = $_POST['products_fw_tlrate']; $products_fw_comment = $_POST['products_fw_comment']; $products_fw_abe = $_POST['products_fw_abe']; $products_fw_notes = $_POST['products_fw_notes']; $products_description = $_POST['products_description']; $products_short_description = $_POST['products_short_description']; $products_meta_title = $_POST['products_meta_title']; $products_meta_description = $_POST['products_meta_description']; $products_meta_keywords = $_POST['products_meta_keywords']; $products_url = $_POST['products_url']; } else { $pInfo = new objectInfo(array()); und: <table width="100%" border="0"> <tr> <td bgcolor="000000" height="10"></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_CAR_MANU; ?><?php echo xtc_draw_input_field('products_car_manu[' . $languages[$i]['id'] . ']', (($products_car_manu[$languages[$i]['id']]) ? stripslashes($products_car_manu[$languages[$i]['id']]) : xtc_get_products_car_manu($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_CAR_MODEL; ?><?php echo xtc_draw_input_field('products_car_model[' . $languages[$i]['id'] . ']', (($products_car_model[$languages[$i]['id']]) ? stripslashes($products_car_model[$languages[$i]['id']]) : xtc_get_products_car_model($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_CAR_TYP; ?><?php echo xtc_draw_input_field('products_car_typ[' . $languages[$i]['id'] . ']', (($products_car_typ[$languages[$i]['id']]) ? stripslashes($products_car_typ[$languages[$i]['id']]) : xtc_get_products_car_typ($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_FW_TLRATE; ?><?php echo xtc_draw_input_field('products_fw_tlrate[' . $languages[$i]['id'] . ']', (($products_fw_tlrate[$languages[$i]['id']]) ? stripslashes($products_fw_tlrate[$languages[$i]['id']]) : xtc_get_products_fw_tlrate($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_FW_COMMENT; ?><?php echo xtc_draw_input_field('products_fw_comment[' . $languages[$i]['id'] . ']', (($products_fw_comment[$languages[$i]['id']]) ? stripslashes($products_fw_comment[$languages[$i]['id']]) : xtc_get_products_fw_comment($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_FW_ABE; ?><?php echo xtc_draw_input_field('products_fw_abe[' . $languages[$i]['id'] . ']', (($products_fw_abe[$languages[$i]['id']]) ? stripslashes($products_fw_abe[$languages[$i]['id']]) : xtc_get_products_fw_abe($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_FW_NOTES; ?><?php echo xtc_draw_input_field('products_fw_notes[' . $languages[$i]['id'] . ']', (($products_fw_notes[$languages[$i]['id']]) ? stripslashes($products_fw_notes[$languages[$i]['id']]) : xtc_get_products_fw_notes($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_NAME; ?><?php echo xtc_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (($products_name[$languages[$i]['id']]) ? stripslashes($products_name[$languages[$i]['id']]) : xtc_get_products_name($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_PRODUCTS_URL . '<small>' . TEXT_PRODUCTS_URL_WITHOUT_HTTP . '</small>'; ?><?php echo xtc_draw_input_field('products_url[' . $languages[$i]['id'] . ']', (($products_url[$languages[$i]['id']]) ? stripslashes($products_url[$languages[$i]['id']]) : xtc_get_products_url($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> </table> Das Problem ist das die neuen Werte nicht in die Datenbank geschickt werden. Hat jemand ne Idee? Mu? die ?bergabe eventuell noch in einer 3. Datei eingetragen und/oder ge?ndert werden? :grml: :grml: W?rde mich ?ber eine Antwort freuen... Thanks & Greetz aus DD Link to comment Share on other sites More sharing options...
Elanor Posted April 19, 2004 Report Share Posted April 19, 2004 auf die schnelle w?rd ich sagen das du eine SQL Anweisung vergessen hast zu ?ndern Link to comment Share on other sites More sharing options...
mzanier Posted April 19, 2004 Report Share Posted April 19, 2004 vermutung aus der h?fte. products_car_manu[' . $languages[$i]['id'] . '] $_POST['products_car_manu'.$language_id] -> $_POST['products_car_manu['.$language_id].']'] Link to comment Share on other sites More sharing options...
AudiV8 Posted April 20, 2004 Author Report Share Posted April 20, 2004 Hallo, mzanier, deine Vermutung war richtig, ich hatte das mit dem Befehl f?r die description gemacht, das war dann wohl verkehrt... In die Datenbank schreibt er die Daten jetzt rein, ich kann die zus?tztlichen Eintr?ge auch in der Kategorie ?bersicht aufrufen, aber, Sobald ich auf Bearbeiten gehe, werden die neuen Entr?ge nicht in dem dazugeh?rigen Formularfeld abgerufen, sindern diese bleiben leer... Hast dazu noch ne Idee? Link to comment Share on other sites More sharing options...
mzanier Posted April 20, 2004 Report Share Posted April 20, 2004 xtc_get_products_car_model($pInfo->products_id, $languages[$i]['id'])) sind denn deine funktionen auch richtig ? Link to comment Share on other sites More sharing options...
AudiV8 Posted April 20, 2004 Author Report Share Posted April 20, 2004 Hallo, Das w?re der Aufruf der Funktion: <tr> <td bgcolor="#FFCC33" valign="top" class="main"><?php echo xtc_image(DIR_WS_LANGUAGES . $languages[$i]['directory'] .'/'. $languages[$i]['image'], $languages[$i]['name']); ?><?php echo TEXT_PRODUCTS_CAR_MANU; ?><?php echo xtc_draw_input_field('products_car_manu[' . $languages[$i]['id'] . ']', (($products_car_manu[$languages[$i]['id']]) ? stripslashes($products_car_manu[$languages[$i]['id']]) : xtc_get_products_car_manu($pInfo->products_id, $languages[$i]['id'])),'size=60'); ?></td> </tr> und das die Funktion aus admin/includes/function/genral.php function xtc_get_products_car_manu($product_id, $language_id = 0) { if ($language_id == 0) $language_id = $_SESSION['languages_id']; $product_query = xtc_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "' and language_id = '" . $language_id . "'"); $product = xtc_db_fetch_array($product_query); return $product['products_car_manu']; } , kann keinen Fehler entdecken, oder bin ich mal wieder blind? ... Link to comment Share on other sites More sharing options...
mzanier Posted April 20, 2004 Report Share Posted April 20, 2004 hehe =) soll ichs dir gleich sagen ? ^^ oder noch schmollen ? :} Link to comment Share on other sites More sharing options...
mzanier Posted April 20, 2004 Report Share Posted April 20, 2004 $product_query = xtc_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "' and language_id = '" . $language_id . "'"); $product = xtc_db_fetch_array($product_query); return $product['products_car_manu']; .. select products_name where .... return $product['products_car_manu']; du musst nat?rlich auch den wert in der query haben welchen du zur?ckgibst Link to comment Share on other sites More sharing options...
AudiV8 Posted April 20, 2004 Author Report Share Posted April 20, 2004 Autsch !!!! :wall: :wall: :wall: :wall: Also doch blind.... grummel ... Link to comment Share on other sites More sharing options...
AudiV8 Posted April 20, 2004 Author Report Share Posted April 20, 2004 Es geht , es geht, es geht.... Jippi... ! :pint: :pint: Link to comment Share on other sites More sharing options...
mzanier Posted April 20, 2004 Report Share Posted April 20, 2004 so direkt wollt ich das nicht sagen :?: Link to comment Share on other sites More sharing options...
AudiV8 Posted April 20, 2004 Author Report Share Posted April 20, 2004 Schon wieder eine Frage :i: in der admin/specials.php muss ich, um "meinen" Produktnamen in der Auwahlliste vollst?ndig angezeigt zu bekommen meine neuen Fleder ja auch hinzuf?gen. Nur sehe ich hier mal wieder nicht durch, wie muss die ?nderung aussehen: Ich denke mal hier m?ssen die neuen Felder rein: <td class="main"><?php echo TEXT_SPECIALS_PRODUCT; echo ($sInfo->products_name) ? "" : ''; ?></td> w?re das so richtig? <td class="main"><?php echo TEXT_SPECIALS_PRODUCT; echo ($sInfo->products_name) ? "" : ''; echo ($sInfo->products_car_manu) ? "" : ''; ?></td> Weiterhin denke ich ist der n?chste Eintrag hier zu finden, f?r das Auswahlfeld: <td class="main"><?php echo ($sInfo->products_name) ? $sInfo->products_name . ' <small>(' . xtc_format_price($price,1,1). ')</small>' : xtc_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo xtc_draw_hidden_field('products_price', $sInfo->products_price); ?></td> Hier fehlt mir v?llig der Ansatz wie ich meine 3 neuen Felder davor bekomme: <td class="main"><?php echo products_car_manu usw ($sInfo->products_name) ? $sInfo->products_name . ' <small>(' . xtc_format_price($price,1,1). ')</small>' : xtc_draw_products_pull_down('products_id', 'style="font-size:10px"', $specials_array); echo xtc_draw_hidden_field('products_price', $sInfo->products_price); ?></td> Link to comment Share on other sites More sharing options...
AudiV8 Posted April 22, 2004 Author Report Share Posted April 22, 2004 Dann h?ng ich mal meine n?chste Frage hier noch mit dran: Nun m?ssen ja die Felder im Shop auch angezeigt werden. Zuerst in der Auflistung der Artikel, Da ja "mein" products_name nun aus 4 verschiedenen Feldern besteht. Habe mir die modules/product_listing.php schon mal vorgenommen, und ?berall da wo der urspr?ngliche Eintrag "Products_name" drin ist um meine neuen Felder erweitert. Hier im Einzelnen: if ($listing['products_fsk18']=='0') $buy_now='<a href="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action')) . 'action=buy_now&BUYproducts_id=' . $listing['products_id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_car_manu'] .$listing['products_car_model'] .$listing['products_car_typ'] .$listing['products_fw_tlrate'] . $listing['products_name'] . TEXT_NOW); } else { $buy_now='<a href="' . xtc_href_link(basename($PHP_SELF), xtc_get_all_get_params(array('action')) . 'action=buy_now&BUYproducts_id=' . $listing['products_id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now.gif', TEXT_BUY . $listing['products_car_manu'] .$listing['products_car_model'] .$listing['products_car_typ'] .$listing['products_fw_tlrate'] . $listing['products_name'] . TEXT_NOW); } $fsk18=''; if ($listing['products_fsk18']=='1') { $fsk18='true'; } und hier: $image=''; if ($listing['products_image']!='') { $image=DIR_WS_THUMBNAIL_IMAGES . $listing['products_image']; } if (ACTIVATE_SHIPPING_STATUS=='true') { $shipping_status=xtc_get_shipping_status_name($listing['products_shippingtime']); $shipping_status_name=$shipping_status['name']; if ($shipping_status['image']!='') $shipping_status_image='admin/images/icons/'.$shipping_status['image']; } $module_content[]=array( 'PRODUCTS_CAR_MANU'=>$listing['products_car_manu'], 'PRODUCTS_CAR_MODEL'=>$listing['products_car_model'], 'PRODUCTS_CAR_TYP'=>$listing['products_car_typ'], 'PRODUCTS_FW_TLRATE'=>$listing['products_fw_tlrate'], 'PRODUCTS_NAME'=>$listing['products_name'], 'PRODUCTS_MODEL'=>$listing['products_model'], 'PRODUCTS_SHORT_DESCRIPTION'=>$listing['products_short_description'], 'PRODUCTS_IMAGE'=>$image, 'PRODUCTS_PRICE'=>$price, 'PRODUCTS_LINK' =>xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']), 'BUTTON_BUY_NOW'=>$buy_now, 'PRODUCTS_FSK18' => $fsk18, 'SHIPPING_NAME'=>$shipping_status_name, 'SHIPPING_IMAGE'=>$shipping_status_image, 'PRODUCTS_ID'=>$listing['products_id']); Nur zu dumm das meine neuen Felder nicht angezeigt werden, was habe ich ?bersehen? Meine Vermutung das in der Datei inc/xtc_get_products_name.inc der Name irgendwie generiert wird? function xtc_get_products_name($product_id, $language = '') { if (empty($language)) $language = $_SESSION['languages_id']; $product_query = xtc_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $product_id . "' and language_id = '" . $language . "'"); $product = xtc_db_fetch_array($product_query); return $product['products_name']; } Ist dem so, oder liege ich v?llig daneben? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.