2 include ('lib/twitese.php');
\r
4 include ('inc/header.php');
\r
6 if (!loginStatus()) header('location: login.php');
\r
9 <script src="js/lists.js"></script>
\r
14 if ( isset($_POST['list_name']) ) {
\r
15 if ($_POST['is_edit'] == 0) {
\r
16 if (trim($_POST['list_name']) == '') {
\r
17 echo "<div id=\"otherTip\">Fail to create list, the name CANNOT be empty</div>";
\r
19 $isProtect = isset($_POST['list_protect']) ? true : false;
\r
20 $result = $t->createList($_POST['list_name'], $_POST['list_description'], $isProtect);
\r
22 echo "<div id=\"otherTip\">Success</div>";
\r
24 echo "<div id=\"otherTip\">Failed, please retry</div>";
\r
28 if (trim($_POST['list_name']) == '') {
\r
29 echo "<div id=\"otherTip\">Fail to create list, the name CANNOT be empty</div>";
\r
31 $isProtect = isset($_POST['list_protect']) ? true : false;
\r
32 $result = $t->editList($_POST['pre_list_name'], $_POST['list_name'], $_POST['list_description'], $isProtect);
\r
34 echo "<div id=\"otherTip\">Success</div>";
\r
36 echo "<div id=\"otherTip\">Failed, please retry</div>";
\r
42 if ( isset($_POST['list_members']) ) {
\r
43 if (trim($_POST['list_members']) == '') {
\r
44 echo "<div id=\"otherTip\">Fail to add members, the member list is empty!</div>";
\r
46 $listId = $_POST['member_list_name'];
\r
47 $result = $t->addListMember($listId, $_POST['list_members']);
\r
48 if (isset($result->error)) {
\r
49 echo "<div id=\"otherTip\">Failed, please retry!</div>";
\r
51 echo "<div id=\"otherTip\">Success!</div>";
\r
58 if (isset($_GET['id'])) {
\r
64 $type = isset($_GET['t'])? $_GET['t'] : 1;
\r
65 $c = isset($_GET['c'])? $_GET['c'] : -1;
\r
68 $lists = $t->followedLists($id, $c);
\r
71 $lists = $t->createdLists($id, $c);
\r
74 $lists = $t->beAddedLists($id, $c);
\r
79 $nextlist = $lists->next_cursor;
\r
80 $prelist = $lists->previous_cursor;
\r
81 $lists = $lists->lists;
\r
82 if ($lists === false) {
\r
83 header('location: error.php');exit();
\r
89 <?php if ($isSelf) { ?>
\r
90 <?php if ($type == 0) {?>
\r
91 <span class="subnavNormal">Lists you follow</span><span class="subnavLink"><a href="lists.php?t=1">Lists you created</a></span><span class="subnavLink"><a href="lists.php?t=2">Lists following you</a></span>
\r
92 <?php } else if ($type == 1) {?>
\r
93 <span class="subnavLink"><a href="lists.php?t=0">Lists you follow</a></span><span class="subnavNormal">Lists you created</span><span class="subnavLink"><a href="lists.php?t=2">Lists following you</a></span>
\r
95 <span class="subnavLink"><a href="lists.php?t=0">Lists you follow</a></span><span class="subnavLink"><a href="lists.php?t=1">Lists you created</a></span><span class="subnavNormal">Lists following you</span>
\r
98 <?php if ($type == 0) {?>
\r
99 <span class="subnavNormal">Following Lists</span><span class="subnavLink"><a href="lists.php?id=<?php echo $id?>&t=1">Created Lists</a></span><span class="subnavLink"><a href="lists.php?id=<?php echo $id?>&t=2">Lists Following</a></span>
\r
100 <?php } else if ($type == 1) {?>
\r
101 <span class="subnavLink"><a href="lists.php?t=0&id=<?php echo $id?>">Following Lists</a></span><span class="subnavNormal">Created Lists</span><span class="subnavLink"><a href="lists.php?id=<?php echo $id?>&t=2">Lists Following</a></span>
\r
103 <span class="subnavLink"><a href="lists.php?t=0&id=<?php echo $id?>">Following Lists</a></span><span class="subnavLink"><a href="lists.php?id=<?php echo $id?>&t=1">Created Lists</a></span><span class="subnavNormal">Lists Following</span>
\r
110 $empty = count($lists) == 0? true: false;
\r
112 echo "<div id=\"empty\">No Tweet To Display</div>";
\r
114 $output = '<ol class="rank_list">';
\r
115 foreach ($lists as $list) {
\r
117 $listurl = substr($list->uri,1);
\r
118 $user = $list->user;
\r
119 $listname = explode('/',$list->full_name);
\r
120 $mode = $list->mode == 'private' ? "Private" : "";
\r
124 <span class=\"rank_img\"><img src=\"".getAvatar($user->profile_image_url)."\" /></span>
\r
125 <div class=\"rank_content\">
\r
126 <span class=\"rank_num\"><span class=\"rank_name\"><a href=\"list.php?id=$listurl\"><em>$listname[0]/</em>$listname[1]</a></span></span>
\r
127 <span class=\"rank_count\">Followers:$list->subscriber_count Members:$list->member_count $mode</span>
\r
129 if ($list->description != '') $output .= "<span class=\"rank_description\">Description: $list->description</span>";
\r
130 if ($type == 0) $output .= "<span id=\"list_action\"><a id=\"btn\" href=\"javascript:void()\" class=\"unfollow_list\">Unfollow</a></span>";
\r
131 if ($type == 1 && $isSelf) $output .= "<span id=\"list_action\"><a id=\"btn\" href=\"javascript:void()\" class=\"edit_list\">Edit</a> <a id=\"btn\" href=\"javascript:void()\" class=\"delete_list\">Delete</a> <a id=\"btn\" href=\"javascript:void()\" class=\"add_member\">Add Members</a></span>";
\r
138 $output .= "</ol>";
\r
145 <?php if ($isSelf && $type == 1) {?>
\r
146 <a href="javascript:void()" class="more round" id="list_create_btn" style="margin: 20px auto;">Create a new list</a>
\r
147 <form method="POST" action="./lists.php?t=1" id="list_form">
\r
148 <input type="hidden" name="pre_list_name" value="" id="pre_list_name" />
\r
149 <input type="hidden" name="is_edit" value="0" id="is_edit" />
\r
150 <span><label for="list_name">List name</label><input type="text" name="list_name" id="list_name" /></span>
\r
151 <span><label for="list_description">Description</label><textarea type="text" name="list_description" id="list_description"></textarea></span>
\r
152 <span><label for="list_protect">Private</label><input type="checkbox" name="list_protect" id="list_protect" />
\r
153 <a style="background: transparent url(img/sprite-icons.png) no-repeat scroll -272px -16px; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; text-decoration: none; height: 10px; float: right; position: relative; width: 9px; left: 3px; top: -160px;" title="Close" onclick="$('#list_form').slideToggle(300)" href="#"></a>
\r
154 <input type="submit" class="btn" id="list_submit" value="Creat" />
\r
163 <div id="pagination">
\r
165 if ($type == 0 || $type == 2) {
\r
167 if ($prelist != 0) echo "<a id=\"more\" class=\"round more\" style=\"float: left;\" href=\"lists.php?t=$type&c=$prelist\">Back</a>";
\r
168 if ($nextlist != 0) echo "<a id=\"more\" class=\"round more\" style=\"float: right;\" href=\"lists.php?t=$type&c=$nextlist\">Next</a>";
\r
170 if ($prelist != 0) echo "<a id=\"more\" class=\"round more\" style=\"float: left;\" href=\"lists.php?id=$id&t=$type&c=$prelist\">Back</a>";
\r
171 if ($nextlist != 0) echo "<a id=\"more\" class=\"round more\" style=\"float: right;\" href=\"lists.php?id=$id&t=$type&c=$nextlist\">Next</a>";
\r
179 include ('inc/sidebar.php');
\r
180 include ('inc/footer.php');
\r