osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> [Résolu] Contribution "création de répertoires", Categories & Products Images Folder Tree
Rockfell
posté 31 Mar 2005, 10:54
Message #1


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 35
Inscrit : 28-December 04
Membre no 4205



Bonjour,

J'utilise la contribution "Categories & Products Images Folder Tree V1.2" (contrib. 2409) pour créer des répertoires et sous répertoires pour mes images.

Le problème est le suivant : lorsque j'édite une fiche produit où l'image est déjà définie pour un article et que je remet à jour la fiche produit, le chemin du répertoire et sous-répertoire vers l'image se répète.

Par exemple : dvd/drame/image01.jpg devient dvd/drame/dvd/drame/image01.jpg, puis dvd/drame/dvd/drame/dvd/drame/image01.jpg, etc.

A chaque fois que je met à jour ma fiche produit j'ai donc plusieurs niveaux de répertoires qui se répètent.

Quelqu'un aurait-il le même problème avec cette contrib. ?

Merci.

-----------------------------------------------
OsCommerce V2.2 Ms2 (merci Delaballe)
-----------------------------------------------
Go to the top of the page
 
Gnidhal
posté 3 Apr 2005, 08:52
Message #2


5eme dan OSC
Icône de groupe

Groupe : Administrateur
Messages : 9221
Inscrit : 4-March 03
Lieu : Pau
Membre no 927



Doit y avoir un petit bug dans la récupération du nom de fichier.
Normalement dans la base il faut enregistrer le nom de fichier précédé de son chemin pour que l'image soit pointée correctement sur le serveur.

Dans le code de ta contrib tu dois donc trouver un truc du genre :
CODE
$image = $chemin_image . $image;

il faudrait alors tester si le chemin est déjà dans le nom de l'image avant de le rajouter systématiquement. ça pourrait donner un code à modifier du genre :
CODE
if (!ereg($chemin_image, $image)) $image = $chemin_image . $image;
ou encore
CODE
$image = (!ereg($chemin_image, $image)) ?  $chemin_image . $image : $image;

$image étant le nom de l'image : "image1.jpg"
$chemin_image étant le chemin d'accès à l'image : "/images/dvd/bidule/"

Voilà une piste de bug sur cette contribution. wink.gif
yapluka relever les manches smile.gif
Allez, Au Boulot ! wink.gif


--------------------
Tout d'abord : - Ni Hotline ni Service Après Vente, ces forums sont un lieu d'échange. BIEN POSER SA QUESTION (généralités)
Les "Informations Importantes" que vous devez ABSOLUMENT avoir lues :
Règlement, Bien poser sa question dans ces forums et Bien utiliser les Forums.
Les raccourcis pour gagner du temps : la FAQ, les PDF de la Doc (MS2-fr): PDF-V1 et PDF-V2, le moteur de Recherche sur les forums , la Liste des Contributions de Corbin.

----------------------------- Quelques sites de référence ---------------------------
PHP: Le site du Zéro et PHP Débutant avec la DOC en français -- HTML: Self HTML - WebProgrammation -- CSS: OpenWeb - AlsaCréations - CSS/Edge -- Autres ressources: - XajaX - highslide js
Les bons outils : EasyPHP - WAMP-5 - - Notepad++ - Firefox et son extension WebDeveloper
Le gène idéal c'est le gène original. Le génie des halles est un Génie des Alpages qui tente d'être à la page. (Merci f'murrr pour les cours de philosophie de chien)
Go to the top of the page
 
Rockfell
posté 3 Apr 2005, 09:22
Message #3


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 35
Inscrit : 28-December 04
Membre no 4205



Merci pour ta réponse Gnidhal.

Le code dont tu parles et qui pose problème se trouve peut-être dans admin/categories.php :

CODE

    case 'new_product_preview':
// copy image only if modified
      $products_image = new upload('products_image');
// images categories
      $prod_path = $HTTP_GET_VARS['cPath'];
      $lchar = strrpos($prod_path, '_');
if ($lchar + 1 == 1) {
      $lachar = 0;
      } else {
      $lachar = $lchar + 1;
      }
$prod_path_id = substr($prod_path, $lachar);
      $prod_folder = tep_output_generated_category_path_fs($prod_path_id);
      $products_image->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
// eof images categories
      if ($products_image->parse() && $products_image->save()) {


En résumé :
Quand on entre dans la partie "nouveau produit", on suppose que l'on doit uploader une image. En cliquant sur "aperçu" quand on édite le produit on voit bien l'image mais dès que l'on clique sur "mise à jour" le chemin de l'image est ajouté une nouvelle fois.

D'autres utilisateurs ont ce problème sur le forum US : VOIR ICI.

C'est bête sans ce problème cette contrib. serait vraiment bien. Les répertoires et sous-répertoires se créent automatiquement quand on upload une image (excepté quand le nom d'un répertoire contient un accent : ex. : le répertoire "comédie" sera créé en "comdie").

Dur, dur ... rolleyes.gif
Go to the top of the page
 
osgadou
posté 3 Apr 2005, 09:29
Message #4


Ceinture orange+ OSC
Icône de groupe

Groupe : Membres
Messages : 470
Inscrit : 25-November 04
Membre no 3912



j'ai eu ce soucis et l'ai arrangé grace au forum us

j'ai cherché pour toi :
http://forums.oscommerce.com/index.php?showtopic=110110
bonne chance (voir page 2)!


--------------------
MS2FR
Go to the top of the page
 
Rockfell
posté 3 Apr 2005, 20:33
Message #5


Ceinture blanche+ OSC
Icône de groupe

Groupe : Membres
Messages : 35
Inscrit : 28-December 04
Membre no 4205



Merci Osgadou, ça marche nickel !

Il y aurait même plusieurs façons de procéder.

J'ai retenu celle de "athyholdt" :

Dans admin/categories.php, trouver la ligne :

CODE

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
// images categories
$sql_data_array['products_image'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image']);
// eof images categories
}


et remplacer par :

CODE

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {

$product_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image'] != $HTTP_POST_VARS['products_image'])
{
// images categories
$sql_data_array['products_image'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image']);
// eof images categories
}
}



En fait, on vérifie si le chemin de l'image existe déjà dans la base de données, si "oui", ben ça ne rajoute pas le chemin une deuxième fois. (voir post)

Encore merci.
Go to the top of the page
 
Mousticks
posté 4 Apr 2005, 16:54
Message #6


Ceinture orange+ OSC
Icône de groupe

Groupe : Membres
Messages : 371
Inscrit : 14-August 04
Lieu : chalons en champagne
Membre no 3047



je viens d'essayer d'installer cette contrib mais des que je me rends dans l'admin il me stipule ceci :

QUOTE
Catégories / Produits   

1054 - Champ 'p.products_bimage' inconnu dans field list

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_bimage, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

[TEP STOP]


je précise au cas ou que je n'ai pas vidé mes catégoriers et produits avant, je ne sais pas s'il fallait ? vu que j'ai déjà des trucs de rentré j'aurais préféré ne pas vider lol mais s'il faut... bah il faudra tongue.gif (à la rigueur jene suis qu'en test donc bon)

merci d'avance !! smile.gif

ps : j'ai préféré mettre mon prob dans un post déjà existant, ça pose pas de probleme ?


--------------------
MS2fr par Delaballe

* AdminMS2fr_V2.3 * Login Box * Ask a question * Box Image Thema * Define Mainpage * Events Calendar * Faq Desk * Fck Editor * News Desk * Osc CenterShop * Pool Booth * New Field Everywhere * Products Short Description * Products Tabs modifié * X Sell * Movie Details * Login and Return to Same Page * Big Image * Ajax Popup Image * Mo Pics modifié * All Products * Box Categories Pro * Sendcard * Categoriser resultats de recherche * Specials on Default * Star Product * Most Viewed * Featured Products * Survey Anywhere (en cours)...
Go to the top of the page
 
osgadou
posté 5 Apr 2005, 12:28
Message #7


Ceinture orange+ OSC
Icône de groupe

Groupe : Membres
Messages : 470
Inscrit : 25-November 04
Membre no 3912



la reponse est dans l'erreur :
p.products_bimage n'existe pas dans ta table products...

Mais ce products_bimage c'est pas de la contrib bigimage? est ce qu'il existe dans ta base? si oui est il ecrit exactement comme ca?


--------------------
MS2FR
Go to the top of the page
 
Mousticks
posté 2 Jun 2005, 08:15
Message #8


Ceinture orange+ OSC
Icône de groupe

Groupe : Membres
Messages : 371
Inscrit : 14-August 04
Lieu : chalons en champagne
Membre no 3047



qd j'arrive a en résoudre 1 y'en a un autre qui rapplique biggrin.gif

j'ai donc fait les modif pour que lorsqu'on met a jour une fiche les chemins ne se répétent pas mais j'ai un petit soucis maintenant avec bimage unsure.gif

le code rajouté pour bimage est celui ci :
CODE
         if (isset($HTTP_POST_VARS['products_bimage']) && tep_not_null($HTTP_POST_VARS['products_bimage']) && ($HTTP_POST_VARS['products_bimage'] != 'none')) {
           $sql_data_array['products_bimage'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_bimage']);
         }


donc je pensais bah tout simplement faire comme la correction proposées et mettre ce code la :
CODE
if (isset($HTTP_POST_VARS['products_bimage']) && tep_not_null($HTTP_POST_VARS['products_bimage']) && ($HTTP_POST_VARS['products_bimage'] != 'none')) {

$product_query = tep_db_query("select products_bimage from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_bimage'] != $HTTP_POST_VARS['products_bimage'])
{
// images categories
$sql_data_array['products_bimage'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_bimage']);
// eof images categories
}
}


mais ça ne change rien confused.gif si qq'un a une piste ou le moyen de m'aider la dessus smile.gif

marchiiii tongue.gif


--------------------
MS2fr par Delaballe

* AdminMS2fr_V2.3 * Login Box * Ask a question * Box Image Thema * Define Mainpage * Events Calendar * Faq Desk * Fck Editor * News Desk * Osc CenterShop * Pool Booth * New Field Everywhere * Products Short Description * Products Tabs modifié * X Sell * Movie Details * Login and Return to Same Page * Big Image * Ajax Popup Image * Mo Pics modifié * All Products * Box Categories Pro * Sendcard * Categoriser resultats de recherche * Specials on Default * Star Product * Most Viewed * Featured Products * Survey Anywhere (en cours)...
Go to the top of the page
 
osgadou
posté 3 Jun 2005, 13:41
Message #9


Ceinture orange+ OSC
Icône de groupe

Groupe : Membres
Messages : 470
Inscrit : 25-November 04
Membre no 3912



si je me souviens bien,
il y a un soucis d'interference entre big image et folder tree....
j'avais eu le même pb, jai laissé tombé big image, et je me suis fait un big image "maison"...

>Creation dans l'admin d'un nouveau champs pour le produit dans lequel je rajoute mon fichier grosse image
>modification de la requete de la popup pour qu'elle recupere mon nouveau champs

il faut s'y connaitre un petit peu voila..


--------------------
MS2FR
Go to the top of the page
 
Mousticks
posté 11 Jun 2005, 08:07
Message #10


Ceinture orange+ OSC
Icône de groupe

Groupe : Membres
Messages : 371
Inscrit : 14-August 04
Lieu : chalons en champagne
Membre no 3047



arfff c chiant ça lol
merci pour l'info, pu ka trouver une solution alors, parce que faire un big image moi m je doute fortement y arriver confused.gif


--------------------
MS2fr par Delaballe

* AdminMS2fr_V2.3 * Login Box * Ask a question * Box Image Thema * Define Mainpage * Events Calendar * Faq Desk * Fck Editor * News Desk * Osc CenterShop * Pool Booth * New Field Everywhere * Products Short Description * Products Tabs modifié * X Sell * Movie Details * Login and Return to Same Page * Big Image * Ajax Popup Image * Mo Pics modifié * All Products * Box Categories Pro * Sendcard * Categoriser resultats de recherche * Specials on Default * Star Product * Most Viewed * Featured Products * Survey Anywhere (en cours)...
Go to the top of the page
 
ladiag
posté 19 Aug 2008, 10:50
Message #11


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 136
Inscrit : 13-July 08
Lieu : Paris
Membre no 22438



Salut à tous,

Je me permets de déterrer ce post d'outre-tombe pour vous dire que j'ai réussi à adapter cette contribution avec la contribution Ultra Pics 2.08 + Lightbox donc si certains essayent de le faire mais n'y arrivent pas, je pourrais les renseigner.

J'ai un peu la flemme tongue.gif de le poster si personne ne me dit que ca peut lui servir puisqu'il y a pas mal de retouches à faire mais je le ferais si ne serait-ce qu'une personne est intéressée.

Cordialement


--------------------
MS2.2 FR Traduction Delaballe + Contrib Checker + Discount Coupon Codes + Anti Spambot Tell a Friend + Search with DropDown Price Range + Product Name in Navigation Bar + Anti Robot Registration + Mail Validation + Autologon + Login Box + Contact Us Choice + Review Approval System + SoldOut but Displayed + QT Pro + Printer Friendly Product Page + Blacklist + Ultrapics 2.08 + LightBox + Country Based Shipping + Ultimate SEO URLS + Easy Populate + Categories Tree Builder + Manufacturers logo box + FAQ Desk + Automatic Thumbnail + OSC Center Shop + NewsDesk + Admin DHTMLMenu + DHTML Menu + Product Listing in Columns + Simple Down for Maintenance ...
Go to the top of the page
 
nephelion
posté 19 Aug 2008, 11:54
Message #12


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 96
Inscrit : 1-March 05
Lieu : dans les nuages
Membre no 4971



si tu veux bien , je suis demandeur !
merci ladiag


--------------------
osCommerce V2.2 RC1 W3C Valid FR V3 | HeadTags_SEO_V_3.2.4 | Ultimate_SEO_URLs_v22d10
Go to the top of the page
 
ladiag
posté 19 Aug 2008, 13:05
Message #13


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 136
Inscrit : 13-July 08
Lieu : Paris
Membre no 22438



En attendant d'en faire un fichier téléchargeable, je l'ai envoyé par mp à nephelion. Le problème est que mon categories.php est plein d'autres contrib alors il faut que je fasse le tri pour savoir ce que les gens doivent mettre. D'ici là, je peux l'envoyer par mp à ceux qui souhaitent.


--------------------
MS2.2 FR Traduction Delaballe + Contrib Checker + Discount Coupon Codes + Anti Spambot Tell a Friend + Search with DropDown Price Range + Product Name in Navigation Bar + Anti Robot Registration + Mail Validation + Autologon + Login Box + Contact Us Choice + Review Approval System + SoldOut but Displayed + QT Pro + Printer Friendly Product Page + Blacklist + Ultrapics 2.08 + LightBox + Country Based Shipping + Ultimate SEO URLS + Easy Populate + Categories Tree Builder + Manufacturers logo box + FAQ Desk + Automatic Thumbnail + OSC Center Shop + NewsDesk + Admin DHTMLMenu + DHTML Menu + Product Listing in Columns + Simple Down for Maintenance ...
Go to the top of the page
 
ladiag
posté 20 Aug 2008, 19:58
Message #14


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 136
Inscrit : 13-July 08
Lieu : Paris
Membre no 22438



Salut à tous,

Alors voilà comment j'ai fait pour adapter Ultra Images avec Categories Tree Builder, je ne suis pas un expert de PHP, donc je ne sais pas si c'est un bon codage mais en tout cas ca marche pour moi. Supposons que vous ayez déjà installé UltraPics et que vous avez installé Categories Tree Builder et que vous voulez maintenant l'adapter aux images supplémentaires, lorsque vous modifiez le fichier categories.php situé dans votre admin...

... Remplacez (ligne 329 pour moi) :

Code
// BOF MaxiDVD: Modified For Ultimate Images Pack!
   if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) {
             $sql_data_array['products_image'] = '';
           } else

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none'))
{

$product_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image'] != $HTTP_POST_VARS['products_image'])
{
// images categories
$sql_data_array['products_image'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image']);
// eof images categories
}
}


... par ...

Code
// BOF MaxiDVD: Modified For Ultimate Images Pack!
     //   if (($HTTP_POST_VARS['unlink_image'] == 'yes') or ($HTTP_POST_VARS['delete_image'] == 'yes')) {
    //         $sql_data_array['products_image'] = '';
      //      } else

if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none'))
{

$product_query = tep_db_query("select products_image from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image'] != $HTTP_POST_VARS['products_image'])
{
// images categories
$sql_data_array['products_image'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_sm_1']) && tep_not_null($HTTP_POST_VARS['products_image_sm_1']) && ($HTTP_POST_VARS['products_image_sm_1'] != 'none'))
{
$product_query = tep_db_query("select products_image_sm_1 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_sm_1'] != $HTTP_POST_VARS['products_image_sm_1'])
{
// images categories
$sql_data_array['products_image_sm_1'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_1']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_xl_1']) && tep_not_null($HTTP_POST_VARS['products_image_xl_1']) && ($HTTP_POST_VARS['products_image_xl_1'] != 'none'))
{
$product_query = tep_db_query("select products_image_xl_1 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_xl_1'] != $HTTP_POST_VARS['products_image_xl_1'])
{
// images categories
$sql_data_array['products_image_xl_1'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_1']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_sm_2']) && tep_not_null($HTTP_POST_VARS['products_image_sm_2']) && ($HTTP_POST_VARS['products_image_sm_2'] != 'none'))
{
$product_query = tep_db_query("select products_image_sm_2 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_sm_2'] != $HTTP_POST_VARS['products_image_sm_2'])
{
// images categories
$sql_data_array['products_image_sm_2'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_2']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_xl_2']) && tep_not_null($HTTP_POST_VARS['products_image_xl_2']) && ($HTTP_POST_VARS['products_image_xl_2'] != 'none'))
{
$product_query = tep_db_query("select products_image_xl_2 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_xl_2'] != $HTTP_POST_VARS['products_image_xl_2'])
{
// images categories
$sql_data_array['products_image_xl_2'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_2']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_sm_3']) && tep_not_null($HTTP_POST_VARS['products_image_sm_3']) && ($HTTP_POST_VARS['products_image_sm_3'] != 'none'))
{
$product_query = tep_db_query("select products_image_sm_3 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_sm_3'] != $HTTP_POST_VARS['products_image_sm_3'])
{
// images categories
$sql_data_array['products_image_sm_3'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_3']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_xl_3']) && tep_not_null($HTTP_POST_VARS['products_image_xl_3']) && ($HTTP_POST_VARS['products_image_xl_3'] != 'none'))
{
$product_query = tep_db_query("select products_image_xl_3 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_xl_3'] != $HTTP_POST_VARS['products_image_xl_3'])
{
// images categories
$sql_data_array['products_image_xl_3'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_3']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_sm_4']) && tep_not_null($HTTP_POST_VARS['products_image_sm_4']) && ($HTTP_POST_VARS['products_image_sm_4'] != 'none'))
{
$product_query = tep_db_query("select products_image_sm_4 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_sm_4'] != $HTTP_POST_VARS['products_image_sm_4'])
{
// images categories
$sql_data_array['products_image_sm_4'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_4']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_xl_4']) && tep_not_null($HTTP_POST_VARS['products_image_xl_4']) && ($HTTP_POST_VARS['products_image_xl_4'] != 'none'))
{
$product_query = tep_db_query("select products_image_xl_4 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_xl_4'] != $HTTP_POST_VARS['products_image_xl_4'])
{
// images categories
$sql_data_array['products_image_xl_4'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_4']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_sm_5']) && tep_not_null($HTTP_POST_VARS['products_image_sm_5']) && ($HTTP_POST_VARS['products_image_sm_5'] != 'none'))
{
$product_query = tep_db_query("select products_image_sm_5 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_sm_5'] != $HTTP_POST_VARS['products_image_sm_5'])
{
// images categories
$sql_data_array['products_image_sm_5'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_5']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_xl_5']) && tep_not_null($HTTP_POST_VARS['products_image_xl_5']) && ($HTTP_POST_VARS['products_image_xl_5'] != 'none'))
{
$product_query = tep_db_query("select products_image_xl_5 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_xl_5'] != $HTTP_POST_VARS['products_image_xl_5'])
{
// images categories
$sql_data_array['products_image_xl_5'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_5']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_sm_6']) && tep_not_null($HTTP_POST_VARS['products_image_sm_6']) && ($HTTP_POST_VARS['products_image_sm_6'] != 'none'))
{
$product_query = tep_db_query("select products_image_sm_6 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_sm_6'] != $HTTP_POST_VARS['products_image_sm_6'])
{
// images categories
$sql_data_array['products_image_sm_6'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_sm_6']);
// eof images categories
}
}
if (isset($HTTP_POST_VARS['products_image_xl_6']) && tep_not_null($HTTP_POST_VARS['products_image_xl_6']) && ($HTTP_POST_VARS['products_image_xl_6'] != 'none'))
{
$product_query = tep_db_query("select products_image_xl_6 from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$product = tep_db_fetch_array($product_query);
// Check if image path is already in the DB
if ($product['products_image_xl_6'] != $HTTP_POST_VARS['products_image_xl_6'])
{
// images categories
$sql_data_array['products_image_xl_6'] = tep_output_generated_category_path_fs($current_category_id) . tep_db_prepare_input($HTTP_POST_VARS['products_image_xl_6']);
// eof images categories
}
}


... et remplacez ...

Code
      case 'new_product_preview':
// copy image only if modified
        $products_image = new upload('products_image');
// images categories
        $prod_path = $HTTP_GET_VARS['cPath'];
        $lchar = strrpos($prod_path, '_');
        if ($lchar + 1 == 1) {
        $lachar = 0;
        } else {
        $lachar = $lchar + 1;
        }
        $prod_path_id = substr($prod_path, $lachar);
        $prod_folder = tep_output_generated_category_path_fs($prod_path_id);
        $products_image->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
// eof images categories
        if ($products_image->parse() && $products_image->save()) {
          $products_image_name =$products_image->filename;
        } else {
          $products_image_name = $HTTP_POST_VARS['products_previous_image'];
        }
       break;


... par ...

Code
      case 'new_product_preview':
// copy image only if modified
        $products_image = new upload('products_image');
// images categories
        $prod_path = $HTTP_GET_VARS['cPath'];
        $lchar = strrpos($prod_path, '_');
        if ($lchar + 1 == 1) {
        $lachar = 0;
        } else {
        $lachar = $lchar + 1;
        }
        $prod_path_id = substr($prod_path, $lachar);
        $prod_folder = tep_output_generated_category_path_fs($prod_path_id);
        $products_image->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
// eof images categories
        if ($products_image->parse() && $products_image->save()) {
          $products_image_name =$products_image->filename;
        } else {
          $products_image_name = $HTTP_POST_VARS['products_previous_image'];
        }
// copy image_med  only if modified
$products_image_med = new upload('products_image_med');
$products_image_med->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_med->parse() && $products_image_med->save()) {
$products_image_med_name = $products_image_med->filename;
} else {
$products_image_med_name = $HTTP_POST_VARS['products_previous_image_med'];
}
// copy image_lrg  only if modified
$products_image_lrg = new upload('products_image_lrg');
$products_image_lrg->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_lrg->parse() && $products_image_lrg->save()) {
$products_image_lrg_name = $products_image_lrg->filename;
} else {
$products_image_lrg_name = $HTTP_POST_VARS['products_previous_image_lrg'];
}

// copy image_sm_1  only if modified
$products_image_sm_1 = new upload('products_image_sm_1');
$products_image_sm_1->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_sm_1->parse() && $products_image_sm_1->save()) {
$products_image_sm_1_name = $products_image_sm_1->filename;
} else {
$products_image_sm_1_name = $HTTP_POST_VARS['products_previous_image_sm_1'];
}
// copy image_xl_1  only if modified
$products_image_xl_1 = new upload('products_image_xl_1');
$products_image_xl_1->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_xl_1->parse() && $products_image_xl_1->save()) {
$products_image_xl_1_name = $products_image_xl_1->filename;
} else {
$products_image_xl_1_name = $HTTP_POST_VARS['products_previous_image_xl_1'];
}
// copy image_sm_2  only if modified
$products_image_sm_2 = new upload('products_image_sm_2');
$products_image_sm_2->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_sm_2->parse() && $products_image_sm_2->save()) {
$products_image_sm_2_name = $products_image_sm_2->filename;
} else {
$products_image_sm_2_name = $HTTP_POST_VARS['products_previous_image_sm_2'];
}
// copy image_xl_2  only if modified
$products_image_xl_2 = new upload('products_image_xl_2');
$products_image_xl_2->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_xl_2->parse() && $products_image_xl_2->save()) {
$products_image_xl_2_name = $products_image_xl_2->filename;
} else {
$products_image_xl_2_name = $HTTP_POST_VARS['products_previous_image_xl_2'];
}
// copy image_sm_3  only if modified
$products_image_sm_3 = new upload('products_image_sm_3');
$products_image_sm_3->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_sm_3->parse() && $products_image_sm_3->save()) {
$products_image_sm_3_name = $products_image_sm_3->filename;
} else {
$products_image_sm_3_name = $HTTP_POST_VARS['products_previous_image_sm_3'];
}
// copy image_xl_3  only if modified
$products_image_xl_3 = new upload('products_image_xl_3');
$products_image_xl_3->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_xl_3->parse() && $products_image_xl_3->save()) {
$products_image_xl_3_name = $products_image_xl_3->filename;
} else {
$products_image_xl_3_name = $HTTP_POST_VARS['products_previous_image_xl_3'];
}
// copy image_sm_4  only if modified
$products_image_sm_4 = new upload('products_image_sm_4');
$products_image_sm_4->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_sm_4->parse() && $products_image_sm_4->save()) {
$products_image_sm_4_name = $products_image_sm_4->filename;
} else {
$products_image_sm_4_name = $HTTP_POST_VARS['products_previous_image_sm_4'];
}
// copy image_xl_4  only if modified
$products_image_xl_4 = new upload('products_image_xl_4');
$products_image_xl_4->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_xl_4->parse() && $products_image_xl_4->save()) {
$products_image_xl_4_name = $products_image_xl_4->filename;
} else {
$products_image_xl_4_name = $HTTP_POST_VARS['products_previous_image_xl_4'];
}
// copy image_sm_5  only if modified
$products_image_sm_5 = new upload('products_image_sm_5');
$products_image_sm_5->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_sm_5->parse() && $products_image_sm_5->save()) {
$products_image_sm_5_name = $products_image_sm_5->filename;
} else {
$products_image_sm_5_name = $HTTP_POST_VARS['products_previous_image_sm_5'];
}
// copy image_xl_5  only if modified
$products_image_xl_5 = new upload('products_image_xl_5');
$products_image_xl_5->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_xl_5->parse() && $products_image_xl_5->save()) {
$products_image_xl_5_name = $products_image_xl_5->filename;
} else {
$products_image_xl_5_name = $HTTP_POST_VARS['products_previous_image_xl_5'];
}
// copy image_sm_6  only if modified
$products_image_sm_6 = new upload('products_image_sm_6');
$products_image_sm_6->set_destination(DIR_FS_CATALOG_IMAGES . $prod_folder);
if ($products_image_sm_6->parse() && $products_image_sm_6->save()) {
$products_image_sm_6_name = $products_image_sm_6->filename;
} else {
$products_image_sm_6_name = $HTTP_POST_VARS['products_previous_image_sm_6'];
}
// copy image_xl_6  only if modified
$products_image_xl_6 = new upload('products_image_xl_6');
$products_image_xl_6->set_destination(DIR_FS_CATALOG_IMAGES);
if ($products_image_xl_6->parse() && $products_image_xl_6->save()) {
$products_image_xl_6_name = $products_image_xl_6->filename;
} else {
$products_image_xl_6_name = $HTTP_POST_VARS['products_previous_image_xl_6'];
}
break;


Je suis disponible pour (essayer de) répondre aux questions des uns et des autres...

Bonne soirée !


--------------------
MS2.2 FR Traduction Delaballe + Contrib Checker + Discount Coupon Codes + Anti Spambot Tell a Friend + Search with DropDown Price Range + Product Name in Navigation Bar + Anti Robot Registration + Mail Validation + Autologon + Login Box + Contact Us Choice + Review Approval System + SoldOut but Displayed + QT Pro + Printer Friendly Product Page + Blacklist + Ultrapics 2.08 + LightBox + Country Based Shipping + Ultimate SEO URLS + Easy Populate + Categories Tree Builder + Manufacturers logo box + FAQ Desk + Automatic Thumbnail + OSC Center Shop + NewsDesk + Admin DHTMLMenu + DHTML Menu + Product Listing in Columns + Simple Down for Maintenance ...
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 28th March 2024 - 10:20
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)