コード例 #1
0
function weaverii_save_opts($who = '')
{
    // Save options
    // Here's the strategy. Using weaverii_getopt always loads the cache if it hasn't been.
    // Using weaverii_setopt will save the cache to the database by default
    // So we take advantage of this by bumping the style version, and using weaverii_setopt,
    // which saves to the database
    if (weaverii_no_settings()) {
        // don't save before user has set something
        return;
    }
    if (weaverii_f_file_access_available()) {
        // and now is the time to update the style file
        require_once 'generatecss.php';
        weaverii_save_current_css();
    }
}
コード例 #2
0
function weaverii_check_version($diag = false)
{
    $existing_vers = weaverii_getopt('wii_version_id');
    $version = WEAVERII_VERSION;
    if (!weaverii_submitted('reset_weaverii') && !weaverii_no_settings()) {
        //weaverii_save_msg('Current version:' . $version . ' DB version:' . $existing_vers);
        if ($version != $existing_vers) {
            weaverii_setopt('wii_version_id', $version);
            // update to latest...
            weaverii_save_opts('weaverii_check_version');
            weaverii_save_msg('The options settings have been updated for the current version of ' . WEAVERII_THEMENAME . '. (' . $version . ')');
        }
    }
    //if (weaverii_getopt('_wii_hide_updatemsg')) return;	// always ignore this now.
    if (WEAVERII_THEMENAME == 'Weaver II Pro') {
        $check_site = 'http://weaverthemepro.wordpress.com';
        $home_site = 'http://weavertheme.com';
        $msg = ') is available in the member downloads area at <a href="http://pro.weavertheme.com" target="_blank">pro.WeaverTheme.com</a>.<br />
        <ol><li>Login to <a href="http://pro.weavertheme.com" target="_blank">pro.WeaverTheme.com</a></li>
        <li>Open the "Members : Download : Download Weaver II Pro" menu</li>
        <li>Download the new version</li>
        <li>Use update option near the bottom of Save/Restore tab to update new version. (Requires Weaver II Theme Extras Plugin)</li>
        </ol>';
    } else {
        $check_site = 'http://weavertheme.wordpress.com';
        $home_site = 'http://weavertheme.com';
        $msg = ') is available in the downloads area at <a href="//weavertheme.com/download/" target="_blank">WeaverTheme.com/download/</a>.<br />
		<strong>Because of WordPress policy changes, updates will no longer be provided at <em>WordPress.org</em>!</strong><br />
		<strong>To update:</strong> Open the <em>Dashboard : Admin</em> panel. An option to update to the latest version should appear there.
		<br />Alternate update procedure:<br />
		<small>
        <ol><li>Go to <a href="//weavertheme.com/download/" target="_blank">weavertheme.com/download/</a></li>
        <li>Click on the "Weaver II" download link.</li>
        <li>Download the new version to your computer</li>
		<li>Install the <em>Weaver II Theme Extras</em> <a href="https://wordpress.org/plugins/weaver-ii-theme-extras/" target="_blank">plugin</a> from WordPress.org.</li>
        <li>Use update option near the bottom of Save/Restore tab to update to the new version. (Requires Weaver II Theme Extras Plugin)</li>
        </ol></small>';
    }
    $latest = weaverii_latest_version($check_site);
    // check if newer version is available
    if (stripos($latest, 'announcement') !== false) {
        weaverii_save_msg($latest . ' - Please check <a href="' . $home_site . '" target="_blank">' . $home_site . 'for an announcement.</a>.');
    } else {
        if ($latest != 'unavailable' && version_compare($version, $latest, '<')) {
            $saveme = 'Current ' . WEAVERII_THEMENAME . ' version is ' . $version . '. A newer version (' . $latest . $msg;
            if ($diag) {
                return $saveme;
            }
            weaverii_save_msg($saveme);
        } else {
            if ($diag) {
                return 'Current ' . WEAVERII_THEMENAME . ' version is ' . $version . '. You have the latest version.';
            }
        }
    }
    return '';
}
コード例 #3
0
ファイル: lib-admin.php プロジェクト: mystified7545/MyBlog
function weaverii_check_version($force = false)
{
    $existing_vers = weaverii_getopt('wii_version_id');
    $version = WEAVERII_VERSION;
    if (!weaverii_submitted('reset_weaverii') && !weaverii_no_settings()) {
        //weaverii_save_msg('Current version:' . $version . ' DB version:' . $existing_vers);
        if ($version != $existing_vers) {
            weaverii_setopt('wii_version_id', $version);
            // update to latest...
            weaverii_save_opts('weaverii_check_version');
            weaverii_save_msg('The options settings have been updated for the current version of ' . WEAVERII_THEMENAME . '. (' . $version . ')');
        }
    }
    if (weaverii_getopt('_wii_hide_updatemsg')) {
        return;
    }
    if (WEAVERII_THEMENAME == 'Weaver II Pro') {
        $check_site = 'http://weaverthemepro.wordpress.com';
        $home_site = 'http://weavertheme.com';
        $msg = ') is available in the member downloads area at <a href="http://pro.weavertheme.com" target="_blank">pro.WeaverTheme.com</a>.<br />
        <ol><li>Login to <a href="http://pro.weavertheme.com" target="_blank">pro.WeaverTheme.com</a></li>
        <li>Open the "Members : Download : Download Weaver II Pro" menu</li>
        <li>Download the new version</li>
        <li>Use update option near the bottom of Save/Restore tab to update new version. (Requires Weaver II Theme Extras Plugin)</li>
        </ol>';
    } else {
        $check_site = 'http://weavertheme.wordpress.com';
        $home_site = 'http://weavertheme.com';
        $msg = ') is available available now or very soon from WordPress.org.<br /> The latest version is always available at <a href="http://weavertheme.com" target="_blank">WeaverTheme.com</a>.';
    }
    if (WEAVERII_THEMENAME == 'Weaver II Pro' || $force) {
        $latest = weaverii_latest_version($check_site);
        // check if newer version is available
        if (stripos($latest, 'announcement') !== false) {
            weaverii_save_msg($latest . ' - Please check <a href="' . $home_site . '" target="_blank">' . $home_site . 'for an announcement.</a>.');
        } else {
            if ($latest != 'unavailable' && version_compare($version, $latest, '<')) {
                $saveme = 'Current ' . WEAVERII_THEMENAME . ' version is ' . $version . '. A newer version (' . $latest . $msg;
                if ($force) {
                    return $saveme;
                }
                weaverii_save_msg($saveme);
            } else {
                if ($force) {
                    return 'Current ' . WEAVERII_THEMENAME . ' version is ' . $version . '. You have the latest version.';
                }
            }
        }
    }
    return '';
}