-
Notifications
You must be signed in to change notification settings - Fork 0
/
month.php
25 lines (19 loc) · 1.05 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
<?php
// PONGSOCKET TWEET ARCHIVE
// Month page
require "inc/preheader.php";
$m = ltrim($_GET['m'], "0");
if(!is_numeric($m) || !is_numeric($_GET['y']) || (is_numeric($m) && ($m > 12 || $m < 1)) || (is_numeric($_GET['y']) && $_GET['y'] < 2000)){ errorPage("Invalid year or month"); }
$q = $db->query("SELECT `".DTP."tweets`.*, `".DTP."tweetusers`.`screenname`, `".DTP."tweetusers`.`realname`, `".DTP."tweetusers`.`profileimage` FROM `".DTP."tweets`
LEFT JOIN `".DTP."tweetusers` ON `".DTP."tweets`.`userid` = `".DTP."tweetusers`.`userid`
WHERE YEAR(FROM_UNIXTIME(`time`" . DB_OFFSET . ")) = '" . $db->s($_GET['y']) . "'
AND MONTH(FROM_UNIXTIME(`time`" . DB_OFFSET . ")) = '" . $db->s($m) . "'
".$qwhr['and']."
ORDER BY `".DTP."tweets`.`time` DESC");
$selectedDate = array("y" => $_GET['y'], "m" => $m, "d" => 0);
$pageTitle = date("F Y", mktime(1,0,0,$m,1,$_GET['y']));
$preBody = displayDays($_GET['y'], $m);
$content_class = "archive_month_bg";
require "inc/header.php";
echo tweetsHTML($q, "month");
require "inc/footer.php";