Ejemplo n.º 1
0
 public function update($new_instance, $old_instance)
 {
     $instance = $old_instance;
     $instance['title'] = strip_tags($new_instance['title']);
     $instance['skype_id'] = trim(strip_tags(stripslashes($new_instance['skype_id'])));
     $instance['user_name'] = trim(strip_tags(stripslashes($new_instance['user_name'])));
     if (current_user_can('unfiltered_html')) {
         $instance['before'] = $new_instance['before'];
         $instance['after'] = $new_instance['after'];
     } else {
         $instance['before'] = stripslashes(wp_filter_post_kses(addslashes($new_instance['before'])));
         // wp_filter_post_kses() expects slashed
         $instance['after'] = stripslashes(wp_filter_post_kses(addslashes($new_instance['after'])));
         // wp_filter_post_kses() expects slashed
     }
     if ($new_instance['button_theme'] != '') {
         // then get template file content to load into db
         $instance['button_template'] = stripslashes(Skype_Online_Status::get_template_file($new_instance['button_theme']));
     } else {
         $instance['button_template'] = '';
     }
     $instance['button_theme'] = stripslashes($new_instance['button_theme']);
     $instance['use_voicemail'] = $new_instance['use_voicemail'];
     return $instance;
 }
Ejemplo n.º 2
0
		echo "<div class=\"error fade\"><p>".__('The security settings on your server are too tight for the online status to be read from the Skype server.', 'skype-online-status').__('Please, check if one of the following options can be met -or- ask your server admin / hosting provider to take care of this.', 'skype-online-status')."</p><ul><li>".__('Install and activate cURL libraries on the server (preferred)', 'skype-online-status')."</li><li>".__('Upgrade PHP to a version that includes fsockopen (PHP 4+)', 'skype-online-status')."</li><li>".__('Change INI setting <strong>allow_url_fopen</strong> to ON (not advised)', 'skype-online-status')."</li></ul><p>".__('Reading your online status from the remote Skype server has been disabled. As a result, some of the advanced options will not be available. However, Skype button themes that also show your online status by way of images (that are provided by the same Skype server) will still do so.')."</p></div>";
	}*/
?>

<!--	<div id="loading" class="error fade"><p><strong><?php 
//_e('Please, wait while page has loaded completely.<br /> When the Skype server at http://mystatus.skype.com/ is slow or down, this might take a while...', 'skype-online-status')
?>
</strong></p></div>
-->
<?php 
// update the options if form is saved
if (!empty($_POST['skype_status_update'])) {
    // pressed udate button
    if ($_POST['button_theme'] != "custom_edit") {
        // get template file content to load into db
        $_POST['button_template'] = Skype_Online_Status::get_template_file($_POST['button_theme']);
    }
    $skype_id_array = array('');
    if (isset($_POST['skype_id'])) {
        $skype_id_array = explode("@", str_replace("live:", "", $_POST['skype_id']));
    }
    $option = array("skype_id" => $skype_id_array[0], "user_name" => isset($_POST['user_name']) ? $_POST['user_name'] : '', "button_theme" => isset($_POST['button_theme']) ? $_POST['button_theme'] : '', "button_template" => isset($_POST['button_template']) ? stripslashes($_POST['button_template']) : '', "use_function" => isset($_POST['use_function']) ? $_POST['use_function'] : '', "use_voicemail" => isset($_POST['use_voicemail']) ? $_POST['use_voicemail'] : '', "use_buttonsnap" => isset($_POST['use_buttonsnap']) ? $_POST['use_buttonsnap'] : '', "local_images" => isset($_POST['local_images']) ? $_POST['local_images'] : '', "no_scheme" => isset($_POST['no_scheme']) ? $_POST['no_scheme'] : '', "add_text" => isset($_POST['add_text']) ? $_POST['add_text'] : '', "call_text" => isset($_POST['call_text']) ? $_POST['call_text'] : '', "chat_text" => isset($_POST['chat_text']) ? $_POST['chat_text'] : '', "sendfile_text" => isset($_POST['sendfile_text']) ? $_POST['sendfile_text'] : '', "userinfo_text" => isset($_POST['userinfo_text']) ? $_POST['userinfo_text'] : '', "voicemail_text" => isset($_POST['voicemail_text']) ? $_POST['voicemail_text'] : '', "seperator1_text" => isset($_POST['seperator1_text']) ? $_POST['seperator1_text'] : '', "use_getskype" => isset($_POST['use_getskype']) ? $_POST['use_getskype'] : '', "getskype_newline" => isset($_POST['getskype_newline']) ? $_POST['getskype_newline'] : '', "getskype_text" => isset($_POST['getskype_text']) ? $_POST['getskype_text'] : '', "getskype_link" => isset($_POST['getskype_link']) ? $_POST['getskype_link'] : '', "getskype_custom_link" => isset($_POST['getskype_custom_link']) ? $_POST['getskype_custom_link'] : '');
    $option = array_merge(Skype_Online_Status::$config, $option);
    // strip nostatus flag after settings have been updated
    if (isset($option['nostatus'])) {
        unset($option['nostatus']);
    }
    update_option('skype_status', $option);
    echo "<div id=\"notice\" class=\"updated fade\"><p><strong>" . __('Options updated!', 'skype-online-status') . "</strong></p></div>";
    Skype_Online_Status::$config = $option;
} else {