2 include ('lib/twitese.php');
4 include ('inc/header.php');
6 if (!loginStatus()) header('location: login.php');
8 <script src="js/home.js"></script>
9 <div id="statuses" class="column round-left">
11 include('inc/sentForm.php');
13 $since_id = isset($_GET['since_id']) ? $_GET['since_id'] : false;
14 $max_id = isset($_GET['max_id']) ? $_GET['max_id'] : false;
17 $statuses = $t->homeTimeline($since_id, $max_id);
18 if ($statuses == false)
20 header('location: error.php?code='.$t->http_code);exit();
22 $count = count($statuses);
23 $empty = $count == 0 ? true : false;
26 echo "<div id=\"empty\">No tweet to display.</div>";
27 } else if ($t->http_code == 429) {
28 echo "<div id=\"empty\">API quota is used out, please wait for a moment before next refresh.</div>";
30 $output = '<ol class="timeline" id="allTimeline">';
32 include('lib/timeline_format.php');
33 $maxid = isset($_COOKIE['maxid']) ? $_COOKIE['maxid'] : '';
36 foreach ($statuses as $status) {
37 if (!$firstid) $firstid = $status->id_str;
38 $lastid = $status->id_str;
39 if($maxid == '' || $p == 1 || strcmp($status->id_str,$maxid) < 0) {
40 if (isset($status->retweeted_status)) {
41 $output .= format_retweet($status);
43 $output .= format_timeline($status,$t->username);
47 $lastid = bcsub($lastid, "1");
49 $output .= "</ol><div id=\"pagination\">";
50 $time = $_SERVER['REQUEST_TIME']+3600;
51 setcookie('maxid',$statuses[$count-1]->id_str,$time,'/');
53 $output .= "<a id=\"less\" class=\"btn btn-white\" style=\"float: left;\" href=\"index.php?since_id=" . $firstid . "\">Back</a>";
54 $output .= "<a id=\"more\" class=\"btn btn-white\" style=\"float: right;\" href=\"index.php?max_id=" . $lastid . "\">Next</a>";
61 include ('inc/sidebar.php');
62 include ('inc/footer.php');