-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathart.php
52 lines (52 loc) · 2.14 KB
/
art.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
45
46
47
48
49
50
51
52
<?session_start();
include"head.php";
$arsip='content/art.txt';
if($id){
$xfile=file($arsip);
for($x=0;$x<count($xfile);$x++)
{
$data = explode("|",$xfile[$x]);
if($id==$data[0])
{
echo "
<div class=\"list-group\">
<h4 class=\"list-group-item active\">
".ucfirst($data[4])."
</h4>
<a class=\"list-group-item\">".text($data[5])."
</a>
</div></a>
<span class=\"label label-default\"> Written by $data[3] on $data[1] at $data[2]</span> ";
if(session_is_registered('log')){
echo " <a class=\"label label-primary\" href=\"./edit.php?id=$data[0]\">Edit</a>
<a class=\"label label-danger\" href=\"./dels.php?del=entry&id=$data[0]\">Remove</a>";}
echo "<br></br>";
}}}
echo"<div id=\"form\">";
$komdata=file("./content/kom_$id.txt");
echo "";
if(session_is_registered('log')){
echo "<br/><a class=\"label label-danger\" href=\"./dels.php?del=allkom&id=$id\">Remove All Comments</a><br></br>";}
$self="./art.php?id=$id";
if ($hal == ""){$hal = "1";}
$first = count($komdata) - ($postkom * ($hal - 1));
$second = count($komdata) - ($postkom * $hal) + 1;
if ($second < 1) {$second = 1;}
$hals = (count($komdata) / $postkom);
if ($hal>1) $rew = "<ul class=\"pager\"> <li><a href=\"$self&hal=".($hal-1)."\">← Previous</a></li></ul>";
if ($hal<$hals) $next = "<ul class=\"pager\"> <li><a href=\"$self&hal=".($hal+1)."\">Next →</a></li></ul>";
for ($i = $first-1; $i >= $second-1; $i--) {
$ii = $i;
$ii++;
$data = explode("|",$komdata[$i]);
print "<div><hr><div class=\"list-group\"> <a class=\"list-group-item\"> ".ucfirst($data[4])."<span style=\"float: right;\"><small>$data[2] $data[3]</small> </a> <a class=\"list-group-item\">".text($data[5])." </a>";
if(session_is_registered('log')){
echo "<span class=\"label label-info\"> $data[6]</span> <a class=\"label label-warning\" href=\"fil.php?ad=ipx&ip=$data[6]\">Banned</a>
<a class=\"label label-danger\" href=\"./dels.php?del=koment&nid=$data[1]&id=$data[0]\">Remove</a>";}
echo "</div>";
}?>
<?=$rew.' '.$next;?></div>
<p><a class="btn btn-default" href="./new.php?x=komentar&id=<?=$id;?>"> <i class="fa fa-comment-o"></i> Add Comment</a></p><hr>
<?include"cp.php";
include"footer.php";
?>