function ViewCommonFollowing($id) { $following2_dao = new Following2_dao(); $following2 = $following2_dao->getById($id); $following_dao = new Following_dao(); foreach ($following2 as $fol2) { $count = 0; $id2 = $fol2->id2; $following = $following_dao->getAll(); foreach ($following as $fol) { $id = $fol->id; if ($id2 == $id) { $following = $following_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; } }
$follower2->screen_name = $myname; $follower2->followers_count = $fol; $follower2->friends_count = $fri; $follower2->statuses_count = $status; $follower2->location = $place; $follower2->profile_image_url = $thumb; //echo $follower->id; $follower2_dao->add($follower2); } } $follower2 = ""; //menghapus obje follower2 //get data following dari following dan menyimpannya ke tabel following2 $following_dao = new Following_dao(); $data2 = $following_dao->getAll(); $following2_dao = new Following2_dao(); $following2_dao->deleteAll(); foreach ($data2 as $datum2) { $following2_url = "http://api.twitter.com/1/statuses/friends/{$datum2->id}.json"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $following2_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $curlout = curl_exec($ch); curl_close($ch); $following2 = json_decode($curlout, true); foreach ($following2 as $myfollowing2) { $myname = $myfollowing2['screen_name']; $thumb = $myfollowing2['profile_image_url']; $fol = $myfollowing2['followers_count']; $fri = $myfollowing2['friends_count']; $name = $myfollowing2['name'];