OSDN Git Service

c88b94959479805edb4478b80a1c4a544d78e7eb
[embrj/master.git] / replies.php
1 <?php\r
2         include ('lib/twitese.php');\r
3         $title = "Replies";\r
4         include ('inc/header.php');\r
5         if (!loginStatus()) header('location: login.php');\r
6 ?>\r
7 \r
8 <script src="js/btns.js"></script>\r
9 \r
10 <div id="statuses" class="column round-left">\r
11 <?php \r
12         include('inc/sentForm.php');\r
13         include('lib/timeline_format.php');\r
14                 $t = getTwitter();\r
15                 $p = 1;\r
16                 if (isset($_GET['p'])) {\r
17                         $p = (int) $_GET['p'];\r
18                         if ($p <= 0) $p = 1;\r
19                 }\r
20         \r
21                 $statuses = $t->replies($p);\r
22                 if ($statuses === false) {\r
23                         header('location: error.php');exit();\r
24                 } \r
25                 $empty = count($statuses) == 0? true: false;\r
26                 if ($empty) {\r
27                         echo "<div id=\"empty\">No tweet to display.</div>";\r
28                 } else {\r
29                         $output = '<ol class="timeline" id="allTimeline">';\r
30                         \r
31                         foreach ($statuses as $status) {\r
32                                 $output .= format_timeline($status,$t->username);\r
33                         }\r
34                         \r
35                         $output .= "</ol><div id=\"pagination\">";\r
36                         \r
37                         if ($p >1) $output .= "<a id=\"more\" class=\"round more\" style=\"float: left;\" href=\"replies.php?p=" . ($p-1) . "\">Back</a>";\r
38                         if (!$empty) $output .= "<a id=\"more\" class=\"round more\" style=\"float: right;\" href=\"replies.php?p=" . ($p+1) . "\">Next</a>";\r
39                         \r
40                         $output .= "</div>";\r
41                         \r
42                         echo $output;\r
43                 }\r
44         ?>\r
45 </div>\r
46 \r
47 <?php \r
48         include ('inc/sidebar.php');\r
49         include ('inc/footer.php');\r
50 ?>\r