'; //~ return preg_replace('#'.$search.'#', $fbp_content.$search, $content); } function fbp_init() { global $template, $conf, $user; // define ID $template->assign('FACEBOOK_APP_ID', (is_numeric($conf['fbp']['facebook_app_id']) ? $conf['fbp']['facebook_app_id'] : FACEBOOK_APP_ID)); // define language $template->assign('LANGUAGE', $user['language']); $template->assign('fbp', $conf['fbp']); $template->smarty->register_modifier('boolean_to_string', 'boolean_to_string'); if (trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init'])) { // set prefilter $template->set_prefilter('header', 'fbp_header'); $template->set_filename('fbp_init.fb', FBP_DIR.'/tpl/init.fb.tpl'); $template->append('head_elements', $template->parse('fbp_init.fb', true)); } if ( (script_basename() == 'index') and ($conf['fbp']['social_plugin_activity_feed']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled']) ) { $template->block_html_head('', '', $smarty, $repeat); } } function fbp_do_facebook_init($do_it) { global $conf; return $do_it or ( ( (script_basename() == 'picture') and ($conf['fbp']['social_plugin_like_button']['enabled'] or $conf['fbp']['social_plugin_facepile']['enabled'] or $conf['fbp']['social_plugin_comments']['enabled']) ) or ( (script_basename() == 'index') and ($conf['fbp']['social_plugin_activity_feed']['enabled'] or $conf['fbp']['social_plugin_like_box']['enabled']) ) or ( (script_basename() == 'admin') and (isset($_GET['page']) and $_GET['page'] == 'plugin') and (isset($_GET['section']) and strtok($_GET['section'], '/') == 'FacebookPlug') ) ) ; } add_event_handler('fbp_do_facebook_init', 'fbp_do_facebook_init'); //~ if (trigger_event('fbp_do_facebook_init', $conf['fbp']['force_facebook_init'])) //~ { add_event_handler('init', 'fbp_init'); //~ } ?>