Thanks for your reply. My PHP code is below.
PHP Code:
<?php
$lateststatusupdates = sql_query("SELECT tv_userstatus.id, tv_userstatus.status_username, tv_userstatus.profile_status, tv_userstatus.profile_status_time
FROM tv_userstatus, db_buddies
WHERE db_buddies.buddy_username = '".$_COOKIE['session_username']."'
AND db_buddies.buddy_buddy = tv_userstatus.status_username
AND tv_userstatus.profile_status != ''
ORDER BY tv_userstatus.profile_status_time DESC LIMIT 6");
if (mysql_num_rows($lateststatusupdates) == 0) {
echo '<tr>
<td>'.$lang['area_buddies_status_updates_none'].'</td>
</tr>';
} else {
while ($statusupdates = mysql_fetch_array($lateststatusupdates)) {
$a = '1';
echo '<tr>
<td rowspan="0" width="30" valign="top"><img src="'.user_picture($statusupdates['status_username'], 'thumb').'" width="30" height="30" class="picture_border" /></td>
<td valign="top"><a href="'.SITEPROFILEURL.$statusupdates['username'].'" class="text_9_css"><strong><u>'.$statusupdates['status_username'].'</u></strong></a> '.$statusupdates['profile_status'].' <div style="font-size:8pt; color: #707070;">'.return_date($statusupdates['profile_status_time'], 'profile').'</div>
<a href="#" onclick="toggle(\'diV\')">Show/hide</a>
<div id="diV">
<form action="area.php" method="post">
<input type="hidden" name="statusid" value="'.$statusupdates['id'].'" />
<input type="text" name="comment" style="width:180px; height:50px;" />
<input type="submit" value="comment" />
</form>
';
$commentlist = sql_query("SELECT * FROM tv_statuscomment WHERE status_id = '".$statusupdates[id]."' ORDER BY comment_time DESC") or die(mysql_error());
while ($statuscomment = mysql_fetch_array($commentlist)) {
echo '
<div style="padding:3px; margin-bottom:5px; background: #ffffe5; border: 1px solid #e0e0e0;"><table width="" border="0" cellpadding="0">
<tr><td valign="top">
<img src="'.user_picture($statuscomment['commenter'], 'thumb').'" width="30" height="30" class="picture_border" />
</td><td style="" valign="top">
<div style="font-size:8pt; color: #707070;">
<a href="'.SITEPROFILEURL.$statuscomment['commenter'].'" class="text_9_css">'.$statuscomment['commenter'].'</a> - '.return_date($statuscomment['comment_time'], 'date').'</div><div style="font-size:8pt; color: #707070;">
'.$statuscomment['comment'].'</div>
</td></tr></table></div></div>';
}
}
}
?>
Bookmarks