Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Opinions please
#11
Nice site tho btw
#12
wolfden Wrote:
James Wrote:Well, I put them in my header template, but they can go in any one you want Smile
Just remember to customise the group IDs for the ones you want to filter Smile

According to google's policy you can't have the ads on noncontent pages - such as the registration page and what not. I add them to the templates that were safe. I think it's kinda dumb for this to be a policy, but that is for google to call. I don't know how well google enforces it either, but I guess it's better to be on the safe side.
Well I guess I could do some $_SERVER['REQUEST_URI'] checks too to make sure it isnt a message page (login form etc)

Edit: ....and thanks Smile
[Image: 143e9cd3157e53.jpg]
James - Micra Sports Club
#13
Would you be able to leave it in the header than? I would rather have mine in the header if I could. Dropping it down from the header makes the page expand more causing dropage in the forums even further down from the top of the page.

If you can master that - please share the code
#14
Shouldn't be too difficult, as the code in the header is already conditional on whether they have an official membership or not. I'll have a quick look at it. Smile
[Image: 143e9cd3157e53.jpg]
James - Micra Sports Club
#15
Well, this bit checks if the user is on a login, logout, or register page. I couldn't find any more in a hurry, but if anyone knows of any others, please let me know Smile
/* Now let's check if the page they are on is a message page */
$script_name = str_replace("/forums/", "", $_SERVER['SCRIPT_NAME']);
switch($script_name) {
  case "member.php":
    if (($_GET['action'] == "login") || ($_GET['action'] == "logout") || ($_GET['action'] == "register")) {
      $google_ad['advert'] = "";
      $google_ad['message'] = "";
    }
  break;
}
In my script, that goes below the part that checks whether they should see the ads or not. It seems to work for me Smile

(This is assuming your website is located at http://domain/forums/, you can change that accordingly. Eg http://domain/mybb/ you would change "/forums/" to "/mybb/")
[Image: 143e9cd3157e53.jpg]
James - Micra Sports Club
#16
So let me see if I get this correct.

You have made a global template for the google ads, right?

You than place the code in the header template, right?

I don't know about the user control panel?? Not sure if that is considered a content page or not - wish google could be a little bit more precise with that.

#17
Yeah, i agree with you on that, they aren't great at defining what content is.

And no, its not another template for the ad-determining script, i've put it into global.php.
[Image: 143e9cd3157e53.jpg]
James - Micra Sports Club


Forum Jump:


Users browsing this thread: 1 Guest(s)