01.
<?php
02.
$comment_num_row
= mysql_num_rows(@
$comments
);
03.
if
(
$comment_num_row
> 0)
04.
{
05.
while
(
$rows
= mysql_fetch_array(
$comments
))
06.
{
07.
$days2
=
floor
(
$rows
[
'CommentTimeSpent'
] / (60 * 60 * 24));
08.
$remainder
=
$rows
[
'CommentTimeSpent'
] % (60 * 60 * 24);
09.
$hours
=
floor
(
$remainder
/ (60 * 60));
10.
$remainder
=
$remainder
% (60 * 60);
11.
$minutes
=
floor
(
$remainder
/ 60);
12.
$seconds
=
$remainder
% 60;
13.
?>
14.
<div
class
=
"commentPanel"
id=
"record-<?php echo $rows['c_id'];?>"
align=
"left"
>
15.
<img src=
"small.png"
width=
"40"
class
=
"CommentImg"
style=
"float:left;"
alt=
""
/>
16.
<label
class
=
"postedComments"
>
17.
<?php
echo
clickable_link(
$rows
[
'comments'
]);?>
18.
</label>
19.
<br clear=
"all"
/>
20.
<span style=
"margin-left:43px; color:#666666; font-size:11px"
>
21.
<?php
22.
23.
if
(
$days2
> 0)
24.
echo
date
(
'F d Y'
,
$rows
[
'date_created'
]);
25.
elseif
(
$days2
== 0 &&
$hours
== 0 &&
$minutes
== 0)
26.
echo
"few seconds ago"
;
27.
elseif
(
$days2
== 0 &&
$hours
== 0)
28.
echo
$minutes
.
' minutes ago'
;
29.
else
30.
echo
"few seconds ago"
;
31.
?>
32.
</span>
33.
<?php
34.
$userip
=
$_SERVER
[
'REMOTE_ADDR'
];
35.
if
(
$rows
[
'userip'
] ==
$userip
){?>
36.
<a href=
"#"
id=
"CID-<?php echo $rows['c_id'];?>"
class
=
"c_delete"
>
Delete
</a>
37.
<?php
38.
}?>
39.
</div>
40.
<?php
41.
}?>
42.
<?php
43.
}?>