';
return $content;
}
/**
* Include internal stylesheet.
*
* @action: wp_head, login_head
**/
function style() {
if ( file_exists( TEMPLATEPATH . '/fbconnect.css') ){
$css_path = get_template_directory_uri() . '/fbconnect.css?ver='.FBCONNECT_PLUGIN_REVISION;
}else{
//$css_path = get_option('siteurl') . '/' . PLUGINDIR . '/fbconnect/fbconnect.css?ver='.FBCONNECT_PLUGIN_REVISION;
$css_path = FBCONNECT_PLUGIN_URL . '/fbconnect.css?ver='.FBCONNECT_PLUGIN_REVISION;
}
echo '';
}
/**
* Modify comment form.
*
* @action: comment_form
**/
function comment_form() {
$fb_user = fb_get_loggedin_user();
if (is_user_logged_in() && $fb_user) {
echo '';
echo ''.__('Publish this comment to Facebook', 'fbconnect');
}
}
/**
* Spam up the admin interface with warnings.
**/
function admin_notices_plugin_problem_warning() {
echo'
'.__('The WordPress fbconnect plugin is not active.', 'fbconnect').'';
printf(_('Check %sfbconnect Options%s for a full diagnositic report.', 'fbconnect'), '', '');
echo '
';
}
/**
* Setup admin menus for fbconnect options and ID management.
*
* @action: admin_menu
**/
function add_admin_panels() {
$hookname = add_options_page(__('fbconnect options', 'fbconnect'), __('Facebook Connector', 'fbconnect'), 8, 'global-fbconnect-options',
array( 'WPfbConnect_Interface', 'options_page') );
add_action("admin_head-$hookname", array( 'WPfbConnect_Interface', 'js_setup' ));
add_action("admin_head-$hookname", array( 'WPfbConnect_Interface', 'style' ));
}
function register_feed_forms($fb_online_stories,$fb_short_stories_title,$fb_short_stories_body,$fb_full_stories_title,$fb_full_stories_body) {
$one_line_stories = $short_stories = $full_stories = array();
$one_line_stories[] = $fb_online_stories;
$short_stories[] = array('template_title' => $fb_short_stories_title,
'template_body' => $fb_short_stories_body);
$full_stories = array('template_title' => $fb_full_stories_title,
'template_body' => $fb_full_stories_body);
$form_id = fb_feed_registerTemplateBundle($one_line_stories,$short_stories,$full_stories);
return $form_id;
}
/*
* Display and handle updates from the Admin screen options page.
*
* @options_page
*/
function options_page() {
global $wp_version, $fbconnect;
// if we're posted back an update, let's set the values here
if ( isset($_POST['info_update']) ) {
check_admin_referer('wp-fbconnect-info_update');
$error = '';
update_option( 'fb_api_key', $_POST['fb_api_key'] );
update_option( 'fb_api_secret', $_POST['fb_api_secret'] );
update_option( 'fb_enable_commentform', isset($_POST['enable_commentform']) ? true : false );
update_option( 'fb_enable_approval', isset($_POST['enable_approval']) ? true : false );
update_option( 'fb_add_post_share', isset($_POST['fb_add_post_share']) ? true : false );
update_option( 'fb_use_ssl', isset($_POST['fb_use_ssl']) ? true : false );
update_option( 'fb_use_fbml', isset($_POST['fb_use_fbml']) ? true : false );
if ($error !== '') {
echo '
'.__('At least one of Facebook Connector options was NOT updated', 'fbconnect').''.$error.'