Making a theme for PC? Don't forget the Ads!

Status
Not open for further replies.

Master Kwesi Nkromah

"Pokéfan Kwesi"
  • 992
    Posts
    21
    Years
    I know I know, banner ads are no one's best friend and putting them your perfect design breaks your vision every time, but you just gotta do it; Sorry :/. This is a short guide to help you to effortlessly add PC advertisements to your forum templates/styles.

    What service provides our advertisements?

    The first think you should know is that we currently use Google AdSense for all of our advertisements. Google provides an easy way to display Ad units that contain either text ads, image ads, or both. The ads are targeted to the content of the forums using contextual and site targeting. So, if someone makes a new thread with the words "Pokemon Diamond" in it, Google AdSense goes out and pulls links for Pokémon Diamond and displays them as a banner. This way we only get what's relevant to us. Pretty cool, no?

    What's the advertisement code and how do i modify it?
    Google AdSense employs a simple script to display ads.
    HTML:
    <script type="text/javascript"><!--
    google_ad_client = "pub-9490408503873249";
    	google_ad_width = 728;
    	google_ad_height = 90;
    	google_ad_format = "728x90_as";
    	google_ad_type = "text_image";
    	//2006-10-25: PokeCommunity Forums
    	google_ad_channel = "3649686036";
            google_ui_features = "rc:10";
    	google_color_border = "738fbf";
    	google_color_bg = "f5f5ff";
    	google_color_link = "375083";
    	google_color_text = "000000";
    	google_color_url = "375083";
    //--></script>
    <script type="text/javascript"
      src="https://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    As you can see, Google AdSense uses simple variables to determine the look and feel of the ad banner. This is a huge advantage, it allows us to customize ever banner displayed allowing us to blend the advertisement into the site.


    google_ad_client
    Going from the top-most variable down, the first we'll look at is perhaps the most important. The "google_ad_client" variable is unique to the PokéCommuntiy and identifies us as a legit Google AdSense partner. This variable is monitored very closely and must remain untouched. If changed, it's likely that ads won't be generated correctly, or won't belong to the PokéCommuntiy. Better safe than sorry, just pass it over.​

    google_ad_width
    Next is the "google_ad_width" variable. The name pretty much describes it's function; it determines the width of the ad field. However, there's more to this story then just that. Expanding the ad width doesn't necessarily expand the ad itself. Think of the google_ad_width as controling the width of a table, contained within that table is an image. Expanding the table doesn't expand the image, just the surrounding area.​

    google_ad_height
    The "google_ad_height" works in ways similar to the google_ad_width. Only the google_ad_height expands the ad field vertically rather than horizontally.​


    google_ad_format

    Another important variable is "google_ad_format". This variable determines how many ad links are displayed in the banner and the actual banner dimensions. There are twelve different ad formats in total and each one is listed with an image rendering. An adobe photoshop composite of ad templates is available and attached to this thread for easy access.

    Variabe value and dimensions

    1. 728x90_as - 728 x 90 Leaderboard
    2. 468x60_as - 468 x 60 Banner
    3. 234x60_as - 234 x 60 Half Banner
    4. 120x600_as - 120 x 600 Skyscraper
    5. 160x600_as - 160 x 600 Wide Skyscraper
    6. 120x240_as - 120 x 240 Vertical Banner
    7. 336x280_as - 336 x 280 Large Rectangle
    8. 300x250_as - 300 x 250 Medium Rectangle
    9. 250x250_as - 250 x 250 Square
    10. 200x200_as - 200 x 200 Small Square
    11. 180x150_as - 180 x 150 Small Rectangle
    12. 125x125_as - 125 x 125 Button

    google_ad_type
    The "google_ad_type" variable is another important option to consider when customizing your ad displays for the PokéCommuntiy. This variable determines what type(s) of advertisement is displayed to the users of this forum. Now don't get your hopes up to much, the options are limited (at this level). There are three possible values for this variable, text_image, text, and image. Each value is fairly straight forward and easy to understand. There are two possible ads that can be displayed through this method, those which are images and those which are contextual in nature (text).
    • Text and Image Ads – text_image: displays both image banner ads and contextual ads
    • Text Ads – text: displays contextual ads only
    • Image Ads – image: displays image ads only

    //2006-10-25: PokeCommunity Forums
    google_ad_channel

    This is another one of those variables we require that you keep as is. It allows us to track exactly where ad revenues are coming from and if changed, screws up. We have to keep a close eye on this guy so please, just pass this variable on by.​

    Now that we've gotten through all the more technically information, lets have some fun doing what we really came here for, Lets change those colors!!

    google_color_border
    This variable controls two parts of the contextual ad banner. It controls the border as indicated by the var name, and it also controls the solid color just under the advertisement links. This variable controls one of the most prominent colors in the ad banner so choose wisely.
    [PokeCommunity.com] Making a theme for PC? Don't forget the Ads!


    google_color_bg
    This, as the name suggest, changes the background of the main (or 1st) cell in the ad banner.
    [PokeCommunity.com] Making a theme for PC? Don't forget the Ads!


    google_color_link
    This variable controls the color of the website's title in the ad banner.
    [PokeCommunity.com] Making a theme for PC? Don't forget the Ads!


    google_color_text
    This variable controls the color of the short website description following each title..
    [PokeCommunity.com] Making a theme for PC? Don't forget the Ads!


    google_color_url
    At last, this finial variable control the color of the URL following every website description.
    [PokeCommunity.com] Making a theme for PC? Don't forget the Ads!

    Unfortunately don't have time today to really go into how / and where the ads are implemented. Here's a short and dirty overview. There were two templates that i had to edit, the SHOWTHREAD template and the POSTBIT template. If you view the template's history, you can easily see where and why through the comments i left. Although these are the templates I edited, you won't have to unless you want to change the location of the advertisements. If all you want to do is change the color what you'll need to do is go to Administrator cp -> Replacement Variable Manager and select the template that you wish to modify. Right off hand the template should have a replacement called "<adsense_728x90>" this is the default size and color for all ads. This is also the only code you'll have to enter to use the default. If you want to change the default you have to customize the AdSense code above and then edit the replacement (or create a new one) in the template of your choice. I'll go into greater detail later. Gotta run!
     
    Last edited by a moderator:
    Status
    Not open for further replies.
    Back
    Top