Author Topic: Hide Ads on Topics / Posts with Censored Words  (Read 268165 times)

Ricky

  • Full Member
  • ***
  • Posts: 180
Hide Ads on Topics / Posts with Censored Words
« on: August 17, 2011, 12:09:21 PM »
Censor Adsense on Bad Words
by Ricky.
For SMF 2.0, 2.0 RC5


Description

This mod allows you to check whether a topic is with objectionable words which may violate Google Adsense Policy. This mod gives ability to check using $context['ads_censor']. If condition is true, you should not show ad, if false, one can show ads.

Possible Usage

It is against policy of Adsense and other few services to show their advertisements on page with objectionable words and language. In that case you can Censor words, but if you don't want to restrict discussion then you may hide advertisements on those specific posts using this MOD.

Demo

Demo can be found here -->
coming soon


Installation

Simply install it via package manager and use it after modifying Adminstration settings. Give a comma separated list of words for which you do not want to display Ads.


Usage

This MOD will not do any visible change in your forum but actually provides $context['ads_cesnor'] variable, so you on Thread Display or Topic View you can check whether $context['ads_censor'] is empty or not, you can add following in your Display.template.php  eg.
if(!empty($context['ads_censor']))
echo '<div> YOUR Advertisment / Adsense Code here</div>';


Version

1.1 beta


Changelog


1.1 beta : Improved search algorithm making and also making it case-insensitive
1.0 beta : Initial release

Tayab

  • Full Member
  • ***
  • Posts: 149
Re: Hide Ads on Topics / Posts with Censored Words
« Reply #1 on: October 20, 2012, 02:39:19 AM »
I have a query regarding this modification. What would it say it we will use those black listed works and how will it work?

Ricky

  • Full Member
  • ***
  • Posts: 180
Re: Hide Ads on Topics / Posts with Censored Words
« Reply #2 on: October 20, 2012, 03:41:14 PM »
This is kind of advance modification, what it does is it hides ads on a particular post if it contains words you have described. It requires you to have some knowledge of PHP and HTML etc to use it.

 

X

Do you know?

By participating in our community you can get free top level domain as well learn about Search Engine Optimization, Server management and more..
Join Now!
anything