0) && ((time()-$a_last['dernier']) < 3) )
{
$f=fopen('last.txt','w');
fwrite($f,'OUI '.mysql_num_rows($r_last) .' '. time(). ' ' .$a_last['dernier'].' '.$last);
fclose($f);
/*rien*/ }
else
{
$f=fopen('last.txt','w');
fwrite($f,'NON '.mysql_num_rows($r_last) .' '. time(). ' ' .$a_last['dernier'].' '.$last);
fclose($f);
if((mysql_num_rows($aa)>0) && ($done==FALSE))
// mise a jour
{ $requete='UPDATE products_to_referers SET views=views+1 '
.'WHERE referers_id="'.$a_referers['id'].'" '
.'AND products_id="'.$_GET['products_id'].'" ';
//echo $requete;
tep_db_query($requete);
$insertion_session='INSERT INTO referers_sessions (customers_ip,referers_id,products_id,time) '
.'VALUES ("'.$_SERVER["REMOTE_ADDR"].'","'.$a_referers['id'].'","'.$_GET['products_id'].'","'.time().'");';
tep_db_query($insertion_session);
$f=fopen('logg.txt','a+');
fwrite($f,time().' mise a jour '.$_SERVER['HTTP_REFERER']."\n");
fclose($f);
$done=TRUE;
}
else if($done==FALSE)
// ou nouvelle insertion
{ $requete='INSERT INTO products_to_referers (products_id,referers_id,views,sells) '
.'VALUES ("'.$_GET['products_id'].'","'.$a_referers['id'].'","1","0");';
//echo $requete;
tep_db_query($requete);
$insertion_session='INSERT INTO referers_sessions (customers_ip,referers_id,products_id,time) '
.'VALUES ("'.$_SERVER["REMOTE_ADDR"].'","'.$a_referers['id'].'","'.$_GET['products_id'].'","'.time().'");';
tep_db_query($insertion_session);
$f=fopen('logg.txt','a+');
fwrite($f,time().' nouvelle insertion '.$_SERVER['HTTP_REFERER']."\n");
fclose($f);
$done=TRUE;
}
}
}
}
// fin IMPLEMENTATION BRUNO POUR TRACKING///////////////////////////////////////////////////
// oliscr@gmail.com ////////////////////////////////////////////////////////////////////
// Tracking Newsletter - Baphira
if(isset($HTTP_GET_VARS['tracking_newsletter']) && $HTTP_GET_VARS['tracking_newsletter'] != ""){
$query_check_tracking = tep_db_query("SELECT * FROM tracking_newsletter WHERE customers_id = '".$HTTP_GET_VARS['tracking_newsletter']."'");
$check_tracking = tep_db_fetch_array($query_check_tracking);
if($check_tracking['customers_id'] != ""){
tep_db_query("UPDATE tracking_newsletter SET products_id = '".$HTTP_GET_VARS['products_id']."', index_ref = '0', annif_ref = '0', date = now(), order_id = '0', newsletter_id = '".$HTTP_GET_VARS['newsletter_id']."' WHERE customers_id = '".$HTTP_GET_VARS['tracking_newsletter']."'");
}else{
tep_db_query("INSERT INTO tracking_newsletter VALUES ('".$HTTP_GET_VARS['tracking_newsletter']."', '".$HTTP_GET_VARS['products_id']."', '0', '0', now(), '0', '".$HTTP_GET_VARS['newsletter_id']."')");
}
}
// eof Tracking Newsletter
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
// Aller chercher la catégorie pour déterminer le stylesheet
$categories_query = tep_db_query("select parent_id from categories INNER join products_to_categories ON products_to_categories.categories_id = categories.categories_id
where products_to_categories.products_id='". (int)$HTTP_GET_VARS['products_id'] ."'");
$categories = tep_db_fetch_array($categories_query);
// EOF stylesheet query
// SECTION REFERCEMENT TEST BETA VERSION
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, if(specials.status = 1, ifnull(specials_new_products_price, p.products_price), p.products_price) as new_price, specials_new_products_price, specials.status, p.products_status from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p " . "LEFT JOIN specials ON specials.products_id = p.products_id WHERE p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_info = tep_db_fetch_array($product_info_query);
// ajout modèle si existe dans le titre
if ($product_info['products_model'] != null){
$modele = " [".$product_info['products_model']."]";
}else{
$modele = "";
}
// Enlève les accents et autres
$strip_array = array("é", "è","à","ù",""");
$strip_replace = array("e","e","a","u","'");
$description = str_replace(array("""),array("'"),htmlspecialchars(preg_replace($search,$replace,str_replace($strip_array, $strip_replace,$product_info['products_description']))));
// CHERCHER LA CATEGORIE
// permet d'aller chercher le numéro de catégorie
$cat_id_ref_query = tep_db_query("SELECT categories_id FROM products_to_categories WHERE products_id='" . $product_info['products_id']."'");
$cat_id_ref = tep_db_fetch_array($cat_id_ref_query);
$cat_nom_ref_query = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id ='" . $cat_id_ref['categories_id']."'");
$cat_nom_ref = tep_db_fetch_array($cat_nom_ref_query);
$cat_parent_query = tep_db_query("SELECT parent_id FROM `categories` WHERE categories_id='" . $cat_id_ref['categories_id']."'");
$cat_parent = tep_db_fetch_array($cat_parent_query);
$cat_nom_parent_query = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id ='" . $cat_parent['parent_id']."'");
$cat_nom_parent = tep_db_fetch_array($cat_nom_parent_query);
// ainsi $cat_nom_ref['categories_name'] représente le nom de la catégorie du produit...
// FIN DE SECTION PHP
?>
>
';
}
// Update du stylesheet
echo tep_list_category_stylesheet($current_category_id);
?>
|
| TEXT_PRODUCT_NOT_FOUND))); ?> |
|
|
' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . ''; ?> |
|
|
|
|
|
|
|