OSDN Git Service

a0d16edc6e77f7f8076158f05b86d7c3f4c2ebe9
[embrj/master.git] / favor.php
1 <?php \r
2         include ('lib/twitese.php');\r
3         $title = "My Favorites";\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 \r
12         <?php include('inc/sentForm.php')?>\r
13 \r
14 <?php \r
15         $t = getTwitter();\r
16         $p = 1;\r
17         if (isset($_GET['p'])) {\r
18                 $p = (int) $_GET['p'];\r
19                 if ($p <= 0) $p = 1;\r
20         }\r
21 \r
22         $statuses = $t->getFavorites($p);\r
23         if ($statuses === false) {\r
24                 header('location: error.php');exit();\r
25         } \r
26         $empty = count($statuses) == 0? true: false;\r
27         if ($empty) {\r
28                 echo "<div id=\"empty\">No tweet to display.</div>";\r
29         } else {\r
30                 $output = '<ol class="timeline" id="allTimeline">';\r
31                 include('lib/timeline_format.php');\r
32                 foreach ($statuses as $status) {\r
33                         if (isset($status->retweeted_status)) {\r
34                                 $output .= format_retweet($status);\r
35                         } else { \r
36                                 $output .= format_timeline($status,$t->username);\r
37                         }\r
38                 }\r
39 \r
40                 $output .= "</ol><div id=\"pagination\">";\r
41 \r
42                 if ($p >1) $output .= "<a id=\"more\" class=\"round more\" style=\"float: left;\" href=\"favor.php?p=" . ($p-1) . "\">Back</a>";\r
43                 if (!$empty) $output .= "<a id=\"more\" class=\"round more\" style=\"float: right;\" href=\"favor.php?p=" . ($p+1) . "\">Next</a>";\r
44 \r
45                 $output .= "</div>";\r
46 \r
47                 echo $output;\r
48         }\r
49 ?>\r
50 </div>\r
51 \r
52 <?php \r
53         include ('inc/sidebar.php');\r
54         include ('inc/footer.php');\r
55 ?>\r