Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 11 August 2009 : 03:35:56
|
I run Google adsense on some of my sites, and have two Include files which I call to show the adverts:
google_ad.asp
This has the following code in it so that the Admin pages or pages of the forum I do not want the adverts shown on, do not get the Adverts shown:
<%
'## GOOGLE ADSENSE PAGE CHECKS AND JAVASCRIPT HERE
if not(Instr(Request.ServerVariables("Path_Info"), "active_users.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "active_u3.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_accounts_pending.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_accounts_pending_reminder.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_attach.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_activeusers.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_colors.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_email.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_features.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_system.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_members.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_ranks.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_datetime.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_sitestat.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_system.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_config_groupcats.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_count.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_downloads.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_emaillist.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_home.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_faq.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_forums.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_guestbook.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_inactive_massdelete.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_inactive_users.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_info.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_library.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_login.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_member_search.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_metatag.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_mod_dbsetup.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_mod_dbsetup2.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_moderators.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_pmmaint.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_points.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_policy.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_search_ip.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_searchlog.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_show_mem_password.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "admin_variable_info.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "classadmin.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "forum_stats.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "lib_delete.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "lib_upload.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "lib_upload_replace.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "members.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "member_stats.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "merge.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "myfiles.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "nladmin.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pmadmin.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pmadmin_delete.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pmadmin_options.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pmadmin_read.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pmadmin_sent.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pm_delete.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pm_options.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pm_view.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pop_memberinfo.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "pop_profile.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "post.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "privateread.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "privatesend.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "privatesend_info.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "register.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "setup.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "subscription_list.asp") > 0) and _
not(Instr(Request.ServerVariables("Path_Info"), "welcome.asp") > 0) then
GoogleAdOK=TRUE
else
GoogleAdOK=FALSE
end if
if GoogleAdOK=TRUE then
%>
<!--#INCLUDE VIRTUAL="/forums/google_ok.asp" -->
<%
else
response.write " "
end if
%>
The file of google_ok.asp has the google adsense code in like so:
(Replace <Your Pub ID> with your Google Publisher code)
This works for me and gets a bit of money back from Google on some sites. The higher that you have the Google Adsense on the page, the better chance of the payment. Just my 2 cents worth. |
Cheers, David Greening |
|
|