-
Notifications
You must be signed in to change notification settings - Fork 0
/
month.php
51 lines (42 loc) · 1.57 KB
/
month.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
<?php
$pagetitle = "today";
include 'includes/secure_header.php';
include 'includes/post_section.php';
?>
<div id="main_content">
<select ONCHANGE="location = this.options[this.selectedIndex].value;">
<option value="month.php#main_content">Month</option>
<option value="index.php#main_content">All</option>
<option value="year.php#main_content">Year</option>
<option value="week.php#main_content">Week</option>
</select>
<!-- <a href="stats.php"><button id="post_button">Stats</button></a>
<a href="more.php"><button id="post_button">More</button></a> -->
<div class="lightslider">
<?php
$sql = "SELECT * FROM posts
WHERE `user_id` = '$user_id' AND post_date = CURDATE() - INTERVAL 1 MONTH
ORDER BY post_date DESC ";
$result = $dbc->query($sql);
if ($result->num_rows > 0) {
echo "<ul id='lightslider' class='content-slider'>";
$i=1;
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<li>";
echo "<p>".$row['post_date']."</p>";
// $clientid.$i =
echo "<h3>".$row["post_content"]."</h3>";
echo "</li>";
}//end while
echo "</ul>";
$i++;
} else {
echo "<h1>0 results found!</h1>";
}// end if else
?>
</div> <!-- end light slider
</div> <!-- end main content -->
<?php
include 'includes/secure_footer.php';
?>