OSDN Git Service

7f8b2c9bb23d8bf32f7ee11bc3ecc72819d60a17
[embrj/master.git] / inc / sidebar.php
1 <td class="column round-right" id="side_base">
2 <table>
3 <tr>
4 <td>
5 <div id="side" class="round-right">
6         <div id="sideinfo">
7                 <a href="profile.php"><img id="sideimg" src="<?php echo getCookie("imgurl")?>" /></a>
8                 <span id="sideid"><span id="side_name"><?php echo getEncryptCookie('twitese_name')?></span><a href="#" id="profileRefresh" title="refresh your profile"><i></i></a></span>
9                 <a href="profile.php"><span id="me_tweets"><span id="update_count"><?php echo getCookie('statuses_count')?></span> tweets</span></a>
10         </div>
11         <?php if (strrpos($_SERVER['PHP_SELF'], 'profile')) {
12                 $t = getTwitter();
13         $user = $t->showUser();
14 ?>
15         <ul id="user_info_profile">
16                 <li><span>Name</span> <?php echo $user->name ?></li>
17                 <?php if ($user->location) echo "<li><span>Location</span> $user->location</li>"; ?>
18                 <?php if (($user->url) and (strlen($user->url)>20)) echo '<li><span>Web</span> <a href="' .$user->url. '" target="_blank">' .substr($user->url, 0, 20). '...</a></li>'; else if (($user->url) and (strlen($user->url)<=20)) echo '<li><span>Web</span> <a href="' .$user->url. '" target="_blank">' .$user->url. '</a></li>';?>
19                 <?php if ($user->description) echo "<li><span>Bio</span> ".formatText($user->description)."</li>"; ?>
20                 </ul>
21         <?php }?>
22         <ul id="user_stats">
23                 <li>
24                         <a href="friends.php">
25                                 <span class="count"><?php echo getCookie('friends_count')?></span>
26                                 <span class="label">following</span>
27                         </a>
28                 </li>
29                 <li>
30                         <a href="followers.php">
31                                 <span class="count"><?php echo getCookie('followers_count')?></span>
32                                 <span class="label">followers</span>
33                         </a>
34                 </li>
35                 <li>
36                         <a href="lists.php?t=2">
37                                 <span class="count"><?php $listed_count = getCookie('listed_count'); echo ($listed_count > 0 ? $listed_count : 0);?></span>
38                                 <span class="label">listed</span>
39                         </a>
40                 </li>
41         </ul>
42         
43                 <li>
44                 <DIV id='profile' class='section'> 
45                 <p id="sidebarTip" class='promotion round'> 
46         <?php
47         $preset = array(
48                 array(
49                         'term' => 'Short&middot;cuts',
50                         'def' => '<em>n.</em> Use shortcuts in Embr.',
51                         'more' => '<strong>Shortcuts available now:</strong><br>
52                         C / U - Update<br>
53                         T - Go to top<br>
54                         B - Go to bottom<br>
55                         R - Refresh<br>
56                         S - Search'
57                 ),
58                 array(
59                         'term' => 'User Di&middot;rect View',
60                         'def' => '<em>n.</em> Now you can view the user page of your interested more incentively.',
61                         'more' => 'take @'.SITE_OWNER.' for example, you can visit his/her page via '.BASE_URL.'/'.SITE_OWNER,
62                 ),
63                 array(
64                         'term' => 'Realtime Refresh',
65                         'def' => '<em>v.</em> Now you can refresh your profile whenever you like!',
66                         'more' => 'See the circle behind your username? Try to click it!'
67                 ),
68                 array(
69                         'term' => 'Custom&middot;Tips',
70                         'def' => '<em>n.</em> Hate embr tips so much? Now you can edit me into your own tips!',
71                         'more' => 'Your tips will be encrypted in your cookies all for your privacy!'
72                 ),
73         );
74                 if(isset($_COOKIE['Tip_Title']) || isset($_COOKIE['Tip_Content']) || isset($_COOKIE['Tip_More'])){
75                         $raw = array(
76                                 'term' => getEncryptCookie('Tip_Title'),
77                                 'def' => getEncryptCookie('Tip_Content'),
78                                 'more' => getEncryptCookie('Tip_More'),
79                         );
80                         initSidebarTip($raw);
81                 } else {
82                         initSidebarTip($preset[3]);
83                 }
84         ?>
85                 </p>
86                 </DIV>
87                 </li>
88                 
89         <div class="clear"></div>
90         <ul id="primary_nav" class="sidebar-menu">
91         <li id="updates_tab"><a class="in-page-link" href="all.php"><span>Updates</span></a></li>
92         <li id="replies_tab"><a class="in-page-link" href="replies.php"><span>@<?php echo is_null(getEncryptCookie('twitese_name')) ? $t->screen_name : getEncryptCookie('twitese_name'); ?></span></a></li>
93         <li id="msgs_tab"><a class="in-page-link" href="message.php"><span>Direct Messages</span></a></li>
94         <li id="lists_tab"><a class="in-page-link" href="lists.php"><span>Lists</span></a></li>
95         <li id="favs_tab"><a class="in-page-link" href="favor.php"><span>Favorites</span></a></li>
96         <li id="retweets_tab"><a class="in-page-link" href="retweets.php"><span>Retweets</span></a></li>
97         </ul>
98         <?php include ('sidepost.php') ?>
99 </div>
100 </td>
101 </tr>
102 </table>
103 <?php
104         function initSidebarTip($entity){
105                 echo '<a class="definition"><strong contenteditable="true">'.$entity['term'].'</strong><span contenteditable="true">'.$entity['def'].'</span></a><br><br><span>Click for more details.<span id="indicator">[+]</span></span><span id="sidebarTip_more"><span contenteditable="true">'.$entity['more'].'</span><br><br><a href="#" id="tip_reset" title="You will lose all customized Tips!">Reset to default</a></span>';
106         }
107 ?>