2004-12-23, 10:30 AM
Pages: 1 2
2004-12-23, 10:32 AM
wolfden Wrote:Well I guess I could do some $_SERVER['REQUEST_URI'] checks too to make sure it isnt a message page (login form etc)James Wrote:Well, I put them in my header template, but they can go in any one you want
Just remember to customise the group IDs for the ones you want to filter
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.
Edit: ....and thanks
2004-12-23, 10:38 AM
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
If you can master that - please share the code
2004-12-23, 10:45 AM
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.
2004-12-23, 10:59 AM
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
(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/")
/* 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 (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/")
2004-12-23, 11:20 AM
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.
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.
2004-12-23, 11:31 AM
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.
And no, its not another template for the ad-determining script, i've put it into global.php.
Pages: 1 2