function unfollowchannel(){ if ($_SESSION['user']->isAnon()) return array("ok"=>false, "error"=>"you have to login"); $channel = new Channel(); if (!isset($_GET['channelid_unfollowchannel'])) return array("ok"=>false, "error"=>"no id"); $channel->setId($_GET['channelid_unfollowchannel']); if ($channel->getUser()->getId()==$_SESSION['user']->getId()) return array("ok"=>false, "error"=>"channel owner cant unfollow"); if ($channel->unfollow()) return array("ok"=>true, "error"=>""); else return array("ok"=>false, "error"=>"cant unfollow"); }