Ver Mensaje Individual
  #10 (permalink)  
Antiguo 02/05/2011, 15:21
Avatar de saraivaruas
saraivaruas
 
Fecha de Ingreso: octubre-2010
Ubicación: Chile
Mensajes: 133
Antigüedad: 13 años, 7 meses
Puntos: 10
Respuesta: Aporte sistema de mensajeria interna con usuarios conectados

aqui podremos ver los mensajes que tendremos en nuestro buzon de entrada. Y cliqueando en el nobre del mensaje lo podremos leer.

mensajes_recibidos.php

Código PHP:
Ver original
  1. <?php
  2. require("config.php");
  3. $nickUsuarioL= $_SESSION['nick'];
  4. $accion= $_POST['accion'];
  5.  
  6.   //conexion a la BD MYSQL
  7. if($accion == "borrar"){
  8.  
  9. require("config.php");
  10.  
  11. $SQLborrar = "DELETE FROM mensajes WHERE msgid IN(".implode(', ', $_POST['mens']).")";  
  12. mysql_query($SQLborrar);
  13.  
  14. echo "<font face=\"Tahoma\" size=\"2\"><b>Mensaje Borrado</b>";
  15.  
  16. } else {
  17.  
  18. $sql= mysql_query("SELECT * FROM mensajes WHERE para = '".mysql_real_escape_string($nickUsuarioL)."' ORDER by msgid DESC"); //aki esta la var del sistema de JLMM
  19.  
  20. while ($row = mysql_fetch_array($sql) ){
  21.  
  22. $asunte = $row['asunto'];
  23. $resto = substr("$asunte", 0, 40);
  24. $aydi = $row['msgid'];
  25.  
  26. ?><body bgcolor="#C0C000">
  27. <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" name="2">
  28. <table width="391" border="1" cellpadding="0" cellspacing="0" bordercolor="#498551" bgcolor="#C0C000">
  29. <tr>
  30. <td bgcolor="#C0C000" width="48">
  31.   <div align="center"><font face="Tahoma" size="1">
  32.     <input type="checkbox" name="mens[]" value="<?php echo $aydi; ?>">
  33.   </font></div></td>
  34. <td width="82" bgcolor="#C0C000"><font face="Tahoma" color="black" size="1">
  35. <center><i><?php echo $row["de"]; ?></i></center>
  36. </font></td>
  37. <td width="120" bgcolor=#C0C000>
  38.   <div align="center"><a href="leer_mensajes.php<?php echo '?id= '.$row['msgid'] . ''; ?>" target="_parent">
  39.     <font face="Tahoma" color="black" size="1"><u><?php echo "$resto.."; ?></u></font></a></div></td>
  40. <td bgcolor="#C0C000" width="148"><div align="center"><font face="Tahoma" color="black" size="1"><?php echo $row["fecha"]; ?></font></div></td>
  41. </tr>
  42. </table>
  43. <?php
  44. }
  45. ?>
  46. <br>
  47. <table width="214" align="center" cellpadding="2" cellspacing="2" bgcolor="#C0C000">
  48.     <tr>
  49.     <td width="102"><input type="radio" name="accion" value="borrar"><font face="Tahoma" size="1"> Borrar</font></td>
  50.     <td width="20">
  51. </td>
  52.  
  53.     <td width="190"><input type="submit" value="Borrar"></td>
  54.     </tr>
  55. </table>
  56. </form>
  57.  
  58. <?php
  59. }
  60. ?>