Add Sharing

I have setup ad sharing to only display on the bottoms of pages and posts and added my ad content. I setup it for a 50/50 split. No blogs have advertising setup yet.

When refreshing pages and posts, I am only seeing ads appear every other time. I thought that if the blog was not sharing (no ads on the blogs setup) that the adds would be shown 100% of the time. What did I setup incorrectly?

  • realsol
    • Design Lord, Child of Thor

    OK. I did the following test with Ad Sharing.

    1. Drop it into the mu-plugins/upgrades directory with the added code to only shut off if a user pays to have it shut off. Works fine. Shuts off when upgrade is applied, and is left on when upgrade hasn't been applied. But, if I try to save any changes in the Admin or User area for advertising, I get an Internal Server Error 500. So this won't work.

    2. I drop it into the mu-plugins directory, if I include the code to have it look for the upgrades plugin:

    upgrades_register_feature('dontshareadsc87704c8391e2ed74e1a9c3830e986c0', 'Dont Share ads', 'Dont Share ads.');
    if (upgrades_active_feature('dontshareadsc87704c8391e2ed74e1a9c3830e986c0') <> 'active'){

    I get an error that the function doesn't' exist for the upgrades plugin (can't remember the exact error and I don't want to do it again). So this won't work.

    3. Drop it into the plugins directory and use the code I mentioned here in another thread to activate plugins that can't be put in the muplugins directory. Works fine until I try to save in the admin or user advertising, then I get a 404 error.

    So, it looks like #2 will be the easiest to fix. I just need to know what to include to keep the error from coming up when it doesn't recognize the upgrades function.

    whew.

    ps: and it still is having the 50/50 error as mentioned above.

  • realsol
    • Design Lord, Child of Thor

    As a side not, when the Ad Sharing plugin is not in the /mu-plugins directory, it does save the info, it is just not redirecting properly. I haven't looked at the code, just an observation from the url that it is trying to bring up.

  • realsol
    • Design Lord, Child of Thor

    Well, I fixed the 50/50 problem. I just added some code to look to see if the user put content in for the ad. If not, the site ad gets put in:


    if ( get_option('advertising_before_code') == '')
    $ad_code = stripslashes( get_site_option('advertising_before_code') );
    else $ad_code = stripslashes( get_option('advertising_before_code') );

    Added to both the before and after. I also look for <!--blockad--> in case someone doesn't want to show an add. Might remove this if it gets abused and probably am only going to give it out if asked.

    As far as the problem saving when adding it into the upgrades folder, I just needed to change the action="" in the post for the form to allow for the difference in directories. Everything seems to work fine now. Although, I would like to get Andrew's opinion if he has time as I am hoping I am not breaking anything.

  • Andrew
    • Champion of Loops

    Hiya,

    Also, wsa work with ad sharing?

    You can use this plugin and WSA at the same time. However, be careful to not display more than three adsense ads per page.

    Will the ad_removal plugin work with ad sharing?

    Afraid not. Good idea for the next update though.

    http://franciscostudiosdenver.com is a good example of the ad's being displayed every other refresh.

    I just did 25 refreshes with two separate browsers (IE, FF) and saw a google ad every time. Is there another example blog you can provide?

    I just need to know what to include to keep the error from coming up when it doesn't recognize the upgrades function.

    Thanks,
    Andrew

  • Andrew
    • Champion of Loops

    Hiya,

    Ad Sharing 1.0.1 is now available. This new version includes a fix for the issue mentioned above regarding site ads not displaying 100% of the time when blog ad code has not been setup.

    I just need to know what to include to keep the error from coming up when it doesn't recognize the upgrades function.

    if (function_exists('upgrades_register_feature')) {
    upgrades_register_feature('dontshareadsc87704c8391e2ed74e1a9c3830e986c0', 'Dont Share ads', 'Dont Share ads.');
    if (upgrades_active_feature('dontshareadsc87704c8391e2ed74e1a9c3830e986c0') <> 'active'){
    }

    As far as the problem saving when adding it into the upgrades folder, I just needed to change the action="" in the post for the form to allow for the difference in directories. Everything seems to work fine now. Although, I would like to get Andrew's opinion if he has time as I am hoping I am not breaking anything.

    What did you have to change it to in order for it to work?

    Thanks,
    Andrew`

  • Redius
    • New Recruit

    Hi Andrew

    Thanks for the update. I just downloaded a couple days ago the plugin and realised the issue discussed here. Now it works fine.

    Anyway, just a suggestion, it would be nice to be able to place the ads say in the first, third and last post...

    Before using your plugin I modified the Mighty Adsense plugin for WP so it could work for WPMU and it displayed like I say.

    Kind regards

    Francis

  • Andrew
    • Champion of Loops

    Hiya,

    Changed:
    <form method="post" action="mu-plugins/upgrade-plugins/wpmu-admin.php?page=site-advertising&action=process">

    To:
    <form method="post" action="wpmu-admin.php?page=site-advertising&action=process">

    That shouldn't harm a thing :slight_smile:

    Anyway, just a suggestion, it would be nice to be able to place the ads say in the first, third and last post...

    That feature won't be making it into this plugin. Possibly a more advanced plugin down the line. This plugin is meant to be a simple as sharing solution.

    Thanks,
    Andrew

  • realsol
    • Design Lord, Child of Thor

    Sure. Changed the top of the plugin to add the upgrades stuff:


    //------------------------------------------------------------------------//
    //---Hook-----------------------------------------------------------------//
    //------------------------------------------------------------------------//
    //Don't Share Ads
    upgrades_register_feature('dontshareadsc87704c8391e2ed74e1a9c3830e986c0', 'Dont Share ads', 'Dont Share ads.');
    if (upgrades_active_feature('dontshareadsc87704c8391e2ed74e1a9c3830e986c0') <> 'active'){
    add_filter('the_content', 'ad_sharing_output', 20, 1);
    }
    add_action('admin_menu', 'ad_sharing_plug_pages');
    add_action('wp_head', 'ad_sharing_advertising_quarter');
    ///Don't Share Ads

    Then I dropped it in the /muplugins/upgrades folder and changed both <form> tags stated above so it wouldn't give me an error saving the add options.

  • Ovidiu
    • Code Wrangler

    just to clarify this:

    1. Drop it into the mu-plugins/upgrades directory with the added code to only shut off if a user pays to have it shut off. Works fine. Shuts off when upgrade is applied, and is left on when upgrade hasn't been applied. But, if I try to save any changes in the Admin or User area for advertising, I get an Internal Server Error 500. So this won't work.

    with your modified version, if a user pays to stop ads, these shared ads will no longer be displayed. Not at all? wouldn't it make more sense, that if a user pays for this feature, only his ads would get displayed? I mean in the ned he pays to get "your" ads removed and he should still be able to display his own ads, without sharing, right?

  • Ovidiu
    • Code Wrangler

    I might have not explained correctly what I was asking:

    ok, what about this situation: the blog owner pays to get ads removed, can he still use this plugin so that only his adds are showing? basically there is no more sharing with me?

    Or if he pays for removing ads, he can't show his own ads anymore?

  • realsol
    • Design Lord, Child of Thor

    Well, that all depends. If order to stop sharing ads, you would have had to ad code to have it stop working. In the example I gave above, it would stop working for both. But, I guess you could change that to still allow for his ads to keep on displaying though.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.