$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.

'; echo '

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 '

FCChat Configuration Topics

'; echo '

FCChat Manual

'; 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 ?>

'; // header echo "

" . __( 'FCChat Plugin Settings', 'menu-test' ) . "

"; // settings form ?>
FCChat Manual. Some additional tutorials are found in the User Guide. You can restore all the settings to their default values by pressing the reset button below.', 'menu-test' ); echo '

'; foreach($fcchat_options as $key => $value){ if($fcchat_options[$key]['type']=='comment'){ echo '

'; _e($fcchat_options[$key]['desc'], 'menu-test' ); echo '

'; }else if($fcchat_options[$key]['type']=='text'){ echo '

' . _e($fcchat_options[$key]['desc'], 'menu-test' ); echo '' . $key . '  '; echo '


'; }else if($fcchat_options[$key]['type']=='radio'){ echo '

' . $key . '  ' . _e($fcchat_options[$key]['desc'], 'menu-test' ); echo ' Yes     no '; echo '


'; }else if($fcchat_options[$key]['type']=='textarea'){ echo '

' . _e($fcchat_options[$key]['desc'], 'menu-test' ); echo '  ' . $key . '
  '; echo '


'; }else if($fcchat_options[$key]['type']=='hidden'){ }else{ echo '

' . $key . '  ' . _e($fcchat_options[$key]['desc'], 'menu-test' ); foreach($fcchat_options[$key]['ops'] as $op => $val){ echo ' ' . $fcchat_options[$key]['ops'][$op]['desc'] . '   '; } echo '


'; } } ?>

$value){ if($key=='updates'){ if(strpos($value , "update 3.0;") !== false){ $updated=true; } $updates_found=true; } } if(!$updates_found){ $fcchat_options['updates']='update 3.0;'; }else{ if(!$updated){ $fcchat_options['updates']+='update 3.0;'; } } // apply 3.0 updates if(!$updated){ foreach($fcchat_options as $key => $value){ if($key=='forum_proxy'){ $proxy=""; if(strpos($value , "wordpress_proxy")){ $proxy="wordpress"; } if(strpos($value , "wordpress_proxy2")){ $proxy="wordpress2"; } if(strpos($value , "joomla")){ $proxy="joomla"; } if(strpos($value , "phpbb3")){ $proxy="phpbb"; } if(strpos($value , "smf")){ $proxy="smf"; } if(strpos($value , "mybb")){ $proxy="mybb"; } $fcchat_options['user_integration_bridge']=$proxy; } } $fcchat_options['startText']="Click here to join our chat."; $fcchat_options['loginText']="Please sign in to join our chat."; $fcchat_options['autoGreet']="Wellcome!! "; $fcchat_options['max_video_streams']="100"; $fcchat_options['avatars_dir']=""; $fcchat_options['images_dir']=""; $fcchat_options['smileys_dir']=""; $fcchat_options['avatar_sz']="18"; $fcchat_options['window_height_offset']="-160"; $fcchat_options['chat_room_height_offset']="105"; } }else{ $fcchat_options = array(); $fcchat_options['updates']='update 3.0;'; } // Save changes update_option('fcchat_widget', $fcchat_options); } register_activation_hook( __FILE__, 'fcchat_activate' ); ?>