/* Part of the Ad Injection plugin for WordPress http://www.reviewmylife.co.uk/ */ // old entry method - deprecated - TODO delete later function adinj_check_referrer(){ adinj_dynamic_checks(); } // new entry method function adinj_dynamic_checks(){ if (adinj_adlogblockedCookieSet()){ return; } if (adinj_allowedCookieSet()){ // if 'allowed' cookie is already set we ignore blocked checks return; } if (adinj_adinjblockedCookieSet()){ return; } if (adinj_blocked_referrer()){ return; } if (adinj_allowed_referrer()){ return; } } // Based on code from // http://www.scratch99.com/2008/09/avoid-smart-pricing-show-adsense-only-to-search-engine-visitors/ function adinj_allowed_referrer(){ var allowed = adinj_allowed_referrers_setting(); var length = allowed.length; for (var i=0; i"); return new Array('.google.', '.bing.', '.yahoo.', '.ask.', 'search?', 'search.'); } } function adinj_blocked_referrers_setting(){ if (typeof adinj_blocked_referrers != 'undefined'){ return adinj_blocked_referrers; } else { document.write(""); return new Array(); } } function adinj_blocked_hours_setting(){ if (typeof adinj_blocked_hours != 'undefined'){ return adinj_blocked_hours; } else { document.write(""); return 24; //hours } } function adinj_allowedCookieSet() { return document.cookie.match('(^|;) ?adinj=([^;]*)(;|$)'); } function adinj_adinjblockedCookieSet() { return document.cookie.match('(^|;) ?adinjblocked=([^;]*)(;|$)'); } function adinj_adlogblockedCookieSet() { return document.cookie.match('(^|;) ?adlogblocked=([^;]*)(;|$)'); }