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] Decalage colonne de droite avec BTS, Colonne de droite qui sort du tableau
PiXoU
posté 9 Oct 2004, 00:20
Message #1


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



Bonjour/Bonsoir,

Voilà, je dois faire un design sur OSCommerce pour un pote, j'ai installé la contrib BTS sur la 2.2 qui marche plutot bien, sauf que je me suis aperçu que j'ai un petit soucis que je n'arrive pas a regler et ça commence a me prendre le chou, donc je prefere vous demander de l'aide plutot que d'aller me pendre à mon banzaï ! J'ai bien cherché avec differents mots-clé a travers le forum, mais sans succés :/

Le probleme est que certaines fois, toute ma colonne de droite qui contient les box sort de mon tableau principal constituant mon design. Voici quelques pages en question pour que vous puissez comprendre le soucis :

http://www.westsideblog.com/boutik/index.php?cPath=22_24

http://www.westsideblog.com/boutik/advance...uette&x=14&y=11

Vous avez surement pu voir qu'il y avait un defaut ! (ou alors c'est que j'ai trouvé avant que vous arriviez sur la page, mais ça m'etonnerait fortement :/)

Donc voila, si vous avez des questions pour mieux cibler le probleme, je serai là et si vous avez des idées sur la provenance de ce "bug" je suis bien evidemment interessé.

Merci d'avance en tout cas, à ceux qui auront bien voulu me consacrer un peu de leur temps wink.gif


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
JeanLuc
posté 9 Oct 2004, 07:27
Message #2


2eme dan OSC
Icône de groupe

Groupe : Membres VIP
Messages : 3526
Inscrit : 12-June 03
Lieu : Montpellier
Membre no 1239



A tout hasard, vérifie que tu as unversion PHP compatible avec la MS2.
Voir cette page de la FAQ à ce sujet.

Bon code... wink.gif


--------------------
JeanLuc
Pour info: FAQ et doc pour MS1 - doc pour MS2
Go to the top of the page
 
fissiaux
posté 9 Oct 2004, 07:50
Message #3


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Déjà (dans le code généré, d'une des 2 pages données en exemple) :

45 balises ouvrante <table> et 46 fermantes </table> !!!

Plus grave (et cela explique le décalage) :

64 balises ouvrantes <tr> et 65 fermantes </tr>

Allez ne soyons pas avares

85 balises ouvrantes <td> et 86 fermantes </td>



Tu auras compris d'où vient ton problème.
Go to the top of the page
 
PiXoU
posté 9 Oct 2004, 15:37
Message #4


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



Merci pour vos reponses wink.gif

Mais le truc c'est que je ne modifie que quelques fichiers "main_page.tpl.php" "box.tpl.php" et la feuille de style.

Dans la page principale, j'ai fait un nettoyage de code, rien n'a été signalé. Il se trouve que tout le site fonctionne bien sauf quelques pages comme mentionné ci-dessus. Je me demande si c'est pas qd OSC genere la page qu'il y a une balise qui se tape l'incruste ?

sad.gif


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 9 Oct 2004, 18:50
Message #5


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Pour les pages qui ne focntionnent pas, regarde dans leur fichier équivalent sous catalog/templates/nom_template/content.

Dans ces fichier tpl.php, tu dois avoir le décalage ici.
Go to the top of the page
 
PiXoU
posté 9 Oct 2004, 20:15
Message #6


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



J'ai deja regardé sur le fichier "advanced_search_result.tpl.php", je ne trouve rien d'anormal et pour l'index, je dois chercher dans quoi vu qu'il fait appel a "path" ?


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 9 Oct 2004, 20:26
Message #7


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669



Pour l'index, il y a 3 fichier dans content :

index_default, c'est la page d'accueil
index_nested, c'est la page intermédiaire où il n'affiche que les sous catégories
index_products, c'est la page où il affiche le listing des produits.


donc dans ton cas, c'est ce dernier fichier.
Go to the top of the page
 
fissiaux
posté 9 Oct 2004, 20:36
Message #8


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Affiche nous le contenu de index_products.tpl.php
Go to the top of the page
 
PiXoU
posté 9 Oct 2004, 22:01
Message #9


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



Voilà ce qu'il y a (j'ai pas encore regardé dans ce fichier)

CODE
<table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><h1><?php echo HEADING_TITLE; ?></h1></td>
<?php
// optional Product List Filter
   if (PRODUCT_LIST_FILTER > 0) {
     if (isset($HTTP_GET_VARS['manufacturers_id'])) {
       $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
     } else {
       $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
     }
     $filterlist_query = tep_db_query($filterlist_sql);
     if (tep_db_num_rows($filterlist_query) > 1) {
       echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . '&nbsp;';
       if (isset($HTTP_GET_VARS['manufacturers_id'])) {
         echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
         $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
       } else {
         echo tep_draw_hidden_field('cPath', $cPath);
         $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
       }
       echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
       while ($filterlist = tep_db_fetch_array($filterlist_query)) {
         $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
       }
       echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
       echo '</form></td>' . "\n";
     }
   }

// Get the right image for the top-right
   $image = DIR_WS_IMAGES . 'table_background_list.gif';
   if (isset($HTTP_GET_VARS['manufacturers_id'])) {
     $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['manufacturers_image'];
   } elseif ($current_category_id) {
     $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
     $image = tep_db_fetch_array($image);
     $image = $image['categories_image'];
   }
?>
           <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td>
     </tr>
   </table>


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 10 Oct 2004, 08:39
Message #10


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Ce fichier là est "bon", car il est équilibré sur le nombre de tags <table>, </table>.

L'erreur est ailleurs ....
Go to the top of the page
 
PiXoU
posté 10 Oct 2004, 14:36
Message #11


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



Je ne vois pas trop dans quoi je peux chercher, surtout que l'index marche normalement qd il ne fait pas appel a "path".

Advanced_search_result quant à lui foire tout le temps, donc il faudrait que je trouve quel est le rapport entre l'index appelant path et lui.

Je vous affiche "advanced_search_result.tpl.php" :

CODE
 <table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><h1><?php echo HEADING_TITLE_2; ?></h1></td>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_browse.gif', HEADING_TITLE_2, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td>
<?php
// create column list
 $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                      'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                      'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                      'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                      'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                      'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                      'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                      'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 asort($define_list);

 $column_list = array();
 reset($define_list);
 while (list($key, $value) = each($define_list)) {
   if ($value > 0) $column_list[] = $key;
 }

 $select_column_list = '';

 for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
   switch ($column_list[$i]) {
     case 'PRODUCT_LIST_MODEL':
       $select_column_list .= 'p.products_model, ';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $select_column_list .= 'm.manufacturers_name, ';
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $select_column_list .= 'p.products_quantity, ';
       break;
     case 'PRODUCT_LIST_IMAGE':
       $select_column_list .= 'p.products_image, ';
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $select_column_list .= 'p.products_weight, ';
       break;
   }
 }

 $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $select_str .= ", SUM(tr.tax_rate) as tax_rate ";
 }

 $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   if (!tep_session_is_registered('customer_country_id')) {
     $customer_country_id = STORE_COUNTRY;
     $customer_zone_id = STORE_ZONE;
   }
   $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
 }

 $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";

 if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {
   if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) {
     $subcategories_array = array();
     tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);

     $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";

     for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
       $where_str .= " or p2c.categories_id = '" . (int)$subcategories_array[$i] . "'";
     }

     $where_str .= ")";
   } else {
     $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";
   }
 }

 if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
   $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
 }

 if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {
   $where_str .= " and (";
   for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) {
     switch ($search_keywords[$i]) {
       case '(':
       case ')':
       case 'and':
       case 'or':
         $where_str .= " " . $search_keywords[$i] . " ";
         break;
       default:
         $keyword = tep_db_prepare_input($search_keywords[$i]);
         $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
         if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
         $where_str .= ')';
         break;
     }
   }
   $where_str .= " )";
 }

 if (tep_not_null($dfrom)) {
   $where_str .= " and p.products_date_added >= '" . tep_date_raw($dfrom) . "'";
 }

 if (tep_not_null($dto)) {
   $where_str .= " and p.products_date_added <= '" . tep_date_raw($dto) . "'";
 }

 if (tep_not_null($pfrom)) {
   if ($currencies->is_set($currency)) {
     $rate = $currencies->get_value($currency);

     $pfrom = $pfrom / $rate;
   }
 }

 if (tep_not_null($pto)) {
   if (isset($rate)) {
     $pto = $pto / $rate;
   }
 }

 if (DISPLAY_PRICE_WITH_TAX == 'true') {
   if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) >= " . (double)$pfrom . ")";
   if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) * if(gz.geo_zone_id is null, 1, 1 + (tr.tax_rate / 100) ) <= " . (double)$pto . ")";
 } else {
   if ($pfrom > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) >= " . (double)$pfrom . ")";
   if ($pto > 0) $where_str .= " and (IF(s.status, s.specials_new_products_price, p.products_price) <= " . (double)$pto . ")";
 }

 if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
   $where_str .= " group by p.products_id, tr.tax_priority";
 }

 if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
   for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
     if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
       $HTTP_GET_VARS['sort'] = $i+1 . 'a';
       $order_str = ' order by pd.products_name';
       break;
     }
   }
 } else {
   $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
   $sort_order = substr($HTTP_GET_VARS['sort'], 1);
   $order_str = ' order by ';
   switch ($column_list[$sort_col-1]) {
     case 'PRODUCT_LIST_MODEL':
       $order_str .= "p.products_model " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_NAME':
       $order_str .= "pd.products_name " . ($sort_order == 'd' ? "desc" : "");
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $order_str .= "m.manufacturers_name " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $order_str .= "p.products_quantity " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_IMAGE':
       $order_str .= "pd.products_name";
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $order_str .= "p.products_weight " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
     case 'PRODUCT_LIST_PRICE':
       $order_str .= "final_price " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
       break;
   }
 }

 $listing_sql = $select_str . $from_str . $where_str . $order_str;

 require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
       </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(array('sort', 'page')), 'NONSSL', true, false) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
     </tr>
   </table>


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 10 Oct 2004, 15:11
Message #12


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Non, il est bon aussi.
Go to the top of the page
 
PiXoU
posté 10 Oct 2004, 15:25
Message #13


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



ARF, ben je suis perdu alors, je comprend pas, personne n'a deja eu ce probleme pourtant ?!

Si vous avez d'autres idées, je suis à l'ecoute ! cry.gif

Merci wink.gif


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 10 Oct 2004, 16:23
Message #14


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Cela fait une demi-heure que je me bats avec ton code généré.

Le point commun doit être

CODE
require(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);



En fait, c'est bien la colonne centrale qui merde.

Dans le code généré, il y a un trop :

CODE
   </td>
 </tr>
</table>
Go to the top of the page
 
PiXoU
posté 10 Oct 2004, 16:44
Message #15


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



Okay, merci de consacrer de ton temps pour moi, c'est vraiment cool wink.gif

Donc, je dois regarder dans quel page pour voir et modifier ce qui merde, dans product_listing ?


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 10 Oct 2004, 16:59
Message #16


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669




Regarde dans catalog/includes/modules/product_listing.php


Pour voir ce qui "merde", il faudrait que tu regardes les endroits où tu as fait des modifs. Si tu ne fais pas, sauvegarde ce fichier sous un autre nom et recopie ce ficher à partir soit de l'original, soit à partir d'une sauvegarde dans lequel il marchait.

Sinon, poste le contenu du fichier.
Go to the top of the page
 
PiXoU
posté 10 Oct 2004, 17:47
Message #17


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



Je n'ai pas touché à product_listing, si c'est ça dont tu parles.

Je viens de remettre la page "main_page.tpl.php" d'origine sur BTS et je rencontre toujours le meme probleme donc ça exclu ce que j'ai modifié en principal, à savoir la main page template.

J'affiche ci-dessous le code de "product_listing.php" :

CODE
<?php
/*
 $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
<table width="350" border="0" cellspacing="0">
 <tr>
   <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr>
         <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
         <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
       </tr>
     </table>
     <?php
 }

 $list_box_contents = array();

 for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
   switch ($column_list[$col]) {
     case 'PRODUCT_LIST_MODEL':
       $lc_text = TABLE_HEADING_MODEL;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_NAME':
       $lc_text = TABLE_HEADING_PRODUCTS;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_MANUFACTURER':
       $lc_text = TABLE_HEADING_MANUFACTURER;
       $lc_align = '';
       break;
     case 'PRODUCT_LIST_PRICE':
       $lc_text = TABLE_HEADING_PRICE;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_QUANTITY':
       $lc_text = TABLE_HEADING_QUANTITY;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_WEIGHT':
       $lc_text = TABLE_HEADING_WEIGHT;
       $lc_align = 'right';
       break;
     case 'PRODUCT_LIST_IMAGE':
       $lc_text = TABLE_HEADING_IMAGE;
       $lc_align = 'center';
       break;
     case 'PRODUCT_LIST_BUY_NOW':
       $lc_text = TABLE_HEADING_BUY_NOW;
       $lc_align = 'center';
       break;
   }

   if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) {
     $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);
   }

   $list_box_contents[0][] = array('align' => $lc_align,
                                   'params' => 'class="productListing-heading"',
                                   'text' => '&nbsp;' . $lc_text . '&nbsp;');
 }

 if ($listing_split->number_of_rows > 0) {
   $rows = 0;
   $listing_query = tep_db_query($listing_split->sql_query);
   while ($listing = tep_db_fetch_array($listing_query)) {
     $rows++;

     if (($rows/2) == floor($rows/2)) {
       $list_box_contents[] = array('params' => 'class="productListing-even"');
     } else {
       $list_box_contents[] = array('params' => 'class="productListing-odd"');
     }

     $cur_row = sizeof($list_box_contents) - 1;

     for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
       $lc_align = '';

       switch ($column_list[$col]) {
         case 'PRODUCT_LIST_MODEL':
           $lc_align = '';
           $lc_text = '&nbsp;' . $listing['products_model'] . '&nbsp;';
           break;
         case 'PRODUCT_LIST_NAME':
           $lc_align = '';
           if (isset($HTTP_GET_VARS['manufacturers_id'])) {
             $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
           } else {
             $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>&nbsp;';
           }
           break;
         case 'PRODUCT_LIST_MANUFACTURER':
           $lc_align = '';
           $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a>&nbsp;';
           break;
         case 'PRODUCT_LIST_PRICE':
           $lc_align = 'right';
           if (tep_not_null($listing['specials_new_products_price'])) {
             $lc_text = '&nbsp;<s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>&nbsp;&nbsp;<span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>&nbsp;';
           } else {
             $lc_text = '&nbsp;' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '&nbsp;';
           }
           break;
         case 'PRODUCT_LIST_QUANTITY':
           $lc_align = 'right';
           $lc_text = '&nbsp;' . $listing['products_quantity'] . '&nbsp;';
           break;
         case 'PRODUCT_LIST_WEIGHT':
           $lc_align = 'right';
           $lc_text = '&nbsp;' . $listing['products_weight'] . '&nbsp;';
           break;
         case 'PRODUCT_LIST_IMAGE':
           $lc_align = 'center';
           if (isset($HTTP_GET_VARS['manufacturers_id'])) {
             $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';
           } else {
             $lc_text = '&nbsp;<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>&nbsp;';
           }
           break;
         case 'PRODUCT_LIST_BUY_NOW':
           $lc_align = 'center';
           $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a>&nbsp;';
           break;
       }

       $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
     }
   }

   new productListingBox($list_box_contents);
 } else {
   $list_box_contents = array();

   $list_box_contents[0] = array('params' => 'class="productListing-odd"');
   $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                  'text' => TEXT_NO_PRODUCTS);

   new productListingBox($list_box_contents);
 }

 if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
?>
     <table border="0" width="100%" cellspacing="0" cellpadding="2">
       <tr>
         <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
         <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
       </tr>
     </table>
     <?php
 }
?>
   </td>
 </tr>
</table>


--------------------
MS2 FR Avec la contibution BTS
Go to the top of the page
 
fissiaux
posté 10 Oct 2004, 17:52
Message #18


5eme dan OSC
Icône de groupe

Groupe : Membres
Messages : 17048
Inscrit : 26-November 03
Lieu : Chez moi
Membre no 1669





Enlèves les 3 dernières lignes :

CODE
  </td>
</tr>
</table>



biggrin.gif
Go to the top of the page
 
PiXoU
posté 10 Oct 2004, 18:14
Message #19


Ceinture blanche OSC
Icône de groupe

Groupe : Membres
Messages : 19
Inscrit : 8-October 04
Membre no 3452



OHHHHHHHHHHHHHHHHHHHH YES !

Merci Fissiaux, mais pourtant j'avais bien fait un nettoyage HTML et aucune balise en trop n'avait été detectée !! J'avais pas fait gaffe à ça confused.gif

Merci beaucoup Fissiaux d'avoir pris de ton temps, si je peux t'aider en retour, ça sera avec plaisir !

"Probleme" résolu !


--------------------
MS2 FR Avec la contibution BTS
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 : 24th May 2013 - 15:25
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)