Foros del Web » Programando para Internet » PHP »

Error al recibir un parámetro

Estas en el tema de Error al recibir un parámetro en el foro de PHP en Foros del Web. Hola , resumo mi problema que no puedo mas son las 10:18 y aun no me acoste, tengo una plantilla de osscomerce, todo va de ...
  #1 (permalink)  
Antiguo 14/04/2008, 02:31
Avatar de elrindell  
Fecha de Ingreso: marzo-2008
Mensajes: 41
Antigüedad: 16 años
Puntos: 5
Error al recibir un parámetro

Hola , resumo mi problema que no puedo mas son las 10:18 y aun no me acoste,
tengo una plantilla de osscomerce, todo va de lujo es perfecta, pero cuando pincho en (OJO!!!!) : LA PRIMERA SUBCATEGORIA DE UNA CATEGORIA, ME LLEVA AL INDEX, y las siguiente (la segunda subcategoria) me lleva a la primera subcategoria) y asi sucesivamente, por dios como arreglo esto.

Aqui podeis ver lo que pasa pinchad en la primera subcategoria ya vereis.

NOta: no falla en la columa de la izquierda hay si estan bien los links, es la imagen y en el nombre encima de ella donde falla.

http://osc3.template-help.com/osc_18...ex.php?cPath=6

si a alguien se le ocurre algo por favor. le estaria muy agradecido

saludos y mil gracias.

Elrindell.

Última edición por elrindell; 14/04/2008 a las 03:09
  #2 (permalink)  
Antiguo 14/04/2008, 02:50
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Re: Ayuda por dios en PHP

mmm..... producto_info es el codigo o ke???

supongo ke la URL esta mal construida, simple.... ahora, solo Dios sabes como ubicarla...


Ome Teotl!
  #3 (permalink)  
Antiguo 14/04/2008, 03:21
Avatar de elrindell  
Fecha de Ingreso: marzo-2008
Mensajes: 41
Antigüedad: 16 años
Puntos: 5
Re: Ayuda por dios en PHP

lo de product_info.php era donde yo creia que estaba el fallo pero le he puesto otro de otra template y sigue igual

no se que hacer ya mas vueltas no le puedo dar
  #4 (permalink)  
Antiguo 14/04/2008, 03:36
Avatar de pateketrueke
Modernizr
 
Fecha de Ingreso: abril-2008
Ubicación: Mexihco-Tenochtitlan
Mensajes: 26.399
Antigüedad: 16 años
Puntos: 2534
Re: Ayuda por dios en PHP

Cita:
Iniciado por elrindell Ver Mensaje
lo de product_info.php era donde yo creia que estaba el fallo pero le he puesto otro de otra template y sigue igual

no se que hacer ya mas vueltas no le puedo dar
kiza debas decribir el codigo, o mas bien lo ke piensas ke falla en el... si no sabes, puedes poner el codigo ke krees ke fallo... o no?

porke asi de señas no hay entendimiento....
((ya ke lo ke vemos en la Web es el resultado del codigo, no su "codigo"))
  #5 (permalink)  
Antiguo 14/04/2008, 05:16
Avatar de elrindell  
Fecha de Ingreso: marzo-2008
Mensajes: 41
Antigüedad: 16 años
Puntos: 5
Re: Ayuda por dios en PHP

es que no se siquera de que modulo (de que archivo php) tendria que poner el codigo por que como tu sabes osscommerce tiene un monton de ellos, sabes lo malo? que hice toda la web y llevo mas de dos meses basandome en esa template y ahora falla esto, no me lo puedo creer,,,,

gracias por la ayuda que me podais

tengo dos templates mas una es casi igual y en esa funcionan bien las subcategoria,

index de que no falla;

<?php
if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);
?>
<td width="100%" class="col_center">


<? tep_draw_heading_top();?>

<? new contentBoxHeading_ProdNew($info_box_contents);?>

<? tep_draw_heading_top_1();?>



<table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product">
<tr>
<?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}

$number_of_categories = tep_db_num_rows($categories_query);

$rows = 0;
while ($categories = tep_db_fetch_array($categories_query)) {
$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
echo '

<td align="center" width="' . $width . '">
<table cellpadding="0" cellspacing="0" border="0" height:127px">
<tr>
<td align="center" class="pic2"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a><br>
<br style="line-height:9px"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a><br></td>
</tr>
</table>
</td>
' . "\n";
if ($col!=(MAX_DISPLAY_CATEGORIES_PER_ROW-1)){
echo '
<td>'.tep_draw_separator('spacer.gif', '1', '1').'</td>
';
}
else{

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
echo '
</tr><tr><td colspan="'.(MAX_DISPLAY_CATEGORIES_PER_ROW + MAX_DISPLAY_CATEGORIES_PER_ROW -1).'">'.tep_draw_separator('spacer.gif', '1', '10').'</td></tr>' . "\n";
echo ' <tr>' . "\n";
}
}
if ($col==MAX_DISPLAY_CATEGORIES_PER_ROW-1){
$col=0;
}else{
$col++;
}
}

y esta falla

?php
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}

$number_of_categories = tep_db_num_rows($categories_query);
$rows = 0;
while ($categories = tep_db_fetch_array($categories_query)) {

$p_pic_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>';

$p_name_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>';



$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
echo '

<td align="center" width="' . $width . '">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="height:16px " align="center" class="vam"><span>'.$p_name_sub.'</span></td>
</tr>
<tr>
<td style="height:95px " align="center" class="pic" >'.tep_draw_prod_pic_top().''.$p_pic_sub.''.tep_dr aw_prod_pic_bottom().'</td>
</tr>
</table>
</td>
' . "\n";
if ($col!=(MAX_DISPLAY_CATEGORIES_PER_ROW-1)){
echo '
<td class="bg_line_y">'.tep_draw_separator('spacer.gif ', '1', '1').'</td>
';
}
else{

if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
echo '
</tr><tr><td class="bg_line_x" colspan="'.(MAX_DISPLAY_CATEGORIES_PER_ROW + MAX_DISPLAY_CATEGORIES_PER_ROW -1).'">'.tep_draw_separator('spacer.gif', '1', '10').'</td></tr>' . "\n";
echo ' <tr>' . "\n";
}
}
if ($col==MAX_DISPLAY_CATEGORIES_PER_ROW-1){
$col=0;
}else{
$col++;
}
}


esas pequeñas diferencias que son , ¿por hay esta el eror?, gracias...necesito ayuda de verdad,

ekrindell

Última edición por elrindell; 14/04/2008 a las 10:55
  #6 (permalink)  
Antiguo 14/04/2008, 20:47
Avatar de elrindell  
Fecha de Ingreso: marzo-2008
Mensajes: 41
Antigüedad: 16 años
Puntos: 5
Re: Ayuda por dios en PHP

Gracias a todos los que hayan intentado ayudarme:

Ya lo he solucionado.

No tengo ni idea de php, pero una funcionaba y la otra no.

Sabiendo eso y comparando lo solucione.

Manolo.

estas lineas:

$p_pic_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>';

$p_name_sub = '<a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a>';



$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
echo '

Pedia lo que esta en rojo antes de declararlo creo que ese era el error, y sino es como yo pienso, por lo meno poniendolo delante funciona.

Saludos.

Elrindell.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:14.