homeTimeline($since_id, $max_id); if ($statuses == false) { header('location: error.php?code='.$t->http_code);exit(); } $count = count($statuses); $empty = $count == 0 ? true : false; if ($empty) { echo "
No tweet to display.
"; } else if ($t->http_code == 429) { echo "
API quota is used out, please wait for a moment before next refresh.
"; } else { $output = '
    '; include('lib/timeline_format.php'); $maxid = isset($_COOKIE['maxid']) ? $_COOKIE['maxid'] : ''; $firstid = false; $lastid = false; foreach ($statuses as $status) { if (!$firstid) $firstid = $status->id_str; $lastid = $status->id_str; if($maxid == '' || $p == 1 || strcmp($status->id_str,$maxid) < 0) { if (isset($status->retweeted_status)) { $output .= format_retweet($status); } else { $output .= format_timeline($status,$t->username); } } } $lastid = bcsub($lastid, "1"); $output .= "
"; $time = $_SERVER['REQUEST_TIME']+3600; setcookie('maxid',$statuses[$count-1]->id_str,$time,'/'); $output .= "Back"; $output .= "Next"; $output .= "
"; echo $output; } ?>