__construct(); } /** * PHP5 constructor method. * * @since 0.1.0 */ function __construct() { // Add our plugin settings screen. add_action( 'admin_menu', array( $this, 'add_settings_screen' ) ); // Add our assorted plugin settings. add_action( 'admin_init', array( $this, 'add_individual_settings' ) ); // Load up our admin scripts add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) ); } /** * Javascript for settings screen. * * @since 0.1.0 */ public function scripts() { wp_enqueue_script( 'all-site-search-admin', plugins_url( 'all-site-search/scripts/all-site-search-admin.js' ), array( 'jquery' ), '0.2' ); } /** * Run the HTTP request and return the status results. * * @since 0.1.0 */ public function http_request( $email_address, $password, $check ) { $http_query = http_build_query( array( 'co' => 'f', 'fd' => 'allss_wpreg', 'tf' => 'als_wpreg', 'gi2' => get_site_url(), 'gi5' => $password, 'gi1' => $email_address, //'test' => 1, )); $url_base = 'http://www.allsitesearch.com/msearch?'; $url_complete = $url_base . $http_query; // Check if this is a check and we have data if ( $check == '1' ) { if ( $email_address != '' ) { $return['status'] = 1; $return['message'] = 'OK'; } else { $return['status'] = 0; $return['message'] = 'Failure. Not registered'; } } // wp_remote_get with response else { $response = wp_remote_get( $url_complete ); $response_content = $response['body']; // Let's format our returned response. if ( $response_content == 'OK') { $return['status'] = 1; $return['message'] = $response_content; } else if ( $response_content == 'Failure. Site already exists as registered' ) { $return['status'] = 1; $return['message'] = 'OK'; } else { $return['status'] = 0; $return['message'] = $response_content; } } return $return; } /** * Request to AllSiteSearch.com conditional. * * @since 0.1.0 */ public function should_display_registration( $email_address, $password ) { $http_return = $this->http_request( $email_address, $password, '1' ); // If the return is successful, then we don't need to display registration fields. if ( $http_return['status'] == 1 ) { $return = false; } else { $return = true; } return $return; } /** * Add our settings screen. * * @since 0.1.0 */ public function add_settings_screen() { add_options_page( 'All Site Search Options', 'All Site Search', 'manage_options', 'all_site_search', array( $this, 'settings_screen_display' ) ); } /** * The settings screen markup and sections. * * @since 0.1.0 */ public function settings_screen_display() { ?>

All Site Search

All Site Search is a free off-site All-Content Search Technology. Installing it will provide your site visitors with the most extensive and very best search experience. Satisfied visitors are returning visitors.

Note: Before continuing here,

1. Goto Settings / Permalinks and click in "Post name" and then on "Save Changes".
2. Under Pages, do Add New and create a page named: Search Site, with settings: Parent = no parent, Template = default.
3. When you (below) will do "Search Results Page", then choose "Search Site".

To install All Site Search on your site, fill out the fields below and click on the Register button, then fill out the fields for the plugin itself and click on the Save Changes button.

http_request( $options['email_field'], $options['password_field'], '0' ); ?> should_display_registration( $options['email_field'], $options['password_field'] ) ) { ?>

"; } /** * Output the password field. */ public function password_field() { $options = get_option( 'all_site_search' ); $value = esc_attr( $options[ 'password_field' ] ); echo "
"; } /** * Output the search results option. */ public function results_page() { $options = get_option( 'all_site_search' ); $value = $options['results_page']; wp_dropdown_pages( array( 'name' => 'all_site_search[results_page]', 'echo' => 1, 'show_option_none' => __( 'Select Page' ), 'option_none_value' => '0', 'selected' => absint( $value ), ) ); } /** * Output the search input width field. */ public function input_width() { $options = get_option( 'all_site_search' ); $value = esc_attr( $options[ 'input_width' ] ); echo "
"; } /** * Output the default form CSS checkbox. */ public function default_form_style() { $options = get_option( 'all_site_search' ); $html = ''; echo $html; } /** * Output the search within option checkbox. */ public function what_option() { $options = get_option( 'all_site_search' ); $html = ''; echo $html; } /** * Output the what option width field. */ public function what_option_width() { $options = get_option( 'all_site_search' ); $value = esc_attr( $options[ 'what_option_width' ] ); echo "
"; } /** * Output the sorting order checkbox. */ public function sort_option() { $options = get_option( 'all_site_search' ); $html = ''; echo $html; } /** * Output the sort order width field. */ public function sort_option_width() { $options = get_option( 'all_site_search' ); $value = esc_attr( $options[ 'sort_option_width' ] ); echo "
"; } /** * Output the robots excluded checkbox. */ public function robots_excluded() { $options = get_option( 'all_site_search' ); $html = ''; echo $html; } /** * Custom CSS URL. */ public function custom_css_url() { $options = get_option( 'all_site_search' ); $value = esc_attr( $options[ 'custom_css_url' ] ); echo "
"; } } $allsitesearch_options = new AllSiteSearch_Options();