コード例 #1
0
    update_option('dsq_external_js', isset($_POST['dsq_external_js']) ? '1' : '0');
    update_option('disqus_manual_sync', isset($_POST['disqus_manual_sync']));
    update_option('disqus_disable_ssr', isset($_POST['disqus_disable_ssr']));
    update_option('disqus_public_key', isset($_POST['disqus_public_key']) ? esc_attr($_POST['disqus_public_key']) : '');
    update_option('disqus_secret_key', isset($_POST['disqus_secret_key']) ? esc_attr($_POST['disqus_secret_key']) : '');
    // Handle SSO button uploads
    if (version_compare($wp_version, '3.5', '>=')) {
        // Use WP 3.5's new, streamlined, much-improved built-in media uploader
        // Only update if a value is actually POSTed, otherwise any time the form is saved the button will be un-set
        if ($_POST['disqus_sso_button']) {
            update_option('disqus_sso_button', isset($_POST['disqus_sso_button']) ? esc_url($_POST['disqus_sso_button']) : '');
        }
    } else {
        // WP is older than 3.5, use legacy, less-elegant media uploader
        if (isset($_FILES['disqus_sso_button'])) {
            dsq_image_upload_handler('disqus_sso_button');
        }
    }
    dsq_manage_dialog(dsq_i('Your settings have been changed.'));
}
// handle disqus_active
if (isset($_POST['active']) && isset($_GET['active'])) {
    update_option('disqus_active', $_GET['active'] == '1' ? '1' : '0');
}
$dsq_user_api_key = isset($_POST['dsq_user_api_key']) ? $_POST['dsq_user_api_key'] : null;
// Get installation step process (or 0 if we're already installed).
$step = @intval($_GET['step']);
if ($step > 1 && $step != 3 && $dsq_user_api_key) {
    $step = 1;
} elseif ($step == 2 && !isset($_POST['dsq_username'])) {
    $step = 1;
コード例 #2
0
ファイル: manage.php プロジェクト: hscale/webento
    update_option('disqus_forum_url', $disqus_forum_url);
    update_option('disqus_partner_key', trim(stripslashes($_POST['disqus_partner_key'])));
    update_option('disqus_api_key', trim(stripslashes($_POST['disqus_api_key'])));
    update_option('disqus_user_api_key', trim(stripslashes($_POST['disqus_user_api_key'])));
    update_option('disqus_replace', $_POST['disqus_replace']);
    update_option('disqus_cc_fix', isset($_POST['disqus_cc_fix']));
    update_option('disqus_manual_sync', isset($_POST['disqus_manual_sync']));
    update_option('disqus_disable_ssr', isset($_POST['disqus_disable_ssr']));
    update_option('disqus_public_key', $_POST['disqus_public_key']);
    update_option('disqus_secret_key', $_POST['disqus_secret_key']);
    // Handle any SSO button and icon uploads
    if (isset($_FILES['disqus_sso_button'])) {
        dsq_image_upload_handler('disqus_sso_button');
    }
    if (isset($_FILES['disqus_sso_icon'])) {
        dsq_image_upload_handler('disqus_sso_icon');
    }
    dsq_manage_dialog('Your settings have been changed.');
}
// handle disqus_active
if (isset($_GET['active'])) {
    update_option('disqus_active', $_GET['active'] == '1' ? '1' : '0');
}
$dsq_user_api_key = isset($_POST['dsq_user_api_key']) ? $_POST['dsq_user_api_key'] : null;
// Get installation step process (or 0 if we're already installed).
$step = @intval($_GET['step']);
if ($step > 1 && $step != 3 && $dsq_user_api_key) {
    $step = 1;
} elseif ($step == 2 && !isset($_POST['dsq_username'])) {
    $step = 1;
}