Home : Internet : Scripts : WebBBS : Adsense

WebBBS and Google Adsense

If you use the Google Adsense program to display advertisements on your forum, you need to be careful about adhering to Google's Terms of Service. These state that you can't place Google ads on non-content pages such as certain types of form, "thank you" messages, etc. There are many such pages in WebBBS which you'll need to keep free of Adsense ads.

As a side note, Google ads tend not to perform well on these pages anyway. You are probably better off displaying different ads instead.

We will assume that you have Adsense imbedded into your WebBBS footer files ($FooterFile, etc). If you use the header files instead these instructions won't work, but you'll still see the general idea and you should be able to find a similar solution.

Our approach is to create a new footer file called $GenericFooterFile and use this for all the pages Adsense doesn't like. In our forums we made this file identical to the main footer files but inserted ads from a different affiliate program.

To make this modification, follow the instructions below for each of the specified WebBBS files.


webbbs_settings.pl

Add new variable:
$GenericFooterFile = "/path/to/generic-footer.txt";


webbbs_form.pl

In sub PostForm replace:
&Footer($MessageFooterFile,"credits");
with:
&Footer($GenericFooterFile,"credits");


webbbs_basic.pl

In sub Error replace:
if ($PreviewForm) { &Footer($MessageFooterFile,"return"); }
else { &Footer($MessageFooterFile,"return","refresh"); }


with:
if ($PreviewForm) { &Footer($GenericFooterFile,"return"); }
else { &Footer($GenericFooterFile,"return","refresh"); }


webbbs_misc.pl

In sub BlindEmail replace:
&Footer($MessageFooterFile,"return");
with:
&Footer($GenericFooterFile,"return");

Replace the following in sub Subscribe, sub Search and sub Reconfigure:
&Footer($MessageFooterFile,"credits");
with:
&Footer($GenericFooterFile,"credits");


webbbs_post.pl

In sub PostMessage replace:
&Footer($MessageFooterFile,"return","refreshalways");
with:
&Footer($GenericFooterFile,"return","refreshalways");

In sub PreviewPost replace:
&Footer($MessageFooterFile,"credits");
with:
&Footer($GenericFooterFile,"credits");


webbbs_profile.pl

In sub ListProfiles, sub UserProfile and sub EditProfile replace:
&Footer($MessageFooterFile,"credits");
with:
&Footer($GenericFooterFile,"credits");

In sub DeleteProfile replace:
&Footer($MessageFooterFile,"return","refresh");
with:
&Footer($GenericFooterFile,"return","refresh");