public function likepage() { $this->load->library('facebook'); /** BEGIN REQUIRED VALIDATION **/ if (!($campaign = $this->campaign->getActiveCampaign())) { show_404(); } $redirectURL = $this->input->get_post('ref'); if (!($user = getAuthorizedUser(true))) { redirect(menu_url('authorize') . '?ref=' . $redirectURL); } /** END REQUIRED VALIDATION **/ $this->load->view('site/likepage', array('campaign' => $campaign, 'custom_page_url' => $campaign ? $this->page_m->getPageURL($campaign['GID']) : null, 'fbpage' => getFacebookPage(), 'redirectURL' => $redirectURL)); }
public function likepage() { if (!($campaign = $this->campaign->getActiveCampaign())) { show_404(); } $redirectURL = $this->input->get_post('ref'); if (!($user = getAuthorizedUser(true))) { redirect(mobile_menu_url('authorize') . '?ref=' . $redirectURL); } $this->load->view('mobile/mobile_likepage', array('campaign' => $campaign, 'custom_page_url' => $campaign ? $this->page_m->getPageURL($campaign['GID']) : null, 'fbpage' => getFacebookPage(), 'redirectURL' => $redirectURL)); }
function user_isFan($pageID = null) { $CI =& get_instance(); $CI->load->library('facebook'); $isFan = false; if (!$pageID) { if ($pages = getFacebookPage()) { $pageID = $pages['id']; } else { return false; } } try { $isFan = $CI->facebook->api(array("method" => "pages.isFan", "page_id" => $pageID, "uid" => $CI->facebook->getUser())); } catch (Exception $e) { return false; } return $isFan === TRUE ? true : false; }