I've written the code below to access a db to retrieve comments and list them on a page. this is done within a scolling div layer with overflow=auto.
within this once a comment is displayed there is a comment link so people can reply... for some reason at the comment at the bottom of the list if you click on comment to reply instead of the scroll div expanding more to show it, it gets cut off.
here is my php code and for anyone that wants to look at exactly what i mean PM me so i can send you login details to view it
Expand|Select|Wrap|Line Numbers
- <? error_reporting(E_ALL);
- mysql_connect($hostname,$username,$password);
- @mysql_select_db($database) or die( "Unable to select database");
- $homeSQLA = "SELECT * FROM statusUpdates WHERE comOrigin = '{$userName}' AND comOrder = '1' ORDER BY dateAdded DESC";
- $homeRESA = mysql_query( $homeSQLA ) or die( mysql_error );
- if ( mysql_num_rows( $homeRESA ) > 0 ){
- while($originalPost = mysql_fetch_array($homeRESA)){
- $origun = $originalPost['userName'];
- $originalUserAV = "user/$origun/av/av.jpg";
- $originalUserAVsmall = "user/$origun/av/av_small.jpg";
- $jQuotes = "'";
- echo '<div style="width:440px; height:auto; overflow:visible">';
- echo '<table width="440" border="0" cellpadding="0" cellspacing="0">';
- echo '<tr>';
- echo '<td width="60" height="60" rowspan="4" valign="top"><img src="'.$originalUserAV .'" width="60" height="60" /></td>';
- echo '<td width="10" valign="top"> </td>';
- echo '<td width="355" height="18" valign="top" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; text-align:justify;" class="topBoxLINKS"><a href="profile.php?userName='.$originalPost['comOrigin'] .'">'.$originalPost['firstName'] .' '. $originalPost['lastName'] .'</a> <span style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:100; text-align:justify;">'.$originalPost['comment'] .'</span><br /><span style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; text-align:justify;">'.$originalPost['dateAdded'] .' - <a href="javascript:showhide('.$jQuotes.$originalPost['commentID'].$jQuotes .');"><span style="font-size:10px;">comment</span></a></span> </td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td width="10"> </td>';
- echo '<td height="auto" valign="top">';
- echo '<ul id="wall" style="width:300px; list-style-type:none; vertical-align:top; text-align:left; padding:-10px;">';
- $originComID = $originalPost['commentID'];
- $homeSQLB = "SELECT * FROM statusUpdates WHERE commentID = '{$originComID}' AND comOrder >= '2' ORDER BY dateAdded";
- $homeRESB = mysql_query( $homeSQLB ) or die( mysql_error );
- while($replyPosts = mysql_fetch_array($homeRESB))
- {
- echo '<li class="topBoxLINKS"><div style="position: relative; margin-bottom:-25px;"><div style="position: relative; height:40px; width:40px;background:url('.$replyPosts['userAV'].'); background-repeat:no-repeat; left:-40px; top:0px;"></div><div style="position: relative; height:auto; width:300px; left:10px; top:-46px;"><a href="profile.php?userName='.$replyPosts['userName'] .'">'.$replyPosts['firstName'] .' '. $replyPosts["lastName"] .'</a> <span style="left:10px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:100; text-align:justify;">'.$replyPosts['comment'] .'</span><br /><span style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; font-weight:bold; text-align:justify;">'.$replyPosts['dateAdded'] .'</span></div></div></li>';
- }
- echo '</ul></td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td width="10" style="height:1px;"> </td>';
- echo '<td>';
- echo '<div id="'.$originalPost['commentID'] .'" style="display:none;">';
- echo '<form action="process.php" id="form_'.$originalPost['commentID'] .'" method="POST">';
- echo '<span class="w">';
- echo '<div align="left"><textarea cols="45" name="commentC" id="commentC" class="input"></textarea></div>';
- echo '</span>';
- echo '<input type="hidden" name="userName" id="userName" value="'.$userName .'"/>';
- echo '<input type="hidden" name="userAV" id="userAV" value="'.$originalUserAVsmall .'"/>';
- echo '<input type="hidden" name="originID" id="originID" value="'.$originalPost['comOrigin'] .'"/>';
- echo '<input type="hidden" name="commentID" id="commentID" value="'.$originalPost['commentID'] .'"/>';
- echo '<input type="hidden" name="firstName" id="firstName" value="'.$firstName .'"/>';
- echo '<input type="hidden" name="lastName" id="lastName" value="'.$lastName .'"/>';
- echo '<input type="hidden" name="formLocation" id="formLocation" value="statusReply"/>';
- echo '<input type="hidden" name="returnURL" id="returnURL" value="'.$returnURL .'"/>';
- echo '<div align="right"><input type="submit" id="submit" value="Comment"/></div>';
- echo '</form>';
- echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- }
- } else {
- echo '<span style="text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold;">You currently have no news updates!</span>';
- }
- echo '<br/>';
- echo '<br/>';
- ?>