OSDN Git Service

embrj
[embrj/master.git] / list.php
1 <?php 
2         include ('lib/twitese.php');
3         $title = "@{$_GET['id']}";
4         include ('inc/header.php');
5         if (!loginStatus()) header('location: login.php');
6 ?>
7
8 <script src="js/list.js"></script>
9
10 <div id="statuses">
11         <?php 
12                 $id = isset($_GET['id'])? $_GET['id'] : false;
13                 $since_id = isset($_GET['since_id'])? $_GET['since_id'] : false;
14                 $max_id = isset($_GET['max_id'])? $_GET['max_id'] : false;
15                 $t = getTwitter();
16                 $statuses = $t->listStatus($id, $since_id, $max_id);
17                 $listInfo = $t->listInfo($id);
18                 if ($statuses === false) {
19                         header('location: error.php');exit();
20                 } 
21                 
22                 $isFollower = $t->isFollowedList($id);
23         ?>
24
25         <div id="info_head">
26                 <a href="user.php?id=<?php echo $listInfo->user->screen_name ?>"><img id="info_headimg" src="<?php echo getAvatar($listInfo->user->profile_image_url); ?>" /></a>
27                 <div id="info_name"><?php echo $id?></div>
28                 <div id="info_relation">
29                 <?php if ($isFollower) {?>
30                         <a id="list_block_btn" class="info_btn_hover" href="#">Unfollow</a>
31                 <?php } else { ?>
32                         <a id="list_follow_btn" class="info_btn" href="#">Follow</a>
33                 <?php } ?>
34                         <a id="list_send_btn" class="info_btn" href="#">Tweet</a>
35                         <a class="info_btn" href="list_followers.php?id=<?php echo $id?>">Followers (<?php echo $listInfo->subscriber_count?>)</a>
36                         <a class="info_btn" href="list_members.php?id=<?php echo $id?>">Members (<?php echo $listInfo->member_count?>)</a>
37                 </div>
38         </div>
39         <div class="clear"></div>
40
41         <?php 
42                 $empty = count($statuses) == 0? true: false;
43                 if ($empty) {
44                         echo "<div id=\"empty\">No Tweet To Display</div>";
45                 } else {
46                         $output = '<ol class="timeline" id="allTimeline">';
47                         include('lib/timeline_format.php');
48                         $firstid = false;
49                         $lastid = false;
50                         foreach ($statuses as $status) {
51                                 if (!$firstid) $firstid = $status->id_str;
52                                 $lastid = $status->id_str;
53                                 if (isset($status->retweeted_status)) {
54                                         $output .= format_retweet($status);
55                                 } else { 
56                                         $output .= format_timeline($status,$t->username);
57                                 }
58                         }
59                         $lastid = bcsub($lastid, "1");
60                         
61                         $output .= "</ol><div id=\"pagination\">";
62                         
63                         $output .= "<a id=\"less\" class=\"round more\" style=\"float: left;\" href=\"list.php?id={$id}&since_id={$firstid}\">Back</a>";
64                         $output .= "<a id=\"more\" class=\"round more\" style=\"float: right;\" href=\"list.php?id={$id}&max_id={$lastid}\">Next</a>";
65                         
66                         $output .= "</div>";
67                         
68                         echo $output;
69                 }
70
71         ?>
72 </div>
73
74 <?php 
75         include ('inc/sidebar.php');
76         include ('inc/footer.php');
77 ?>