.app/plugin.stuff/custom.pages/.cp/ // directory. // // 2. If:- // $page_slug === NULL // then we look for the page slug in:- // $_GET['page'] // (and it's a FATAL error if that GET variable doesn't exist). // // 3. If:- // $application_slug === NULL // then we look for the application slug in:- // $_GET['application'] // (and it's a FATAL error if that GET variable doesn't exist). // // 4. If:- // $custom_page_slug === NULL // then we look for the custom page slug in:- // $_GET['custom_page'] // (and it's a FATAL error if that GET variable doesn't exist). // // RETURNS // o On SUCCESS // $url STRING // // o On FAILURE // ARRAY( $error_message STRING ) // ------------------------------------------------------------------------- $page_slug = \greatKiwi_byFernTec_adSwapper_local_v0x1x211_appsAPI\get_page_query_variable_value() ; $application_slug = 'ad-swapper' ; // ------------------------------------------------------------------------- // Update Central Site // ------------------------------------------------------------------------- $custom_page_slug = 'update-central-site' ; // ------------------------------------------------------------------------- $update_central_site_url = \greatKiwi_byFernTec_adSwapper_local_v0x1x211_standardDatasetManager\get_custom_page_url( $core_plugapp_dirs , $page_slug , $application_slug , $custom_page_slug , $question_front_end ) ; // ------------------------------------------------------------------------- // Update Local Site // ------------------------------------------------------------------------- $custom_page_slug = 'update-local-site' ; // ------------------------------------------------------------------------- $update_local_site_url = \greatKiwi_byFernTec_adSwapper_local_v0x1x211_standardDatasetManager\get_custom_page_url( $core_plugapp_dirs , $page_slug , $application_slug , $custom_page_slug , $question_front_end ) ; // ------------------------------------------------------------------------- // Reload Ads List // ------------------------------------------------------------------------- $custom_page_slug = 'reload-ads-list' ; // ------------------------------------------------------------------------- $reload_ads_list_url = \greatKiwi_byFernTec_adSwapper_local_v0x1x211_standardDatasetManager\get_custom_page_url( $core_plugapp_dirs , $page_slug , $application_slug , $custom_page_slug , $question_front_end ) ; // ------------------------------------------------------------------------- // Synchronise // ------------------------------------------------------------------------- $synchronise_url = <<Reports // //
// //

This Report

// Blah blah blah... // //
// //
// ------------------------------------------------------------------------- $ul_style = <<Contact Us

// For direct support (or for any other reason whatsoever), // please use the Contact Form on the main Ad Swapper site.  We do our best to // respond to all requests/enquiries within 24 // hours. // //
// ------------------------------------------------------------------------- $page_content_proper = <<

Welcome to Ad Swapper {$sub_title} for
{$target_site_title}show/hide help

Ad Swapper allows you to exchange ads with other WordPress sites.  So WordPress sites can do unlimited free advertising on each other (apart from the rediculously small fees we charge for maintaining the Ad Swapper Central site and associated plugins).
EOT; // ------------------------------------------------------------------------- //
// From this screen, you can manage all the Ad Swapper advertising // related to this site.  Ie;
    // //
  • Create and upload to Ad // Swapper Central, the ads that you want to display on // other Ad Swapper sites,
  • // //
  • Select any Ad Swapper // SITES you don't want to display this site's ads // on.
        NB:  By default, this // site's ads will be displayed on all other Ad Swapper // sites,
  • // //
  • Select any Ad Swapper // ADS you don't want to display on this site.
        NB:  By default, all other // Ad Swapper site ads will be displayed on this site,
  • // //
  • Define the “Ad // Slots” (on this site), to display the other Ad Swapper // site ads in,
  • // //
  • etc...
  • // //
// // Good luck (and may your site's readership grow exponentially // & explosively - or even better :)... // ------------------------------------------------------------------------- $expander_title_style = << From this screen, you can manage all the Ad Swapper advertising related to the site that this Ad Swapper plugin is installed on ({$target_site_title}).

Click the following links, for HELP on the specified task:-
Initial Plugin Setup
DO THIS FIRST (very little else will work until you've done it)!
Check Your Current Subscription Status
Check whether you have a "trial" or a "paid" subscription.  Also shows the expiry date/time - and includes a link to take out or renew your (paid) subscription...
Create Some Ads
You only need do this if you want to advertise (on your own and/or other sites).
Get Your Ads Displaying - On This And/Or Other Sites
Once you've created the ads you want to display, this is how you select the sites you want to advertise on, and have your ads auto-transferred there (the ads will start displaying immediately the other site approves them)...
Prepare This Site To Display (Ad Swapper™) Ads
You only need do this if you want to display Ad Swapper ads on this site.
Select/Obtain the Ads To Display (On This Site)
Once you've prepared your site to display (Ad Swapper™) ads, this is how you select the sites you want to advertise, download their ad URLs, and pick those you want to display (the ads will start displaying immediately you approve them)...
EOT; // ------------------------------------------------------------------------- // $page_content_proper .= << // // Display THIS Site's Ads - On THIS Site // //
// Just some clarification about displaying THIS site's // ads on THIS site. //
// // // //
// EOT; // ------------------------------------------------------------------------- $page_content_proper .= <<
EOT; // ------------------------------------------------------------------------- $page_content_proper .= <<

Initial Plugin Setup...

Maintain Plugin Settings

You should only need do this once (when you first install the plugin).

Site and Ad Maintenance...

View Subscription and Plugin Status

You can check your Ad Swapper subscription type - and whether or not this plugin needs to be updated - from here.

Maintain This Site's Profile / Settings

Lets you configure how Ad Swapper works on this site.  In particular:-
  • The Test Mode field lets you configure Ad Swapper so that only you can see the Ad Swapper ads displayed on your site (which is very useful when evaluating Ad Swapper - and setting up it's Ad Slots).  And;
  • The GeoIP field allows you to select the countries/continents your ads are displayed in (where your ads WON'T be displayed at all - unless at least one such country is selected).

Maintain This Site's Ad Slots

“Ad Slots” are the areas on your site's pages where ads from other Ad Swapper sites are placed. You'll need at least one Ad Slot (though you can create/use as many as you like).

Maintain This Site's Ads

Add, edit and delete the ads that you want to display on other sites (in the Ad Swapper network). This is where you'll probably spend the bulk of your time with Ad Swapper (once you've done the initial setup above).

Manual Site and Ad Selection...

Select Sites to Advertise

Here you can select the Ad Swapper sites (including your own), whoose ads you want to display on your site.

Select Sites to Advertise On

Here you can select the Ad Swapper sites (including your own), that you want to display your site's ads on.

Select the Ads to Display on This Site

By default, ALL the individual Ad Swapper ADS to be displayed on this site are DISABLED (even if you've approved the SITEs that own the ads concerned).  So once you've approved one or more sites (to display ads on this site) - and Synchronised with Ad Swapper Central (to download the URLs of the approved site ads), you must then individually approve any newly downloaded ads.
EOT; // ------------------------------------------------------------------------- //

Web Site Collections (Targeted Marketing)...

// //
// Targeted Marketing is the Holy Grail of the advertising // industry (you want to show your ads seen by everyone likely to be // interested in your product).  And Ad Swapper “Web Site // Collections” are by far the most effective way to gather // all your potential customers together.  Nothing else - not // even major television events like the Superbowl, the Olympics or // sporting World Cups, etc - can beat it.  Better still, at just // $20 per year (for your Ad Swapper subscription), you DON'T have to // be Megabucks International to afford it.  Anybody - including // private individuals and non-profits - can have the most effective // advertising ever (virtually for free).  Click here for more... // //
// //
// //

Maintain Your Own Web Site Collections

// Create, edit and delete your own Web Site Collections (the // magnets that will draw your potential customers to where // they can see your ads).  In general, you should only // create a new collection if there's no existing collection // that includes much the same web sites as you want your // collection to contain. // //
// //

Enable/Disable The Sites In Your Web Site Collections

// Select the sites in each of your (Web Site) // Collections.  You can set the collections you create to // be either moderated or un-moderated.  If you set a // collection to be moderated, then you decide whether // the other Ad Swapper sites that apply to join the collection // may do so (though sites you've accepted can leave whenever // they want).  If you set a collection to be // un-moderated, then other Ad Swapper sites can join // (and leave) the collection whenever they want. // //
// //

Select the Web Site Collections You Want This Site to Belong To

// This is another way of selecting the sites you want to // advertise, and advertise on.  Once you've joined a // collection, you'll automatically advertise - and // advertise on - all the sites in that collection.  // (Which is quicker than manually selecting those sites // yourself.) // //
// //
// ------------------------------------------------------------------------- $dont_use = <<DON'T USE THIS OPTION unless you know what you're doing.  Use Synchronise instead. EOT; // ------------------------------------------------------------------------- $page_content_proper .= <<Synchronisation (with Ad Swapper Central)...

Synchronise

Use this:-
  • Whenever you've made changes to your local site - ie; created/deleted ads, or selected new sites to advertise and/or advertise on, etc - and want to push those changes to Ad Swapper Central and the other Ad Swapper sites.  Or;
  • Whenever you want to update your local Ad Swapper plugin.  And in particular, it's lists of sites to advertise - and advertise on.  And/or the ads available for your site to display.  Although you should Synchronise for this reason as much as possible, there's probably not much point in doing it more than once a day.
NOTE!  Synchronise does Update Central site, Update Local Site and Reload Ads List - all in one hit.  We recommend that you use Synchronise instead of it's individual components.  Because it gets your site sorted, without you having to figure out exactly what updating is required, when.

Update Central Site

Click this option to copy your site's details and ads to the Ad Swapper Central site (so that other Ad Swapper sites can see/display them). You should run this menu option every time you change your site settings, ads or ad slots above (as otherwise, other Ad Swapper sites will have no or outdated information about these things).{$dont_use}

Update Local Site

Click this option to copy the currently enabled Ad Swapper sites and ads, from Ad Swapper Central, down to this site. This is how your site finds out about the other Ad Swapper sites and ads to display.{$dont_use}

Reload Ads List

You should never need to run this option.  But if Ad Swapper ads aren't displaying correctly (or at all) - on the site's front-end - then running this option may fix things.{$dont_use}

Help and Support...

Docs / Tutorials

Overviews and in-depth documentation as to how Ad Swapper works.

Help / Support

FAQs, Support Tickets and Contact Form, etc.


EOT; // ========================================================================= // Create and return the full page... // ========================================================================= $page_header = \greatKiwi_byFernTec_adSwapper_local_v0x1x211_standardDatasetManager\get_page_header( 'Main Menu' , $core_plugapp_dirs['plugins_includes_dir'] , $question_front_end ) ; // ------------------------------------------------------------------------- // Here we should have:- // Ad Swapper Local 0.1.104 >> Main Menu // ------------------------------------------------------------------------- //echo '
' , htmlentities( $page_header ) , '
' ; if ( function_exists( '\\is_adswapper_admanager_site' ) && \is_adswapper_admanager_site() ) { $page_header = str_replace( 'Ad Swapper Local ' , 'Ad Swapper Ad Manager v' , $page_header ) ; $page_header = str_replace( 'Ad Swapper Local ' , 'Ad Swapper Ad Manager v' , $page_header ) ; } // ------------------------------------------------------------------------- return <<{$page_header}
{$page_content_proper}
EOT; // ========================================================================= // That's that! // ========================================================================= } // ============================================================================= // get_target_site_title_and_url() // ============================================================================= function get_target_site_title_and_url() { // ------------------------------------------------------------------------- // get_current_blog_id() // - - - - - - - - - - - // Retrieve the current blog id. // // PARAMETERS // None. // // RETURN VALUES // (integer) Blog id // // NOTES // Uses global: (integer) $blog_id The Blog ID. // // CHANGE LOG // Since: 3.1.0 // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // get_blog_details( $fields, $get_all ) // - - - - - - - - - - - - - - - - - - - // Retrieve the details for a blog from the blogs table and blog options. // // $fields // (int|string|array) (optional) A blog ID, a blog slug, or an // array of fields to query against. If not specified the current // blog ID is used. // Default: null // // $get_all // (boolean) (optional) Whether to retrieve all details or only the // details in the blogs table. // Default: true // // RETURN VALUE // (WP_Object_Cache object) Blog details // // Eg; get_blog_details(1) would return: // // [blog_id] => 1 // [site_id] => 1 // [domain] => foo-multi-site.com // [path] => /site-path/ // [registered] => 2014-07-31 14:51:09 // [last_updated] => 2014-07-31 15:51:56 // [public] => 1 // [archived] => 0 // [mature] => 0 // [spam] => 0 // [deleted] => 0 // [lang_id] => 0 // [blogname] => Site Name // [siteurl] => http://foo-multi-site.com/this-site // [post_count] => // // NOTES // Uses global $wpdb // // CHANGELOG // Since: 3.0.0 // ------------------------------------------------------------------------- // ------------------------------------------------------------------------- // get_blog_option( $blog_id , $setting , $default ) // - - - - - - - - - - - - - - - - - - - - - - - - - // Returns data relating to a specific blog. // // $blog_id // (integer) (required) ID of blog queried. // Default: None // // $setting // (string) (required) Name of setting to fetch. // Default: None // // $default // (integer) (optional) Deprecated. // Default: false // // Any settings in the wp_(blog_id)_options table can be fetched using this // function including: // // siteurl // Full URL of the blog queried (eg. http://www.example.com/blog). // // blogname // Name of the blog queried. // // blogdescription // Description of the blog queried. // // wp_#_user_roles // Roles available in this blog (where # is the ID of the blog // being queried). // // users_can_register // Flag indicating if users can register on the queried blog. // // admin_email // Email address of the admin user of the blog queried. // // start_of_week // Day of the week set as the week start for the blog queried. // // use_balanceTags // Flag indicating if the queried blog uses balanced tags. // // use_smilies // Flag indicating if the queried blog converts text smilies to // images. // // require_name_email // Flag indicating if the queried blog requires names and emails in // posted comments. // // comments_notify // Flag indicating if the queried blog notifies the admin user when // a new comment is posted. // // posts_per_rss // Number of posts carried in the queried blog's RSS feed. // // rss_excerpt_length // Length of excerpt carried in the queried blog's RSS feed. // // rss_use_excerpt // Flag indicating if the queried blog's RSS feed carries a post's // excerpt. // // mailserver_url // URL of mail server used when sending email from the queried // blog. // // mailserver_login // Username used with the above mail server. // // mailserver_pass // Password used with the above username and mail server. // // mailserver_port // Port used with the above mail server. // // default_category // ID of category in which blog posts are published by default. // // default_comment_status // Status comments are set to when posted by default. // // default_ping_status // Ping status set by default when new blog posts are published. // // default_pingback_flag // Flag indicating the default status of pingbacks when new blog // posts are published. // // default_post_edit_rows // Default size of the post edit box. // // posts_per_page // Number of posts displayed per page on the bog queried. // // what_to_show // [unknown] // // date_format // Format in which dates are disaplyed on the blog queried. // // time_format // Format in which times are displayed on the blog queried. // // links_updated_date_format // [unknown] // // links_recently_updated_append // [unknown] // // RETURN VALUES // (mixed) // The value of the setting requested. // // NOTES // Pulls the provided information from the wp_#_options table. // ------------------------------------------------------------------------- $blog_id = get_current_blog_id() ; // ------------------------------------------------------------------------- if ( ! is_int( $blog_id ) || trim( (string) $blog_id ) === '' || ! ctype_digit( (string) $blog_id ) || $blog_id < 1 ) { return array( '???' , // title '' // url ) ; } // ------------------------------------------------------------------------- $setting = 'target_site_title' ; $title = get_blog_option( $blog_id , $setting ) ; if ( ! is_string( $title ) ) { $title = '' ; } else { $title = trim( $title ) ; } if ( $title === '' ) { $title = '???' ; } // ------------------------------------------------------------------------- $setting = 'target_site_url' ; $url = get_blog_option( $blog_id , $setting ) ; if ( ! is_string( $url ) ) { $url = '' ; } else { $url = trim( $url ) ; } // ------------------------------------------------------------------------- return array( $title , $url ) ; // ------------------------------------------------------------------------- } // ============================================================================= // That's that! // =============================================================================