Diritto di replica tipo facebook o twitter

searedone

Utente Attivo
11 Giu 2010
508
0
0
diritto di replica ai post degli utenti :)

chi mi sa dire come posso dare il diritto di replica ad un post tipo facebook twitter ecc ecc ... bacheca degli amici ...

PHP:
<?php 
include 'dbc.php';
page_protect();


?>
<html>
<head>
<title>My Account</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="styles.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr> 
    <td width="160" valign="top">
<?php 
/*********************** MYACCOUNT MENU ****************************
This code shows my account menu only to logged in users. 
Copy this code till END and place it in a new html or php where
you want to show myaccount options. This is only visible to logged in users
*******************************************************************/
if (isset($_SESSION['user_id'])) {?>
<div class="myaccount">
  <p><strong>My Account</strong></p>
  <a href="myaccount.php">My Account</a><br>
  <a href="mysettings.php">Settings</a><br>
    <a href="logout.php">Logout </a>
	
  <p>You can add more links here for users</p></div>
<?php }
if (checkAdmin()) {
/*******************************END**************************/
?>
      <p> <a href="admin.php">Admin CP </a></p>
	  <?php } ?>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p></td>
    <td width="732" valign="top"><p>&nbsp;</p>
      <h3 class="titlehdr">Welcome <?php echo $_SESSION['user_name'];?></h3>  
	  <?php	
      if (isset($_GET['msg'])) {
	  echo "<div class=\"error\">$_GET[msg]</div>";
	  }
	  	  
	  ?>
      <p>This is the my account page</p>
      

  
   <?php echo $_SESSION[''];?>

<br />
<br />
<br />
 <?php
 echo $_SESSION['user_id'];  
require ("db_connect.php"); 


if(isset($_POST['submit'])){//****verifico se è stato premuto il submit 
    $commento=$_POST["commento"];   
    $commento=ereg_replace("\n","<br>",$commento); //ereg_replace (come tutti gli ereg) è deprecato usa preg_replace   
    if(get_magic_quotes_gpc()) { 
        $commento=stripslashes($commento);    
    }    
    $commento =mysql_real_escape_string($commento);    
    $insert = mysql_query("INSERT INTO annunci SET  commento='$commento', user_id=".$_SESSION['user_id']."");    
}//fine if submit - penso che dovrebbe finire qui, comunque alla fine di tutte le azioni che sosno "azionate" dal form 
?>     
	 
 <div class="content">
    <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
     
      <p>
        <label for="commento"></label>
        <textarea name="commento" id="commento" cols="55" rows="20"></textarea>
      </p>
      <p>
        <input type="submit" name="submit" id="submit" value="Invia Commento" />
      </p>
    </form>
    </div>
    

<?php

$id_u=$_SESSION['user_id'];  
$query = "SELECT * FROM annunci AS p WHERE p.user_id = '$id_u' OR p.user_id IN (SELECT user_1 FROM relationship AS r WHERE r.user_2 = '$id_u' AND r.amico = 'S') OR p.user_id IN (SELECT user_2 FROM relationship AS r WHERE r.user_1 = '$id_u' AND r.amico = 'S')";  
 
$ris=mysql_query($query);//*******!!!!!!!!!!!!*******non vedo questa istruzione 
   
while ($joke = mysql_fetch_array($ris)) {
$rich=$joke['user_id']; 
            $query_ut=mysql_query("SELECT * FROM users WHERE id=$rich");//non so come si chiama esattamente il campo id in user 
            //verifica e correggi eventualmente 
            $joke_ut=mysql_fetch_array($query_ut); 

$user_id = $joke_ut['user_id'];   
$user_name = $joke['user_name'];
$commento = $joke['commento'];


 echo "<a href=\"profile.php?id=$rich\">".$joke_ut['user_name']."</a><br />";
 
 
 echo "$commento<br /><br />"; 
 
 } 


?>

	 
 


      </td>
    <td width="196" valign="top">&nbsp;</td>
  </tr>
  <tr> 
    <td colspan="3">&nbsp;</td>
  </tr>
</table>

</body>
</html>
 
Siiiii

questo sarebbe il massimo ....

Ma ho visto che costa 19$ dollari

Non è possibile ricreare qualcosa di simile partendo dal mio script ???
 
ha scordavo per download devi registrarti alle newsletter solo che dopo ti manda all'indirizzo di box.net etc..

Se voi iscriviti che tanto ci son tanti tutorial nuovi che ti mandano via email...

ciao.
 
Giusto Alex..

Nulla togliere alle risposte gentili dei navigatori, ma la tua risposta è corretta...

vuoi mettere la soddisfazione di farlo da solo ...

qualcuno puo' darmi una mano .... ???
 

Discussioni simili