Who Sees Ads: Is this plugin for multi-site only?

Just wondering.. since the normal plugin not developed by WPMU works on single sites..

When activating the plugin developed by you I got this error.

Fatal error: Call to undefined function get_blog_option() in /home/sitename/public_html/wp-content/plugins/whoseesads/whoseesads.php on line 386

The reason I was trying to use this plugin instead of the normal one not edited by you was because the original is bugged. I set the regular visitor to 5 posts per 1 day, and the ad would still show if they viewed 2 visits. When I set it to 25 posts per 1 day it would show the ad at 7 or 8 page views. It appears it was bugged in that it would never be accurate in how many pages were viewed already.

  • _981

    It appears the cookie is set on every page. How can I change the code to make it set on posts only? Also, the cookie incriments by 2, not 1 on each page load. So if I want to set 5 pages every 1 day, i must set to 10 every 1 day.. as it increases by 2 each time.

    I think I'd edit this part of the code..?

    // Write cookie
    function wp_ozh_wsa_setcookie() {
    	global $wp_ozh_wsa;
    	if (isset($_COOKIE['wp_ozh_wsa_visits'])) {
    		$visits = $_COOKIE['wp_ozh_wsa_visits'] + 1;
    	} else {
    		$visits = 1;
    	}
    
    	if (isset($_COOKIE['wp_ozh_wsa_visit_lasttime'])) {
    		$lasttime = $_COOKIE['wp_ozh_wsa_visit_lasttime'];
    	} else {
    		$lasttime = 0;
    	}
    
    	$time = time();
    	$url = parse_url(get_option('home'));
    	setcookie('wp_ozh_wsa_visits', $visits, $time+60*60*24*365, $url['path'] . '/');
    	setcookie('wp_ozh_wsa_visit_lasttime', $time, $time+60*60*24*365, $url['path'] . '/');
    	$wp_ozh_wsa['cookie'] = array($visits, $lasttime);
    }
  • PC

    Greetings and thanks for being a great community member.

    We haven't heard from you on this one for long and I am doing a regular followup to see if there is still something we can assist you on this thread.

    Just to manage the support issues more efficiently, I am marking this thread as resolved for now however this is not being done to avoid your questions in any ways.

    Please feel free to mark this is "Not resolved" in case you have further questions and we would be back on it.

    Thanks a lot for being with WPMU DEV.

    Cheers
    PC
    Sales &Support

    Did you know we offer FREE lifetime memberships? Click here to learn more.