( $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 = '' . 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, '
' . SCOPER_VERSION) ) $theMessage = substr($theMessage, 0, $ver_pos); $theMessage = str_replace( "'", ''', $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( '"', '"', $theMessage ); $msg .= '
' . $theMessage . ''; } if ( strpos( $msg, '' ) ) { $more_caption = __( 'read more...', 'scoper'); $msg = preg_replace( '/\<\!\-\-more\-\-\>/', '' . $more_caption . ''; } else $msg .= '
'; $msg .= '' . __('Read about the update', 'scoper') . ''; $msg .= '   ' . __('View full changelog', 'scoper') . ''; if ( version_compare( strval($theVersion), '1.0.0', '>=' ) ) { $url = awp_plugin_update_url( SCOPER_BASENAME ); $msg .= '   ' . __awp('Upgrade Automatically') . ''; } else $msg .= '   ' . __('Download for manual install', 'scoper') . ''; // slick method copied from NextGEN Gallery plugin add_action('admin_notices', create_function('', 'echo \'

' . $msg . '

\';')); } } 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 []= "$title"; $msg = '' . sprintf(__( "Role Scoper Extensions are available for the following plugins: %s", "scoper" ), implode(', ', $plugin_array) ) . '
'; // slick method copied from NextGEN Gallery plugin add_action('admin_notices', create_function('', 'echo \'

' . $msg . '

\';')); } } } } ?>