'sfc-login.php', 'plugin_like'=>'sfc-like.php', 'plugin_publish'=>'sfc-publish.php', 'plugin_widgets'=>'sfc-widgets.php', 'plugin_comments'=>'sfc-comments.php', 'plugin_getcomm'=>'sfc-getcomm.php', 'plugin_register'=>'sfc-register.php', 'plugin_share'=>'sfc-share.php', 'plugin_photos'=>'sfc-photos.php', ); // load all the subplugins add_action('plugins_loaded','sfc_plugin_loader'); function sfc_plugin_loader() { global $sfc_plugin_list; $options = get_option('sfc_options'); if (!empty($options)) foreach ($options as $key=>$value) { if ($value === 'enable' && array_key_exists($key, $sfc_plugin_list)) { include_once($sfc_plugin_list[$key]); } } } // fix up the html tag to have the FBML extensions add_filter('language_attributes','sfc_lang_atts'); function sfc_lang_atts($lang) { return ' xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/" '.$lang; } // basic XFBML load into footer add_action('wp_footer','sfc_add_base_js',20); // 20, to put it at the end of the footer insertions. sub-plugins should use 30 for their code function sfc_add_base_js() { $options = get_option('sfc_options'); sfc_load_api($options['appid']); }; function sfc_load_api($appid) { // validate that they're using a valid locale string $sfc_valid_fb_locales = array( 'ca_ES', 'cs_CZ', 'cy_GB', 'da_DK', 'de_DE', 'eu_ES', 'en_PI', 'en_UD', 'ck_US', 'en_US', 'es_LA', 'es_CL', 'es_CO', 'es_ES', 'es_MX', 'es_VE', 'fb_FI', 'fi_FI', 'fr_FR', 'gl_ES', 'hu_HU', 'it_IT', 'ja_JP', 'ko_KR', 'nb_NO', 'nn_NO', 'nl_NL', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU', 'sk_SK', 'sl_SI', 'sv_SE', 'th_TH', 'tr_TR', 'ku_TR', 'zh_CN', 'zh_HK', 'zh_TW', 'fb_LT', 'af_ZA', 'sq_AL', 'hy_AM', 'az_AZ', 'be_BY', 'bn_IN', 'bs_BA', 'bg_BG', 'hr_HR', 'nl_BE', 'en_GB', 'eo_EO', 'et_EE', 'fo_FO', 'fr_CA', 'ka_GE', 'el_GR', 'gu_IN', 'hi_IN', 'is_IS', 'id_ID', 'ga_IE', 'jv_ID', 'kn_IN', 'kk_KZ', 'la_VA', 'lv_LV', 'li_NL', 'lt_LT', 'mk_MK', 'mg_MG', 'ms_MY', 'mt_MT', 'mr_IN', 'mn_MN', 'ne_NP', 'pa_IN', 'rm_CH', 'sa_IN', 'sr_RS', 'so_SO', 'sw_KE', 'tl_PH', 'ta_IN', 'tt_RU', 'te_IN', 'ml_IN', 'uk_UA', 'uz_UZ', 'vi_VN', 'xh_ZA', 'zu_ZA', 'km_KH', 'tg_TJ', 'ar_AR', 'he_IL', 'ur_PK', 'fa_IR', 'sy_SY', 'yi_DE', 'gn_PY', 'qu_PE', 'ay_BO', 'se_NO', 'ps_AF', 'tl_ST' ); $locale = get_locale(); if ( !in_array($locale, $sfc_valid_fb_locales) ) { $locale = 'en_US'; // default if they're using one FB doesn't like } ?>

".sprintf(__('Simple Facebook Connect needs configuration information on its settings page.', 'sfc'), admin_url('options-general.php?page=sfc'))."

';" ) ); } else { add_action('admin_print_footer_scripts','sfc_add_base_js',20); } wp_enqueue_script('jquery'); register_setting( 'sfc_options', 'sfc_options', 'sfc_options_validate' ); add_settings_section('sfc_main', __('Main Settings', 'sfc'), 'sfc_section_text', 'sfc'); if (!defined('SFC_APP_SECRET')) add_settings_field('sfc_app_secret', __('Facebook Application Secret', 'sfc'), 'sfc_setting_app_secret', 'sfc', 'sfc_main'); if (!defined('SFC_APP_ID')) add_settings_field('sfc_appid', __('Facebook Application ID', 'sfc'), 'sfc_setting_appid', 'sfc', 'sfc_main'); if (!defined('SFC_FANPAGE')) add_settings_field('sfc_fanpage', __('Facebook Fan Page', 'sfc'), 'sfc_setting_fanpage', 'sfc', 'sfc_main'); add_settings_section('sfc_plugins', __('SFC Plugins', 'sfc'), 'sfc_plugins_text', 'sfc'); add_settings_field('sfc_subplugins', __('Plugins', 'sfc'), 'sfc_subplugins', 'sfc', 'sfc_plugins'); add_settings_section('sfc_meta', __('Facebook Metadata', 'sfc'), 'sfc_meta_text', 'sfc'); add_settings_field('sfc_default_image', __('Default Image', 'sfc'), 'sfc_default_image', 'sfc', 'sfc_meta'); add_settings_field('sfc_default_description', __('Default Description', 'sfc'), 'sfc_default_description', 'sfc', 'sfc_meta'); } // add the admin options page add_action('admin_menu', 'sfc_admin_add_page'); function sfc_admin_add_page() { global $sfc_options_page; $sfc_options_page = add_options_page(__('Simple Facebook Connect', 'sfc'), __('Simple Facebook Connect', 'sfc'), 'manage_options', 'sfc', 'sfc_options_page'); } function sfc_plugin_help($contextual_help, $screen_id, $screen) { global $sfc_options_page; if ($screen_id == $sfc_options_page) { $home = home_url('/'); $contextual_help = __("

To connect your site to Facebook, you will need a Facebook Application. If you have already created one, please insert your Application Secret and Application ID below.

Can't find your key?

  1. Get a list of your applications from here: Facebook Application List
  2. Select the application you want, then copy and paste the Application Secret and Application ID from there.

Haven't created an application yet? Don't worry, it's easy!

  1. Go to this link to create your application: Facebook Application List
  2. After creating the application, put %s in as the Connect URL on the Connect Tab.
  3. You can get the information from the application on the Facebook Application List page.
  4. Select the application you created, then copy and paste the Application Secret, and Application ID from there.

SFC-Plugins

Each separate plugin can be enabled or disabled using the checkboxes below. Only enable the plugins you want to use, and the rest will not run at all! Here's a quick description of each plugin: