コード例 #1
0
printf(__('%1$s Submit technical feedback%2$s, including improvement requests.', 'scoper'), '<a href="http://agapetry.net/forum/">', '</a>');
echo '</li><li>';
printf(__('%1$s Submit a case study%2$s, explaining how Role Scoper helps you do something excellent and praiseworthy.', 'scoper'), '<a href="http://agapetry.net/forum/">', '</a>');
echo '</li><li>';
printf(__('%1$s Localize Role Scoper%2$s to your own language %3$s using poEdit%4$s ', 'scoper'), '<a href="http://weblogtoolscollection.com/archives/2007/08/27/localizing-a-wordpress-plugin-using-poedit/">', '</a>', '<a href="http://weblogtoolscollection.com/archives/2007/08/27/localizing-a-wordpress-plugin-using-poedit/">', '</a>');
echo '</li><li>';
$paypal_button = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" class="donate"><input type="hidden" name="cmd" value="_s-xclick" /> <input type="image" style="background:none" src="http://agapetry.net/btn_donate_SM.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" /> <img alt="" border="0" src="http://agapetry.net/pixel.gif" width="1" height="1" style="opacity:0.01;" /> <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBJ1SuZO67UwhfCgc0+nCBqoUlS+HeYvGJXiTHpd6jxN8kls6JQdxU917u9kVx99bZUEaPVoqgHX6hQ0locnaTCG04T0qgkpf/vuzVj5JFSxWscETkgsLUOe0uKbcFvD4amNjgd1qrF/9hIpyWW6onv2vaVKk92WZOL7TShKT9wbDELMAkGBSsOAwIaBQAwgcQGCSqGSIb3DQEHATAUBggqhkiG9w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BAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDgwNTEyMjAxNzEzWjAjBgkqhkiG9w0BCQQxFgQUREfauO+XY0Sx3gWNIf32ThKhGwAwDQYJKoZIhvcNAQEBBQAEgYBwz6QrznijNgQD/CjHJSAALEWI1bxRELLjnE1Cb29foQyB7WgDIyIpVMDwp0anrBKavtIOe202qN6pEHrEDvNCaC1EaX3uoV2d5eQ2xMHCTyVFAELMf72HABuzkReTlZhBHyQYR/17IEaOS3ixGb5CGMNWFn6oPtdmx+DEuF0dqg==-----END PKCS7-----
" /></form>';
printf(__('If the plugin has seriously broadened your CMS horizons, %s', 'scoper'), $paypal_button);
echo '</li><li>';
printf(__('If you are an established web developer, %1$s grant me your professional opinion%2$s on how this work stacks up. Might the skills, work ethic and values I express here fit into a development team near you?', 'scoper'), '<a href="http://agapetry.net/general-contact-form/">', '</a>');
echo '</li><li>';
// TODO: update translations once poEdit update is available to fix _x and _n handling
if (defined('WPLANG') && WPLANG) {
    printf(__('Hire or refer my services</a> to design, redesign or enhance your site - quality care at reasonable rates.', 'scoper'), '<a href="http://agapetry.net/service-exploration-form/">', '</a>');
} else {
    printf(__('Hire or refer my services</a> to develop or enhance your site - quality care at reasonable rates.', 'scoper'), '<a href="http://agapetry.net/service-exploration-form/">', '</a>');
}
echo '</li></ul>';
//if ( $status = awp_remote_fopen( 'http://localhost/aglocal/downloads/status.htm', 5) )
if ($status = awp_remote_fopen('http://agapetry.net/downloads/status.htm', 5)) {
    echo $status;
}
echo '</div>';
//rc-about-dialog
if (!agp_is_ie6()) {
    echo '<div class="madein alignright" style="margin-right: 1em;">&nbsp;</div>';
}
echo '<div style="height: 150px;">&nbsp;</div>';
echo '</div>';
//wrap
コード例 #2
0
function scoper_new_version_notice()
{
    $rechecked = false;
    $check_minutes = scoper_get_option('version_check_minutes');
    $last_check = scoper_get_option('last_version_update_check');
    if (time() - $last_check > $check_minutes * 60 || !($vcheck = get_site_option('scoper_version_info'))) {
        $vcheck = wp_remote_fopen('http://agapetry.net/downloads/role-scoper_version.chk');
        $rechecked = true;
        update_option('scoper_version_info', $vcheck);
    }
    if ($vcheck) {
        if (time() - $last_check > $check_minutes * 60 || !($vcheck_ext = get_site_option('scoper_extension_info'))) {
            $vcheck_ext = awp_remote_fopen('http://agapetry.net/downloads/role-scoper-extensions.chk', 5);
            $rechecked = true;
            update_option('scoper_extension_info', $vcheck_ext);
        }
    } else {
        $vcheck_ext = false;
    }
    if ($rechecked) {
        update_option('scoper_last_version_update_check', time());
    }
    if ($vcheck) {
        $status = explode('@', $vcheck);
        $theVersion = $status[1];
        if (version_compare(strval($theVersion), strval(SCOPER_VERSION), '>') == 1) {
            $msg = '<strong>' . sprintf(__("A new version of Role Scoper is available (%s)", "scoper"), $theVersion);
            if ($rechecked || !($vcheck = get_site_option('scoper_version_message'))) {
                $vcheck = awp_remote_fopen('http://agapetry.net/downloads/role-scoper.chk', 5);
                add_site_option('scoper_version_message', $vcheck);
            }
            if ($vcheck) {
                $status = explode('@', $vcheck);
                $theMessage = $status[3];
                if ($ver_pos = strpos($theMessage, '<br />' . SCOPER_VERSION)) {
                    $theMessage = substr($theMessage, 0, $ver_pos);
                }
                $theMessage = str_replace("'", '&#39;', $theMessage);
                // Despite this precaution, don't include apostrophes in .chk file because older RS versions (< 1.0.0-rc9) will choke on it.
                $theMessage = str_replace('"', '&quot;', $theMessage);
                $msg .= '</strong><small>' . $theMessage . '</small>';
            }
            if (strpos($msg, '<!--more-->')) {
                $more_caption = __('read more...', 'scoper');
                $msg = preg_replace('/\\<\\!\\-\\-more\\-\\-\\>/', '<a href="javascript:void(0)" onclick="rs_display_version_more();">' . $more_caption . '</a><p id="rs_version_more" class="rs_more" style="display:none;">', $msg, 1);
                $msg .= '</p>';
            } else {
                $msg .= '<br />';
            }
            $msg .= '<a href="http://agapetry.net/category/role-scoper/" target="_blank">' . __('Read about the update', 'scoper') . '</a>';
            $msg .= '&nbsp;&nbsp;&nbsp;<a href="http://wordpress.org/extend/plugins/role-scoper/changelog/" target="_blank">' . __('View full changelog', 'scoper') . '</a>';
            if (version_compare(strval($theVersion), '1.0.0', '>=')) {
                $url = awp_plugin_update_url(SCOPER_BASENAME);
                $msg .= '&nbsp;&nbsp;&nbsp;<a href="' . $url . '">' . __awp('Upgrade Automatically') . '</a>';
            } else {
                $msg .= '&nbsp;&nbsp;&nbsp;<a href="http://agapetry.net/downloads/role-scoper_current" target="_blank">' . __('Download for manual install', 'scoper') . '</a>';
            }
            // slick method copied from NextGEN Gallery plugin
            add_action('admin_notices', create_function('', 'echo \'<div id="rs-ver_msg" class="plugin-update rs-ver_msg fade" style="margin:0;"><p>' . $msg . '</p></div>\';'));
        }
    }
    if ($vcheck_ext) {
        $plugin_titles = array();
        $plugin_links = array();
        if ($extensions = explode(';', $vcheck_ext)) {
            foreach ($extensions as $ext) {
                if ($ext_info = explode(',', $ext)) {
                    if (count($ext_info) < 4) {
                        continue;
                    }
                    if (($plugin_file = awp_is_plugin_active($ext_info[0])) && !awp_is_plugin_active($ext_info[1])) {
                        $plugin_path = WP_CONTENT_DIR . '/plugins/' . $plugin_file;
                        if (file_exists($plugin_path)) {
                            $plugin_data = implode('', file($plugin_path));
                            preg_match('|Plugin Name:(.*)$|mi', $plugin_data, $name);
                            if ($name) {
                                $name = trim($name[1]);
                                $plugin_titles[$ext_info[0]] = $name;
                                if (false === strpos($ext_info[3], 'wp_repository') || false !== strpos($ext_info[3], 'is_alpha')) {
                                    $plugin_links[$ext_info[0]] = "http://agapetry.net/category/role-scoper-extensions/";
                                } else {
                                    $plugin_links[$ext_info[0]] = awp_plugin_info_url($ext_info[2]);
                                }
                            }
                        }
                    }
                }
            }
            $plugins = get_option('active_plugins');
            if ($plugin_titles) {
                $plugin_array = array();
                foreach ($plugin_titles as $name => $title) {
                    $plugin_array[] = "<a href=\"{$plugin_links[$name]}\">{$title}</a>";
                }
                $msg = '<strong>' . sprintf(__("Role Scoper Extensions are available for the following plugins: %s", "scoper"), implode(', ', $plugin_array)) . '</strong><br />';
                // slick method copied from NextGEN Gallery plugin
                add_action('admin_notices', create_function('', 'echo \'<div id="rs-ext_ver_msg" class="plugin-update rs-ver_msg fade"><p>' . $msg . '</p></div>\';'));
            }
        }
    }
}