Welcome to WebmasterWorld Guest from

Forum Moderators: incrediBILL & martinibuster

Message Too Old, No Replies

Can't even use with internal site search?

very difficult programming requirement ie. w/phpnuke

11:32 am on Jul 4, 2003 (gmt 0)

New User

10+ Year Member

joined:Nov 2, 2002
votes: 0

I have several site running on php-nuke, and like any other CMS, there is a search feature. I don't like the idea of turning it off, but trying to figure out how to just add the code as footers to the index page and article, links, etc. pages seems about impossible. Anyone been able to get this to work in a CMS, hopefully php-nuke, and can provide instructions?
11:43 am on July 4, 2003 (gmt 0)

Full Member

10+ Year Member

joined:Jan 9, 2003
votes: 0

Hard-edit the code. On one site, in the functions file that gets included on all pages, I created a variable $google_ad for example, and that was the AdSense code. In another part of the scripts, specific only to "search" function, I put $google_ad = ""; In other words, simply 'erased' the ad. So in your header or footer etc., you may have <?=$google_ad?> or echo $google_ad; or something, and on search pages, that will result in nothing shown.

That's one way to do it. It's quick & dirty, and you'll have to re-implement whenever you update your CMS, but it works.

11:42 am on July 6, 2003 (gmt 0)

Junior Member from AU 

10+ Year Member Top Contributors Of The Month

joined:June 28, 2003
votes: 22

Here's a bit of PHP code. Call this "ad.php" and run it by putting <? include 'ad.php';?> in your page...


adcode = " --- your google code --- ";

if (is_integer(strpos($REQUEST_URI,"privmsg")) or is_integer(strpos($REQUEST_URI,"search")) or is_integer(strpos($REQUEST_URI,"posting")) or is_integer(strpos($REQUEST_URI,"profile"))) {

echo $adcode;

This will display ads on all pages, except - in this example - any pages with those words in the URL, like 'search'. Incidentally, this code contains the pages I currently don't display ads on for phpBB.

Hope that helps a bit. Don't forget to escape the " marks when you cut and paste the Google ad code.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members