function ViewCommonFollower($id) { $follower2_dao = new Follower2_dao(); $follower2 = $follower2_dao->getById($id); $following_dao = new Following_dao(); $follower_dao = new Follower_dao(); foreach ($follower2 as $fol2) { $count = 0; $id2 = $fol2->id2; $follower = $follower_dao->getAll(); foreach ($follower as $fol) { $id = $fol->id; if ($id2 == $id) { $following = $follower_dao->getById($fol2->id2); echo "<a href=\"https://twitter.com/{$following->screen_name}\" target=\"_BLANK\"><img src=\"{$following->profile_image_url}\" alt=\"{$following->name}\" title=\"{$following->name}\"></a>"; } } //echo "<br/>"; //echo $count; } }
$user->location = $response['location']; $user->profile_image_url = $response['profile_image_url']; $user_dao = new User_dao(); $user_dao->deleteAll(); //menghapus data user yang telah ada di tabel user $user_dao->add($user); //menyimpan data user ke tabel user berdasarkan hasil input //mengambil data follower dari user dan menyimpannya ke tabel follower $followers_url = "http://api.twitter.com/1/statuses/followers/{$user->id}.json"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $followers_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $curlout = curl_exec($ch); curl_close($ch); $followers = json_decode($curlout, true); $follower_dao = new Follower_dao(); $follower_dao->deleteAll(); foreach ($followers as $myfollowers) { $myname = $myfollowers['screen_name']; $thumb = $myfollowers['profile_image_url']; $fol = $myfollowers['followers_count']; $fri = $myfollowers['friends_count']; $name = $myfollowers['name']; $place = $myfollowers['location']; $id = $myfollowers['id']; $status = $myfollowers['statuses_count']; $follower = new Follower(); $follower->id = $id; $follower->name = $name; $follower->screen_name = $myname; $follower->followers_count = $fol;