OSDN Git Service

b88cde9733e1d73cf74aad10ed81b38ef2bdbb7e
[embrj/master.git] / profile.php
1 <?php\r
2         include ('lib/twitese.php');\r
3         $title = "Profile";\r
4         include ('inc/header.php');\r
5         \r
6         if (!loginStatus()) header('location: login.php');\r
7 ?>\r
8 \r
9 <script src="js/btns.js"></script>\r
10 \r
11 <div id="statuses" class="column round-left">\r
12 \r
13         <?php include('inc/sentForm.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->userTimeline($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                         include_once('lib/timeline_format.php');\r
30                         $output = '<ol class="timeline" id="allTimeline">';\r
31 \r
32                         foreach ($statuses as $status) {\r
33                                 if (isset($status->retweeted_status)) {\r
34                                         $output .= format_retweet($status,true);\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=\"profile.php?p=" . ($p-1) . "\">Back</a>";\r
43                         if (!$empty) $output .= "<a id=\"more\" class=\"round more\" style=\"float: right;\" href=\"profile.php?p=" . ($p+1) . "\">Next</a>";\r
44 \r
45                         $output .= "</div>";\r
46 \r
47                         echo $output;\r
48                 }\r
49 \r
50 \r
51 \r
52 ?>\r
53 </div>\r
54 \r
55 <?php \r
56                 include ('inc/sidebar.php');\r
57                 include ('inc/footer.php');\r
58 ?>\r