Welcome to WebmasterWorld Guest from 54.166.222.116

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)

10+ Year Member



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 Jul 4, 2003 (gmt 0)

10+ Year Member



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 Jul 6, 2003 (gmt 0)

10+ Year Member



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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month