homepage Welcome to WebmasterWorld Guest from 54.235.16.159
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Google / Google AdSense
Forum Library, Charter, Moderators: incrediBILL & jatar k & martinibuster

Google AdSense Forum

    
Can't even use with internal site search?
very difficult programming requirement ie. w/phpnuke
TheWebHead




msg:1369310
 11:32 am on Jul 4, 2003 (gmt 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?

 

saoi_jp




msg:1369311
 11:43 am on Jul 4, 2003 (gmt 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.

james007




msg:1369312
 11:42 am on Jul 6, 2003 (gmt 0)

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

<?

GLOBAL $REQUEST_URI;
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"))) {
$adcode="";
}

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Google / Google AdSense
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved