Ver Mensaje Individual
  #7 (permalink)  
Antiguo 05/07/2008, 07:05
isralusky
 
Fecha de Ingreso: julio-2008
Mensajes: 12
Antigüedad: 15 años, 10 meses
Puntos: 0
Una imagen u otra

Dentro de un sistema de noticias con comentarios.
Quisiera que al escribir un comentario saliera una imagen u otra

El código de la página es el siguiente

Cita:
<body link="#000000" vlink="#000000" alink="#000000" style="background-image: url('http://images.habbos.es/rebound/bkg.png')">

<table height="2" cellSpacing="0" cellPadding="0" width="430" align="center">
</table>
<table height="49" cellSpacing="0" cellPadding="0" width="425" align="center">
<tr>
<td width="430" height="11">
<table height="45" cellSpacing="0" cellPadding="0" width="434" align="center">
<tr>
<td width="432" height="1" class="content_box"><?php
$noticias="on";
$limite="15";
if($_GET[comentarios]=="ver" or $_GET[comentarios]=="a&ntilde;adir"){
$limite="1";
}
include("admin/conectar_n.php");
$query=mysql_query("SELECT * FROM noticias WHERE id='$_GET[idn]' order by id desc limit $limite");
$prueba=mysql_num_rows($query);
if($prueba=="0"){
$query=mysql_query("SELECT * FROM noticias order by id desc limit $limite");
}
while($rows=mysql_fetch_array($query)){
$query_c=mysql_query("SELECT * FROM comentarios WHERE idn='$rows[id]'");
$num=mysql_num_rows($query_c);
?>
<table width="430" height="117" align="center" cellpadding="0" cellspacing="0">
<tr>
<td class="content_box" height="11">
<img src="http://www.habbos.es/images/menus/red_head.png" width="430" height="11"></img></td>
</tr>
<tr>
<td background="http://www.habbos.es/images/menus/red_middle.png" class="content" height="86"><font class="topnews_u"><?php echo"".$rows[title]."";?></font>
<?php if($rows[image]=="http://" or ""){
echo'<img src=Leer_platz_klein.gif align="right"/>';
}else{
echo'<img src='.$rows[image].' align="right"/>';
}?>
<div align="left" class="copy"><?php echo"".$rows[tema]."";?></div>
<br />
<?php echo"".$rows[notice]."";?><br />
<br />
Escrito por: <?php echo"".$rows[user]."";?><?php echo"<a href=?comentarios=anadir&idn=".$rows[id]."> Comentarios</a>";?>(<?php echo"".$num."";?>) <?php echo"<a href=?comentarios=anadir&idn=".$rows[id].">A&ntilde;adir</a>";?> </td>
</tr>
<tr>
<td>
<img src="http://www.habbos.es/images/menus/red_bottom.png" width="430" height="17" />
<br></td>
</tr>
</table>
<span class="content">
<?php
}if($_GET[comentarios]=="anadir"){
?>
</span>
<table width="432" height="117" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="430" height="11">
<img src="http://www.habbos.es/images/menus/grey_head.png" width="430" height="11" /></td>
</tr>
<tr>
<td background="http://www.habbos.es/images/menus/grey_middle.png" class="content" height="54"><table width="391" border="00" align="center" cellpadding="0" cellspacing="0" class="Stil1">
<tr>
<td width="391" height="36"><br>
<?php
while($rows_c=mysql_fetch_array($query_c)){
$query7=mysql_query("SELECT * FROM comentarios WHERE idn='$_GET[idn]'");
if(mysql_num_rows($query7)=="0"){
echo("<b>No hay comentarios aun en esta noticia, <a href=?comentarios=a&ntilde;adir&id=".$rows[id]."pon el primero!");
}else{
if($_COOKIE[nick]==".SeWe." or $_COOKIE[nick]=="chimechu" or $_COOKIE[nick]=="::vn::" or $_COOKIE[nick]=="Trambel." or $_COOKIE[nick]=="cj256" or $_COOKIE[nick]=="::lob::" or $_COOKIE[nick]==".:.uron.:." or $_COOKIE[nick]=="-:-aherre16-:-"){
echo("<a href=borrar_coment23492040587163fkfoasdunqwo123.ph p?id=".$rows_c[id].">Borrar comentario</a> IP:".$rows_c[ip]."<br>");
}
echo("<b>");

Aquí mostrar la imagen


echo ereg_replace( "<", "&lt;", $rows_c[usuario] );
echo(":&nbsp;</b>");?><?php echo ereg_replace( "<", "&lt; &nbsp;" , $rows_c[comentario] );?><?php echo(" ".$rows_c[fecha]."<br><br>");}?>
<?php
}?></td>
</tr>
</table>
<table width="393" border="00" align="center" cellpadding="0" cellspacing="0" class="Stil1">
<tr>
<td width="413" height="36"><div align="center">
<form action="procesar_nuevo_comentario.php" method="post">

<input type="hidden" value=<?php echo($_SERVER[REMOTE_ADDR]);?> name="ip">
<hr>
<p align="left"><strong>Fecha:</strong>
<?php $date=date("d-m-Y");
echo"".$date."";?><br>
<strong>ID:</strong>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input name="idn" type="text" readonly="" class="Stil1" id="idn2"value="<?php echo "".$_GET[idn]."";?>" size="5">
<br>
<strong>Autor:</strong>
<?php
if($_COOKIE['nick']){
echo'<input readonly="" name="autor" type="text" value="'.$_COOKIE['nick'].'" class="Stil1">';
}else{
$us="invi";
echo'<input readonly="" name="autor" type="text" value="Invitad@" class="Stil1">';
}
?>
<br>
<strong>Comentario:</strong>
<input name="comentario" type="text"<?php if($us=="invi"){
echo "disabled='disabled'"; }?> class="Stil1" value="" size="50" maxlength="200">
<br></p>

<input name="Submit" <?php if($us=="invi"){
echo "disabled='disabled'"; }?>type="submit" class="Stil1" value="Enviar">
</p>
</form>
</div><br>
<center><?
if($us=="invi"){
echo("Sólo puedes publicar comentarios si estás registrado.");
}
?></center>
</td>
</tr>
</table> </tr>
<tr>
<td>
<img src="http://www.habbos.es/images/menus/grey_bottom.png" width="430" height="17" /></td>
</tr>
</table>
<?php
}?>
<p></td>
</tr>
</table>
<table height="2" cellSpacing="0" cellPadding="0" width="430" align="center">
</table> </td>
</tr>
</table></td>

</body>

Donde pone la imagen e intentado insertar este código

Cita:
if($_COOKIE['nick']==""){
echo('<img src="http://www.miwe/img/nonik.gif">');
}else{
echo('<img src="http://www.miweb.es/imaging/avatarimage?size=s&user='.$_COOKIE['nick'].'>');}
Pero simplemente me detecta la primera. Sin funcionar la otra.


Espero que me podaís ayudar