-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcomment.php
More file actions
100 lines (95 loc) · 2.16 KB
/
Copy pathcomment.php
File metadata and controls
100 lines (95 loc) · 2.16 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include_once 'core.php';
$bid=$ids; //bookid
//$bid=1; //only for testing
$uid=$userid; //userid
//$uid=1; //only for testing
//echo "in comment.php";
$resultc=$connection->query("SELECT * FROM `comments` WHERE `bookid`='$bid'");
$countc=$resultc->num_rows;
//echo "count is $countc";
if ($countc==0)
{
//include "add_comment.php";
?>
<div id="featured">
<div class="container">
<?php include "add_comment.php"; ?>
</div>
</div>
<?php
}
else
{
$i=1;
while ($rows=$resultc->fetch_array())
{
$cid=$rows[0];
$user=$rows[1];
//$book=$rows[2];
$comh=$rows[3];
$com=$rows[4];
$date=$rows[5];
$resultcu=$connection->query("SELECT * FROM `userdetail` WHERE `uniqueid`='$user'");
$rowsuser=$resultcu->fetch_array();
$uploader_name=$rowsuser[1];
/*<span class="byline"><?php echo "$comh";?></span><br/>
<!--<span class="byline" aling="left"><?php //echo "$date";?></span>-->
<span class="byline"><br/><?php echo "by - $uploader_name";?></span>
</div>
<p><?php echo "$com";?></p>*/
if ($i%2!=0 && $i-1<$countc)
{
?>
<div id="featured">
<div class="container">
<div class="title">
<span class="byline"><?php echo "$comh";?></span>
<span class="byline"><br/><?php echo "by - $uploader_name";?></span>
</div>
<p><?php echo "$com";?></p>
</div>
</div>
<?php
}
elseif ($i%2==0 && $i-1<$countc)
{
?>
<div id="page" class="container">
<div class="title">
<div class="title">
<span class="byline"><?php echo "$comh";?></span>
<span class="byline"><br/><?php echo "by - $uploader_name";?></span>
</div>
<p><?php echo "$com";?></p>
</div>
</div>
<?php
}
$i++;
}
if ($i%2!=0)
{
?>
<div id="featured">
<div class="container">
<span class="byline">Add new comment</span>
<?php include "add_comment.php"; ?>
</div>
</div>
<?php
}
else
{
?>
<div id="page" class="container">
<div class="title">
<span class="byline">Add new comment</span>
<?php include "add_comment.php"; ?>
</div>
</div>
<?php
}
//include "add_comment.php";
}
?>