...

View Full Version : Making a comment box drop down on link click



fenhopi
11-11-2010, 03:05 PM
Hi.
So, I have this loop I run to retrieve wallposts with php. Within this loop, I want a link/button on every post that says "comment". When the user clicks the comment link I want a comment field and post button to appear on the post I clicked on. The problem is that when I've tried making a link that does this, it only drops down the comment field on the most recent wallpost regardless of which wallpost I click on.

I'd appreciate some help, a lot!

abduraooft
11-11-2010, 03:17 PM
So, I have this loop I run to retrieve wallposts with php. Where's your code?

connollyc4
11-11-2010, 04:02 PM
I want a link/button on every post that says "comment". When the user clicks the comment link I want a comment field and post button to appear on the post I clicked on

something like this?



<form name="myForm" id="form1" method="post">
<input type="text" name="comments" id="myText" value="Enter in Text" />
<input type="button" name="button" value="Hide Text Box"
onclick="document.getElementById('myText').style.visibility='hidden';"/>
<input type="button" name="button" value="Show Text Box"
onclick="document.getElementById('myText').style.visibility='visible';"/>
</form>

fenhopi
11-11-2010, 04:03 PM
$username = mysql_real_escape_string($_SESSION['username']);
$friend_statuses = "SELECT * FROM oodles WHERE byuser='$username' ORDER BY dtime DESC LIMIT 0, 10";


$result = $database->query($friend_statuses);



// Loop
While($myrow = mysql_fetch_array($result))
{
//VARS
$user = mysql_real_escape_string($myrow['byuser']);
$oodleid = mysql_real_escape_string($myrow['oodleid']);
//selecting who liked oodle


//Get his name
$findnamequery = "SELECT * FROM users WHERE username='$id'";
$connectfindname = $database->query($findnamequery);
$findname = mysql_fetch_array($connectfindname);


//Echoes
$oodle = $myrow['oodle'];
$oodlesecure = htmlentities($oodle);
?>
<table width="200" border="0">
<tr>
<td width="739">
<h2><a href="profile.php?user=<? echo $id; ?>"><img src="view.php?user=<? echo $id; ?>" width=55 height=40>
<? echo $findname['firstname']; ?> <? echo $findname['lastname']; ?></a>
<? echo $oodlesecure; ?> </h2>
</td>
</tr>


<?
}

}
?>
</td>
</tr>
<tr>
<td><? echo "Posted: " .$myrow['dtime']; ?></td>
</tr>
</table>

<?

}


Before the dtime, is where I'd like to put the comment option.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum