Foros del Web » Programando para Internet » PHP »

phpthumb de PHP 5.2 a 5.3

Estas en el tema de phpthumb de PHP 5.2 a 5.3 en el foro de PHP en Foros del Web. Buenas! Estoy necesitando migrar de un servidor con PHP 5.2 a otro con PHP 5.3 y el phpThumb esta teniendo problemas La pagina con el ...
  #1 (permalink)  
Antiguo 25/04/2013, 10:11
 
Fecha de Ingreso: abril-2013
Mensajes: 3
Antigüedad: 11 años
Puntos: 0
phpthumb de PHP 5.2 a 5.3

Buenas!

Estoy necesitando migrar de un servidor con PHP 5.2 a otro con PHP 5.3 y el phpThumb esta teniendo problemas

La pagina con el problema es [URL="http://190.228.129.58/~cp01268/detalle.php?id=84585"]http://190.228.129.58/~cp01268/detalle.php?id=84585[/URL]

El parche violeta es el error y ahí debería aparecer la imagen. Me baje unos patchs que supuestamente arreglan el inconveniente de la versión 5.2 a 5.3, pero no pasa nada.

Les agradezco cualquier ayuda que puedan darme!
  #2 (permalink)  
Antiguo 25/04/2013, 13:35
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: phpthumb de PHP 5.2 a 5.3

No es problema de PHP, lee lo que dice la imagen: "Read usage comments for details".

Básicamente, no estás usando correctamente el script, muestra tu código y tal vez podamos saber qué pasa.
__________________
- León, Guanajuato
- GV-Foto
  #3 (permalink)  
Antiguo 26/04/2013, 10:23
 
Fecha de Ingreso: abril-2013
Mensajes: 3
Antigüedad: 11 años
Puntos: 0
Respuesta: phpthumb de PHP 5.2 a 5.3

Hola Triby, gracias por la buena predisposición

El código de la pagina donde sucede el error es el siguiente

Código HTML:
<?	include_once "include/config.inc.php";
	include_once "model/libros.php";

	$oLibro = new Libros($_REQUEST["id"]);

	?>

	<?

	if ($_POST) {
		// asunto
		$asunto = "Consulta sobre libro " . $_POST["titulo"];

		// mensaje
		$mensaje =  "Datos del libro:" . "<br><br>"; 

		$mensaje .= " T&iacute;tulo: " . $_POST["titulo"] . "<br>";
		$mensaje .= " Autor: " . $_POST["autor"] . "<br>";
		$mensaje .= " ISBN: " .	$_POST["isbn"] . "<br><br>";

		$mensaje .= " Comentario: " .	"<br>" ;
		$mensaje .= "&nbsp;&nbsp;&nbsp;" . $_POST["comentario"] . "<br>";
		
		$mensaje .=  "<br><br>" . "Datos de la persona que envi&oacute; el comentario:" . "<br><br>"; 
		
		$mensaje .= " Nombre: " .	$_POST["nombre"] . "<br>";
		$mensaje .= " Tel&eacute;fono: " . $_POST["telefono"] . "<br>";
		$mensaje .= " Email: " .	$_POST["email"] . "<br>";

		$cabeceras  = 'MIME-Version: 1.0' . "\r\n";
		$cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
		
		// Cabeceras adicionales
		$cabeceras .= 'To: ' . $_POST["nombre_dest"]  . ' <' . $_POST["email_dest"] . '>' . "\r\n";
		$cabeceras .= 'From: ' . $_POST["nombre"] . " " . $_POST["apellido"] . ' <'. $_POST["email"] .'>' . "\r\n";
		// Enviarlo
		
		$res = @mail( $_POST["nombre_dest"]  . ' <' . $_POST["email_dest"] . '>', $asunto, $mensaje, $cabeceras);

		if ($res) {
			
			$msg = "Su mensaje fue enviado con exito";
		
		} else {
			
			$msg = "Su mensaje no pudo ser enviado. Intente nuevamente";	
		}
	}
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Detalle del libro</title>
<link rel="stylesheet" title="Disabled for Preview-in-Browser: styles2.css" type="text/css" />
<style type="text/css">
<!--

.txt {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #006599;
	background-color: #FFFFFF;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}
.txtblan {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FFFFFF;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	font-weight: bold;
}
.txtblansb {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FFFFFF;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	font-weight: normal;
}
.txt11 {

	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	color: #FFFFFF;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	font-weight: normal;
}
body {
	margin-left: 0px;
	margin-top: 0px;
}


-->
</style>
<script type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


function enviar_mensaje() {

	document.frm_mensaje.submit();
	
	
}


//-->
</script>

</head>

<body>
<table width="365" height="359" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" background="img/detalle-fondo-top.jpg"><table width="365" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="18">&nbsp;</td>
        <td colspan="2">&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td width="129" class="txtblan" align="center">
        	
                        
            <? if(file_exists("catalogo/imagenes/" . $oLibro->isbn . ".jpg")) {?>
            
        	<img src="catalogo/backend/thumb/phpThumb.php?src=../../imagenes/<?=$oLibro->isbn?>.jpg&w=69" />
        
        	<? } else { ?>
        
        			Im&aacute;gen <br />
					no <br />
				    disponible
        
            <? } ?>
                    
        </td>
        <td width="218" valign="bottom"><table width="218" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="198" rowspan="2">&nbsp;</td>
            <td width="20">&nbsp;</td>
          </tr>
          <tr>
            <td height="15">&nbsp;</td>
          </tr>
          <tr>
            <td height="10" colspan="2"><img src="img/px-blan.jpg" width="190" height="1" /></td>
            </tr>
          <tr>
            <td class="txtblan"><?=$oLibro->titulo?></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td height="10" colspan="2"><img src="img/px-blan.jpg" width="190" height="1" /></td>
            </tr>
          <tr>
            <td class="txtblan"><?=$oLibro->autor?></td>
            <td>&nbsp;</td>
          </tr>
        </table>
          <table width="218" border="0" cellspacing="0" cellpadding="0">
          
          
          <tr>
            <td height="10" colspan="2"><img src="img/px-blan.jpg" width="190" height="1" /></td>
            </tr>
          <tr>
            <td width="57" class="txtblan">ISBN:</td>
            <td width="161" class="txtblansb"><?=$oLibro->isbn?></td>
          </tr>
          <tr>
            <td class="txtblan">Paginas:</td>
            <td class="txtblansb"><?=$oLibro->paginas?></td>
          </tr>
        </table></td>
      </tr>
    </table>
      <table width="365" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="15" colspan="3"><img src="img/px-azul.jpg" width="1" height="1" /></td>
        </tr>
        <tr>
          <td width="19">&nbsp;</td>
          <td width="325" class="txt11"><?=$oLibro->descripcion?></td>
          <td width="21">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="365" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="img/detalle-fondo-medio.jpg" width="365" height="28" /></td>
  </tr>
</table>

<table width="365" height="207" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top" background="img/detalle-fondo-footer.jpg">

	<form name="frm_mensaje" method="post" action="<?=$_SERVER['PHP_SELF']?>"> 
    
    <input type="hidden" name="nombre_dest" value="Libertador" />
    <input type="hidden" name="email_dest" value="[email protected]" />
    
    <input type="hidden" name="id" value="<?=$oLibro->id?>" />
    <input type="hidden" name="titulo" value="<?=$oLibro->titulo?>" />
    <input type="hidden" name="autor" value="<?=$oLibro->autor?>" />
    <input type="hidden" name="isbn" value="<?=$oLibro->isbn?>" />

    <table width="365" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" >&nbsp;</td>
        </tr>
      <tr>
        <td width="48">&nbsp;</td>
        <td width="63" class="txt11">Nombre:</td>
        <td width="254"><input name="nombre" type="text" class="txt" size="33" /></td>
      </tr>
      <tr>
        <td height="5" colspan="3"><img src="img/px-azul.jpg" width="1" height="1" /></td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td class="txt11">Tel&eacute;fono:</td>
        <td><input name="telefono" type="text" class="txt" size="33" /></td>
      </tr>
      <tr>
        <td height="5" colspan="3"><img src="img/px-azul.jpg" width="1" height="1" /></td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td class="txt11">Email:</td>
        <td><input name="email" type="text" class="txt" size="33" /></td>
      </tr>
      <tr>
        <td height="5" colspan="3"><img src="img/px-azul.jpg" width="1" height="1" /></td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td class="txt11">Comentario:</td>
        <td><textarea name="comentario" cols="35" rows="3" class="txt"></textarea></td>
      </tr>
    </table>

      <table width="365" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="26" colspan="2" class="txt11" align="center"><strong><?=$msg?></strong>&nbsp;</td>
        </tr>
        <tr>
          <td width="197" height="26">&nbsp;</td>
          <td width="168"><input type="image" name="imageField" src="img/detalle-boton-envio.jpg" style="cursor:pointer" onclick="javascript:enviar_mensaje();" /></td>
        </tr>
      </table>
	</form>      
     </td>
  </tr>
</table>

</body>
</html> 
Decime si llegas a necesitar el código de otro archivo. Gracias!
  #4 (permalink)  
Antiguo 26/04/2013, 16:42
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: phpthumb de PHP 5.2 a 5.3

Parece que a phpthumb no le gustan las rutas con ../ y prefiere rutas absolutas, del tipo /usuario/public_html/catalogo/imagenes/nombre-de-imagen.jpg
__________________
- León, Guanajuato
- GV-Foto
  #5 (permalink)  
Antiguo 29/04/2013, 10:06
 
Fecha de Ingreso: abril-2013
Mensajes: 3
Antigüedad: 11 años
Puntos: 0
Respuesta: phpthumb de PHP 5.2 a 5.3

Gracias por tu ayuda. Estuve probando pero no logro hacerlo funcionar.

Teniendo en cuenta tu comentario, hice lo siguiente:

Código HTML:
 <? if(file_exists("catalogo/imagenes/" . $oLibro->isbn . ".jpg")) {?>
            
        <img src="catalogo/backend/thumb/phpThumb.php?src=/cp01268/public_html/catalogo/imagenes/<?=$oLibro->isbn?>.jpg&w=69" /> 
El error es diferente, creo que es un tema de llamada a las ubicaciones, y no estoy consiguiendo hacer que se muestre la imagen de ninguna forma.

Te agradezco por cualquier ayuda que puedas darme, gracias!

Etiquetas: Ninguno
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 17:38.