api_client->session_key != '') { $result = $fb->api_client->users_getLoggedInUser(); } else { $result = null; } } catch (Exception $e) { $result = null; salsa_debug_log('Exception in FacebookConnect::getFacebookUID: ' . $e->getMessage()); } return $result; } function salsa_fb_pages(&$fb, $fb_uid) { $fql = 'SELECT page_id FROM page_admin WHERE uid = ' . $fb_uid; try { salsa_debug_log($fql); $fql_results = $fb->api_client->fql_query($fql); salsa_debug_log($page_ids); $page_ids = array(); foreach($fql_results as $fql_result) { $page_ids[] = $fql_result['page_id']; } salsa_debug_log('calling baton rouge'); $pages = implode(',', $page_ids); salsa_debug_log($pages); $result = $fb->api_client->pages_getInfo($pages, 'name, page_url, website', '', ''); salsa_debug_log($result); } catch (Exception $e) { salsa_debug_log('Exception in FacebookConnect::getPagesForUID: ' . $e->getMessage()); $result = array(); } return $result; } function salsa_connect_options_form() { $submitted = false; if (isset($_REQUEST['nonce']) && ($nonce = $_REQUEST['nonce'])) { if (wp_verify_nonce($nonce, 'salsa')) { $submitted = true; update_option('salsa.twitter_notify', $_REQUEST['twitter_notify']); update_option('salsa.twitter_username', $_REQUEST['twitter_username']); update_option('salsa.twitter_password', trim($_REQUEST['twitter_password'])); update_option('salsa.bitly_api_key', trim($_REQUEST['bitly_api_key'])); update_option('salsa.bitly_api_login', trim($_REQUEST['bitly_api_login'])); update_option('salsa.url_shortener_svc', trim($_REQUEST['url_shortener_svc'])); update_option('salsa.facebook_notify', trim($_REQUEST['facebook_notify'])); update_option('salsa.facebook_api_key', trim($_REQUEST['facebook_api_key'])); update_option('salsa.facebook_app_secret', trim($_REQUEST['facebook_app_secret'])); update_option('salsa.facebook_page', trim($_REQUEST['facebook_page'])); } } switch (get_option("salsa.url_shortener_svc", 'tinyurl')) { case 'tinyurl': $cur_url_shortener_svc_id = 0; break; case 'bitly': $cur_url_shortener_svc_id = 1; break; } ?>