Ver Mensaje Individual
  #3 (permalink)  
Antiguo 04/11/2008, 12:08
Dilema101
 
Fecha de Ingreso: junio-2007
Mensajes: 10
Antigüedad: 16 años, 10 meses
Puntos: 0
Respuesta: Error con un condicional y no se porque!

Ya, pero esque lineas mas arriba del codigo que he puesto ya viene el <?php abierto, y no veo lineas atras donde se cierra, solo se cierra posteriormente, pego parte del codigo para que lo veas,la zona marcada con asteriscos es donde tengo el problema, gracias!


<?php //aqui se abre como se puede veer
}
$info_box_contents = array();
$list_box_contents = array();
$my_row = 0;
$my_col = 0;

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'])) {
$p_name = $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 {
$p_name = $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';
}
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'])) {
$p_price = $lc_text = '<s>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>&nbsp; <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
} else {
$p_price = $lc_text = '<span class="productSpecialPrice">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span>';
}
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'])) {
$p_pic = '<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 {
$p_pic = '<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>';
}
break;
case 'PRODUCT_LIST_BUY_NOW':
$lc_align = 'center';
If ($listing['products_quantity']<>0){
}else{
$lc_text = tep_image_button('out_stock.gif', IMAGE_BUTTON_OUT_STOCK) . '&nbsp;';
}
break;
}

$product_query = tep_db_query("select products_description, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$product = tep_db_fetch_array($product_query);

$p_desc = substr(strip_tags($product['products_description']), 0, MAX_DESCR_1);
$p_id = $product['products_id'];
/* $list_box_contents[$cur_row][] = array('align' => $lc_align,
'params' => '',
'text' => $lc_text); */

}

$info_box_contents[$my_row][$my_col] = array('align' => 'center',
'params' => ' style="width:33%;"',
'text' => '<table cellpadding="0" cellspacing="1" border="0"><tr><td>
<table cellpadding="0" cellspacing="0" border="0" style="height:258px">
<tr>
<td style="height:55px; border:1px solid #fcf9f2; border-width:0 0 0 25px" class="vam">'.$p_name.'</td>
</tr>
<tr>
<td style="height:114px " class="pic" align="center">'.$p_pic.'</td>
</tr>
<tr>
<td style="height:27px; border:1px solid #fcf9f2; border-width:0 0 0 25px" class="vam">'.$p_price.'</td>
</tr>
<tr>
<td style="height:62px; border:1px solid #fcf9f2; border-width:0 0 0 15px" ><a href="' . tep_href_link('product_info.php?products_id='.$p_i d) . '">'.tep_image_button("button_details.gif").'</a><br><br style="line-height:2px">

************************************************** *************
if($listing['products_quantity']<>0) //linea 185
{ echo "<a href="'.tep_href_link("products_new.php","action=b uy_now&products_id=".$p_id).'">'.tep_image_button( 'button_add_to_cart1.gif').'</a></td>";
}else{
$lc_text = tep_image_button('out_stock.gif', IMAGE_BUTTON_OUT_STOCK) . '&'; }
************************************************** ***************
</tr>
</table></td></tr></table>');

$my_col ++;
if ($my_col > 2) {
$my_col = 0;
$my_row ++;
}
}

new contentBox($info_box_contents);
// new productListingBox($list_box_contents);
} else { ?>


Si el error fuera del echo marcaria la linea del echo, de todas formas ai lo e puesto para probarlo pero me sigue fallando, el problema sigue marcandolo en el if ponga lo k ponga en el echo. Gracias!