<div class="inner" align="center"> <?php if (isset($_SESSION['username'])) { echo "<b>Hello! " . $_SESSION['username'] . " | people you're following</b>"; //unset($_SESSION['username']); } ?> <div class="all_users" align="center"> <?php $folnonfol = ''; $users = show_users_following($_SESSION['userid']); $following = following($_SESSION['userid']); $follower = follower($_SESSION['userid']); if (count($users)) { ?> <table border="1" cellspacing="0" cellpadding="5" width="330"> <?php foreach ($users as $key => $value) { echo '<tr valign="top">'; echo '<td>' . $value; if (in_array($key, $follower)) { $folnonfol = '| following you'; } else { $folnonfol = ''; //This user is not following you } if (in_array($key, $following)) {
</div>'; //Link to their profile if (getCity($id) != "") { echo '<div class="container"> <br><br> <div class="row left"> <h4 class="header col s12 light">Events happening here: </h4> </div> <br> </div>'; getCreatedBy($id); } else { if ($_SESSION['id'] == $id) { echo ''; } else { if (!following($id)) { echo '<div class ="container"> <form action="follow.php" method="post"> <input name="id" type="hidden" value="' . $id . '"></input> <button type="submit" class="btn waves-effect waves-light"> Follow ' . $fbProfile['name'] . ' <i class="mdi-content-add right"></i></button></form> </div>'; } else { echo '<div class="container"> <form action="unfollow.php" method="post"> <input type="hidden" value="' . $id . '"></input> <button type="submit" class="btn waves-effect waves-light"> Unfollow ' . $fbProfile['name'] . ' <i class="mdi-content-remove right"></i></button></form> </div>';
$db = new medoo(array('database_type' => 'mysql', 'database_name' => 'jianshu', 'server' => 'localhost', 'username' => 'root', 'password' => '123456', 'port' => 3306, 'charset' => 'utf8', 'option' => array(PDO::ATTR_CASE => PDO::CASE_NATURAL))); $curl = new Curl(); $str = file_get_contents('user.txt'); $id = intval($str); while (true) { $userArr = $db->get('user', '*', array('id[>]' => $id, 'LIMIT' => 1)); if (!is_array($userArr) || empty($userArr)) { echo "Over!\r\n"; break; } //关注专题/文集 collection($userArr); //构造数据 // $userArr = array('id' => 7231, 'name' => 'f93e84d2e162'); //关注用户 following($userArr); //粉丝 follower($userArr); //文章 articles($userArr); $id = $userArr['id']; file_put_contents('user.txt', $id); $db->clear(); } //关注专题/文集 function collection($userArr) { global $db, $curl; $page = 1; while (true) { $url = "http://www.jianshu.com/users/{$userArr['name']}/subscriptions?page={$page}";
} } break; case "Followers": $a = followers_id($_SESSION['user_id']); $user_id = $_SESSION['user_id']; foreach ($a as $follower) { if (!empty(getUserDetails($follower->u_id))) { $userDetails = getUserDetails($follower->u_id); echo '<div style="margin-top:1px;"><img style="padding-right:5px;" src="' . BASE_URI . 'templates/avatars/' . $userDetails->avatar . '" width="50px" height="50px"><a href="topics.php?user='******'">' . $userDetails->name . '<span class="hidden-xs">, ' . $userDetails->about . '</a> <a href="#" id="follow-' . $userDetails->id . '" class="upvotes upvoteborder pull-right" onclick="follow(' . $userDetails->id . ','; if (following($user_id, $userDetails->id)) { echo "'unfollow'"; } else { echo "'follow'"; } echo ');" style="padding:5px;text-decoration:none;margin-top:6px;"> <span class="followuser-' . $userDetails->id . '">'; if (following($user_id, $userDetails->id)) { echo 'Unfollow'; } else { echo 'Follow'; } echo '</span></a> <div>'; echo '<hr>'; } } } } else { }
<?php include 'include.php'; isAllowed(); $id = $_SESSION['profil']['id']; $pages = followingPages($id); if ($pages > 0) { if (isset($_GET['page'])) { $content = following($id, $_GET['page']); } else { $content = following($id); } $content = $content->following; } getHeader(); ?> <article> <!-- Contenu de la page --> <div class="contenu"> <br/><h2>Liste des abonnements</h2><br/> <ul id="listerelation"> <?php if ($pages > 0) { ?> <?php foreach ($content as $k => $v) { ?> <li> <a href="profil.php?id=<?php echo $v->id;