Ver Mensaje Individual
  #9 (permalink)  
Antiguo 19/06/2009, 04:02
flatron666
 
Fecha de Ingreso: marzo-2009
Mensajes: 55
Antigüedad: 15 años, 1 mes
Puntos: 0
Respuesta: Abrir directamente

Les pongo el codigo completo, lo que quiero es quitar los print y que se me abra la imagen directamente.

<?php
require("./NewsSql.inc.php");
$db = new NewsSQL($DBName);
if ((!empty($PR)) && ($Rating>=1)){
$db->set_Rating($newsid,$Rating);
}
$result = $db->getnewsbyid($newsid);
$title = $result[0]["title"];
$content = $result[0]["content"];
$picture = $result[0]["picture"];
$picturepath = "./photo/";
$viewnum = $result[0]["viewnum"];
$sourceurl = $result[0]["sourceurl"];
$source = $result[0]["source"];
$adddate = $result[0]["adddate"];
$db->addhit($viewnum,$newsid);
$Rate = $result[0]["rating"];
$Rate1 = $Rate*10;
$Rate2 = ceil($Rate1);
$Rate = $Rate2/10;


$pre[0] = $newsid-1;

for ($i=1; $i<=$prenumber-1; $i++){
$pre[$i] = $pre[$i-1]-1;
}

$next[0] = $newsid+1;

for ($i=1; $i<=$nextnumber-1; $i++){
$next[$i] = $next[$i-1]+1;
}

?>
<html>
<head>
<title><?php print "$title"; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="style/style.css" type="text/css">

<script language="JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
</script>
<style type="text/css">
<!--
body {
background-color: transparent;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {
font-family: Geneva, Arial, Helvetica, sans-serif;
}
.rayitadebajo {
border-top-style: solid;
font-family: Arial, Helvetica, sans-serif;
border-top-width: thin;
border-top-color: #003333;
}
-->
</style>
</head>

<body text="#000000">
<table width="500" border="0" cellspacing="1" cellpadding="0" align="center" class="table_01">
<tr class="rayitadebajo">
<td width="594" valign="top" class="menu"><div align="left">
<?php
include("top.php3");
include_once("imageresize.class.php"); //para escalar

?>
</div></td>
</tr>
<tr class="rayitadebajo">
<td height="3" valign="top" class="rayitadebajo"><p align="justify"><span class="menu_in"><? print "$title"; ?></span></p> </td>
</tr>

<td colspan="2" align="center" valign="top" class="volver"><div align="center">
<table width="600" align="center" border="0" cellpadding="4" cellspacing="0">
<td align="center" valign="middle"></tr>

<?php
//comprobar imagen
$picture;
$imagen = explode(".",$picture);
$nombre = $imagen[0];
$extension = $imagen[1];
if($extension=="pdf"){
echo "";$mostrar='pdf.png';
}else{
$mostrar=$picture;
$source ="./photo/$mostrar"; // Escalado
$dest = 'tux_thumb.png'; // "
@unlink($dest); // "
$oResize = new ImageResize($source);// "
switch (width) {


case 'width':
$sTipo=sprintf("Por ancho:%d",400);

$oResize->resizeWidth(400);// cambiar aqui el ancho
break; // Fin de escalado



}
$oResize->save($dest);
}

// nuevo
$picture;
$imagen = explode(".",$picture);
$nombre = $imagen[0];
$extension = $imagen[1];
if($extension=="pdf"){

print "<tr>
<td align=\"center\"><a href=\"./$picturepath$picture \" target=\"_blank\"class=\"ninguna\"><align=\"center \"><img src=\"./photo/pdf.png\" border=\"0\"></a><br>";
}
else{
print "<tr>
<td align=\"center\"><a href=\"./$picturepath$picture \" target=\"_blank\"class=\"ninguna\"><align=\"center \"><img src=\"$dest\" border=\"0\"></a><br>";

}


//Rutina antigua

//if (!empty($picture)){

//print "<tr>
//<align=\"center\"><a href=\"./$picturepath$picture \" target=\"_blank\"class=\"ninguna\"><align=\"center \"><img src=\"$dest\" border=\"0\"></a><br>";

// }

if (!empty($content)){
$content = nl2br($content);
print "<tr>
<td class=\"texto\">$content</td>
</tr>";
}

if (!empty($sourceurl)){
print "<tr>
<td bgcolor=\"#F2F2F2\" class=\"fuente\">$front_source : $sourceurl</td>
</tr>
<tr>
<td><a href=\"$sourceurl\" class=\"fuente\" target=\"_blank\">$source</a></td>
</tr>";
}
else {
if (!empty($source)){
print "<tr>
<td bgcolor=\"transparent\" class=\"fuente\">$front_source : $sourceurl$source

<td></td>
</tr>";
}
}

if (!empty($adddate)){

print "<tr>
<td bgcolor=\"transparent\" class=\"fecha\">$front_adddate : $adddate</td>
</tr>
<tr>
<td></td>
</tr>";
}

for ($i=0; $i<=$prenumber-1; $i++){
$prename[$i] = $db->getname($pre[$i]);
if (!empty($prename[$i])){
$prenotemptytag = true;
}
}
for ($i=0; $i<=$nextnumber-1; $i++){
$nextname[$i] = $db->getname($next[$i]);
if (!empty($nextname[$i])){
$nextnotemptytag = true;
}
}
if (($prenotemptytag)||($nextnotemptytag)){
print "<tr>
<td bgcolor=\"#F2F2F2\" class=\"menu_in\">$front_more ...</td>
</tr>
<tr>
<td>";
for ($i=0; $i<=$prenumber-1; $i++){
if (!empty($prename[$i])){
print "<a href=\"news.php?newsid=$pre[$i]\" class=\"en_b\">$prename[$i]</a><br>";
}
}

for ($i=0; $i<=$nextnumber-1; $i++){
if (!empty($nextname[$i])){
print "<a href=\"news.php?newsid=$next[$i]\" class=\"en_b\">$nextname[$i]</a><br>";
}
}
print "</td>
</tr>";
}

?>

</table>
</div></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>

Las lines rojas son las que tengo que sustituir para mostar la variable $picturepath$picture .
Gracias