-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfunctions.php
executable file
·44 lines (36 loc) · 1.08 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
if(!defined('INCLUDE_CHECK')) die('You are not allowed to execute this file directly');
function showComment($arr)
{
echo '
<div class="waveComment com-".$arr['id'].'">
<div class="comment">
<div class="waveTime">'.waveTime($arr['dt']).'</div>
<div class="commentAvatar">
<img src="img/'.strtolower($arr['usr']).'.png" width="30" height="30" alt="'.$arr['usr'].'"/>
</div>
<div class="commentText">
<span class="name">'.$arr['usr'].':</span> '.$arr['comment'].'
</div>
<div class="replyLink">
<a href="" onclick="addComment(this, '.$arr['id'].');return false;">add a reply »</a>
</div>
<div class="clear"></div>
</div>
//Output the comment, and it replies, if any
if($arr['replies'])
{
foreach($arr['replies'] as $r)
showComment($r);
}
echo '</div>';
}
function waveTime($t)
{
$t = strtotime($t);
if(date('d')==date('d',, $t)) return date('h:i A', $t);
return date('F jS Y h:i A', $t);
//If the comment was written today, output only the hour and minute
//if it was not, output a full date/time
}
?>