-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathadmin_mode.php
41 lines (28 loc) · 955 Bytes
/
admin_mode.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
<!DOCTYPE html>
<html>
<head>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"/>
<title></title>
</head>
<body>
<?php
include 'comments.class.php';
$db_details = array(
'db_host' => 'localhost',
'db_user' => 'root',
'db_pass' => '',
'db_name' => 'test'
);
$settings = array('isAdmin' => true, 'public' => false); // that is all you need to specify to be in admin mode :D
$page_id = 1;
$comments = new Comments_System($db_details, $settings);
$comments->grabComment($page_id);
if($comments->success)
echo "<div class='alert alert-success' id='comm_status'>".$comments->success."</div>";
else if($comments->error)
echo "<div class='alert alert-error' id='comm_status'>".$comments->error."</div>";
// a simple form
echo $comments->generateForm();
// we show the posted comments
echo $comments->generateComments($page_id); // we pass the page id
?>