eselchenm72 Posted October 20, 2005 Report Share Posted October 20, 2005 Hallo. Hab das script f?r die Startseite gezogen und nach Anweisung installiert. Wenn ich jetzt die Startseite aufrufe kommt folgende Meldung: Fatal error: Call to a member function on a non-object in /home/htdocs/web27/html/shop1/includes/modules/sbg_random_products.php on line 66 Wei? jemand was zu tun ist? <? /* ----------------------------------------------------------------------------------------- Random Products v1.0 MODULE, created by Peter Gehle, 12.08.2005 ---------------------------------------------------------------------------------------*/ // CONFIG $maxprod = 6; // Anzahl der Angezeigten Produkte $box_smarty = new smarty; $box_smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/'); # include needed functions require_once(DIR_FS_INC . 'xtc_random_select.inc.php'); require_once(DIR_FS_INC . 'xtc_rand.inc.php'); require_once(DIR_FS_INC . 'xtc_get_products_name.inc.php'); require_once(DIR_FS_INC . 'xtc_row_number_format.inc.php'); require_once(DIR_FS_INC . 'xtc_image_button.inc.php'); require_once(DIR_FS_INC . 'xtc_get_short_description.inc.php'); # fsk18 lock $fsk_lock=''; if ($_SESSION['customers_status']['customers_fsk18_display']=='0') $fsk_lock=' and p.products_fsk18!=1'; if (GROUP_CHECK=='true') $group_check="and p.group_ids LIKE '%c_".$_SESSION['customers_status']['customers_status_id']."_group%'"; $rows = 0; $box_content = array(); $tmp_content = array(); $strSQL = ("SELECT manufacturers_id,products_id,products_fsk18,products_image,products_tax_class_id,products_price FROM products where products_status=1 AND LENGTH(products_image) > 4 ORDER BY rand() LIMIT 0, $maxprod"); $random_product = xtc_db_query($strSQL); if (mysql_num_rows($random_product) > 0) { while ($whats_new = xtc_db_fetch_array($random_product)){ $rows++; $strSQL2 = ("SELECT products_short_description FROM products_description where products_id = '$whats_new[products_id]'"); $random_product2 = xtc_db_query($strSQL2); $whats_new2 = xtc_db_fetch_array($random_product2); // Nur nutzen wenn Hersteller gepflegt werden!!! $strSQL3 = ("SELECT manufacturers_name FROM manufacturers where manufacturers_id = '$whats_new[manufacturers_id]'"); $random_product3 = xtc_db_query($strSQL3); $whats_new3 = xtc_db_fetch_array($random_product3); $image=''; if ($whats_new['products_image']!='') $image=DIR_WS_THUMBNAIL_IMAGES . $whats_new['products_image']; $name = xtc_get_products_name($whats_new['products_id']); $whats_new['products_short_description'] = xtc_get_short_description($whats_new['products_id']); if ($_SESSION['customers_status']['customers_status_show_price'] != '0') $buy_now=''; if ($_SESSION['customers_status']['customers_fsk18'] == '1') { if ($whats_new['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=' . $whats_new['products_id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now.gif', TEXT_BUY . $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=' . $whats_new['products_id'], 'NONSSL') . '">' . xtc_image_button('button_buy_now.gif', TEXT_BUY . $name . TEXT_NOW); } $price_str = $xtPrice->xtcGetPrice($whats_new['products_id'],$format=true,1,$whats_new['products_tax_class_id'],$whats_new['products_price']); $box_content[] = array( 'ID' => xtc_row_number_format($rows), 'NAME' => $name, 'HERSTELLER' => $whats_new3['manufacturers_name'], 'IMAGE' => $image, 'DESCRIPTION' => $whats_new2['products_short_description'], 'PRICE'=> $price_str, 'LINK'=> xtc_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $whats_new['products_id']), 'BUTTON_BUY_NOW'=>$buy_now); $i++; } } $box_smarty->assign('box_content', $box_content); $box_smarty->assign('language', $_SESSION['language']); $box_smarty->assign('NEW_LINK',xtc_href_link(FILENAME_PRODUCTS_NEW)); # set cache ID if (USE_CACHE == 'false') { $box_smarty->caching = 0; $box_random_products = $box_smarty->fetch(CURRENT_TEMPLATE.'/module/random_products.html'); } else { $box_smarty->caching = 1; $box_smarty->cache_lifetime = CACHE_LIFETIME; $box_smarty->cache_modified_check = CACHE_CHECK; $cache_id = $_SESSION['language'].$random_product['products_id'].$_SESSION['customers_status']['customers_status_name']; $box_random_products = $box_smarty->fetch(CURRENT_TEMPLATE.'/module/random_products.html',$cache_id); } $default_smarty->assign('MODULE_random_products',$box_random_products); ?> Link to comment Share on other sites More sharing options...
eselchenm72 Posted October 21, 2005 Author Report Share Posted October 21, 2005 Vielleicht hab ich mich nicht richtig ausgedr?ckt, was mein Prob. angeht. Es geht um das Sript, welches automatisch 6 zuf?llige Artikel auf der Startseite anzeigt. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.