$Value) { //Compatible with previous versions if($key=='chatid'){ if($Arr1['chat_id']['value']==''){ $Arr1['chat_id']['value'] = $Value; } } if(array_key_exists($key, $Arr1)) $Arr1[$key]['value'] = $Value; } return $Arr1; } //widget header js function fcchat_add_header_js(){ global $fcchat_options,$fcchat_plugin_url; if (!is_admin()){ $fcchat_options = get_fcchat_widget_options(); echo ''; } } //widget scripts function fcchat_add_header_scripts(){ $fcchat_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); if (!is_admin()){ wp_register_script('fc-chat-import-google.loader', $fcchat_plugin_url.'/js/import.google.loader.js'); wp_enqueue_script('fc-chat-import-google.loader'); wp_register_script('fc-chat-import-config', $fcchat_plugin_url.'/js/import.config.alt.php?path='.str_ireplace(array(".","http"), array("||period||","||protocol||"), $fcchat_plugin_url).'&t=1'); wp_enqueue_script('fc-chat-import-config'); wp_register_script('fc-chat-import-libs', $fcchat_plugin_url.'/js/import.libs.js'); wp_enqueue_script('fc-chat-import-libs'); wp_register_script('fc-chat-import-includes', $fcchat_plugin_url.'/js/import.includes.js'); wp_enqueue_script('fc-chat-import-includes'); } } //widget header js function fcchat_add_header_js_after(){ global $fcchat_options,$fcchat_plugin_url; if (!is_admin()&&$fcchat_options['template_overrides']['value']!=""){ echo ''; } } function fcchat_add_footer_script(){ $fcchat_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); if (!is_admin()){ echo ''; } } // Inserts scripts into page add_action( 'wp_print_scripts', 'fcchat_add_header_js' ); add_action('wp_enqueue_scripts', 'fcchat_add_header_scripts'); add_action('wp_head','fcchat_add_header_js_after'); add_action('wp_footer','fcchat_add_footer_script'); //the widget function fcchat_widget_init() { if ( !function_exists('register_sidebar_widget') ) return; //Echo widget to sidebar function fcchat_widget($args) { global $fcchat_options; extract($args); //$fcchat_options = get_fcchat_widget_options(); $fcchat_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); echo $before_widget; echo $before_title . $fcchat_options['title']['value'] . $after_title; echo '
'; echo $after_widget; } //widget control form function fcchat_widget_control() { $fcchat_options = get_fcchat_widget_options(); $fcchat_options2 = array(); //unset($fcchat_options[0]); //returned by get_option(), but we don't need it // If user is submitting custom option values for this widget if ( $_POST['fcchat-submit'] ) { // Remember to sanitize and format use input appropriately. foreach($fcchat_options as $key => $value){ if(isset($_POST['fcchat-'.$key])){ $fcchat_options[$key]['value'] = str_replace('"', '"', stripslashes($_POST['fcchat-'.$key])); } $fcchat_options2[$key] = $fcchat_options[$key]['value']; } // Save changes update_option('fcchat_widget', $fcchat_options2); } //Go to activation page echo 'Step 1: Click here to activate your chat
'; //Upgrade notice echo 'Upgrade notice: If you are upgrading from a previous version, please read the Upgrade Notice.
Upgrading from a version prior to 2.1.8 requires that you obtain a new chat ID from the link above.
Step 2: Enter your activation info below, and press save.
'; //Title echo ''; //Host echo ''; //Chat ID echo ''; //Links echo 'Here are some other helpful links:
'; echo ''; echo ''; echo 'If you need assistance, or have any ideas on making this product better, please contact us at support@fastcatsoftware.com
'; // Submit echo ''; } // This registers our widget so it appears with the other available // widgets and can be dragged and dropped into any active sidebars. //register_sidebar_widget('FCChat Widget', 'fcchat_widget'); wp_register_sidebar_widget( 'fcchat-widget', 'FCChat Widget', 'fcchat_widget'); // This registers our optional widget control form. wp_register_widget_control('fcchat-widget', 'FCChat Widget', 'fcchat_widget_control'); } // Run code later in case this loads prior to any required plugins. add_action('plugins_loaded', 'fcchat_widget_init'); //Administration page // mt_settings_page() displays the page content for the FCChat settings submenu function fcchat_settings_page() { //must check that the user has the required capability if (!current_user_can('manage_options')) { wp_die( __('You do not have sufficient permissions to access this page.') ); } $fcchat_options = get_fcchat_widget_options(); $fcchat_options2 = array(); //unset($fcchat_options[0]); //returned by get_option(), but we don't need it // If user is submitting custom option values for this widget if ( $_POST['fcchat-settings-submit'] && $_POST['fcchat-settings-submit']=='1') { // Remember to sanitize and format use input appropriately. foreach($fcchat_options as $key => $value){ if(isset($_POST['fcchat-'.$key])){ if($key!='custom_buttons'&&$key!='templates'&&$key!='quickstyling'&&$key!='template_overrides'){ $fcchat_options[$key]['value'] = str_replace('"', '"', stripslashes($_POST['fcchat-'.$key])); }else{ $fcchat_options[$key]['value'] = stripslashes($_POST['fcchat-'.$key]); } } $fcchat_options2[$key] = $fcchat_options[$key]['value']; } // Save changes update_option('fcchat_widget', $fcchat_options2) // Put an settings updated message on the screen ?>