Probiere das:
[code=php]
<?php
/* -----------------------------------------------------------------------------------------
$Id: product.php 1316 2005-10-21 15:30:58Z mz $
XT-Commerce - community made shopping
http://www.(( Wir dulden keine kommerziellen Werbelinks - Bitte Forenregeln beachten! ))
Copyright (c) 2005 XT-Commerce
-----------------------------------------------------------------------------------------
based on:
(c) 2000-2001 The Exchange Project (earlier name of osCommerce)
(c) 2002-2003 osCommerce(Coding Standards);
www.oscommerce.com Released under the GNU General Public License
---------------------------------------------------------------------------------------*/
class product {
/**
*
* Constructor
*
*/
function product($pID = 0) {
$this->pID = $pID;
// BOF - Tomcraft - 2009-10-30 - noimage.gif is displayed, when no image is defined
//$this->useStandardImage=false;
$this->useStandardImage=true;
// EOF - Tomcraft - 2009-10-30 - noimage.gif is displayed, when no image is defined
$this->standardImage='noimage.gif';
// BOF - DokuMan - 2010-03-12 - bugfix, wrong comparison
//if ($pID = 0) {
if ($pID == 0) {
// EOF - DokuMan - 2010-03-12 - bugfix, wrong comparison
$this->isProduct = false;
return;
}
// query for Product
$group_check = "";
if (GROUP_CHECK == 'true') {
$group_check = " and p.group_permission_".$_SESSION['customers_status']['customers_status_id']."=1 ";
}
$fsk_lock = "";
if ($_SESSION['customers_status']['customers_fsk18_display'] == '0') {
$fsk_lock = ' and p.products_fsk18!=1';
}
$product_query = "select * FROM ".TABLE_PRODUCTS." p,
".TABLE_PRODUCTS_DESCRIPTION." pd
where p.products_status = '1'
and p.products_id = '".$this->pID."'
and pd.products_id = p.products_id
".$group_check.$fsk_lock."
and pd.language_id = '".(int) $_SESSION['languages_id']."'";
$product_query = xtDBquery($product_query);
if (!xtc_db_num_rows($product_query, true)) {
$this->isProduct = false;
} else {
$this->isProduct = true;
$this->data = xtc_db_fetch_array($product_query, true);
}
}
/**
*
* Query for attributes count
*
*/
function getAttributesCount($pID = 0) {
if ($pID == 0){$pID = $this->pID;}
$products_attributes_query = xtDBquery("
select count(*) as total
from ".TABLE_PRODUCTS_OPTIONS." popt,
".TABLE_PRODUCTS_ATTRIBUTES." patrib
where patrib.products_id=".$pID."
and patrib.options_id = popt.products_options_id
and popt.language_id = ".(int) $_SESSION['languages_id']
);
$products_attributes = xtc_db_fetch_array($products_attributes_query, true);
return $products_attributes['total'];
}
/**
*
* Query for reviews count
*
*/
function getReviewsCount() {
$reviews_query = xtDBquery("select count(*) as total from ".TABLE_REVIEWS." r, ".TABLE_REVIEWS_DESCRIPTION." rd where r.products_id = '".$this->pID."' and r.reviews_id = rd.reviews_id and rd.languages_id = '".$_SESSION['languages_id']."' and rd.reviews_text !=''");
$reviews = xtc_db_fetch_array($reviews_query, true);
return $reviews['total'];
}
/**
*
* select reviews
*
*/
function getReviews() {
$data_reviews = array ();
$reviews_query = xtDBquery("select
r.reviews_rating,
r.reviews_id,
r.customers_name,
r.date_added,
&n