Coinbase

Author Topic: Ad question  (Read 8631 times)

0 Members and 1 Guest are viewing this topic.

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Ad question
« on: August 08, 2006, 09:32:09 pm »
I am running SMF 1.0.7 with the Ad Mod installed. I have used Ad Mod to install a banner ad at the top of the board, but I have what I am sure is a newbie question: How can I install different ads throughout the forum? When I open Ad Mod I see the different ad placement options and the box for placing the code, but I don't understand how I can place different ads throughout the site. For example, I would like one ad at the top of the board, and then the ability to place different ads above or within different categories and boards. Any advice will be greatly appreciated-thanks!

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ad question
« Reply #1 on: August 09, 2006, 12:15:14 am »
For this feature you will have to upgrade your forum so it is using smf 1.1rc2 and then install the latest ad mod v2 I do believe this is the only way it will work.

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Re: Ad question
« Reply #2 on: August 10, 2006, 10:27:29 am »
Hi bigguy,

That is exactly what I want. I downloaded and installed them today. Everything was going fine until I removed the smf logo and forum name and replaced it with an image. I then found that I cannot get my Google ads to work. They used to appear on the top and bottom of the page, but have disappeared. I reinstalled the code, etc., but no Google Ads. I must have done something to the code in index.template.php. I will paste below the only portion of the code I worked on. If you or anyone sees something that is preventing google ads from working or has any ideas I would appreciate it. Thanks. John

<body>';

   echo '
   <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
      <table width="100%" cellpadding="10" cellspacing="0" border="0">
         <tr>
            <td class="catbg" height="34">';

   if (empty($settings['header_logo_url']))
      echo '
               <span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
   else
      echo '
               <img src="', $settings['header_logo_url'], '" style="margin: 4px;" align="left" alt="', $context['forum_name'], '" />';

   echo '
            
         </tr>
      </table>';

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ad question
« Reply #3 on: August 10, 2006, 02:31:12 pm »
This:

Code: [Select]
//Display ads on the top of the page
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

Should be after this

Code: [Select]
<body>';

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Re: Ad question
« Reply #4 on: August 11, 2006, 12:28:38 am »
Thanks again bigguy. I inserted that code and now the Google ads are back on top. However, I still can't get google ads at the bottom of the page. I tried deleting and reinstalling the Google Ad code but results are the same. I tried selecting Board Index but that just creates a space there with no ads. Would reinstalling the ad mods software fix this?

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Re: Ad question
« Reply #5 on: August 11, 2006, 12:37:48 am »
I went ahead and deleted and reinstalled the admods package. When I refreshed the site I saw the Google Ads at the top, but there was also a similar sized blank space below the ads. I figured that there must be duplicate code there--the code I added and code added by the package. I checked and sure enough there was. I removed one set and now the page is fine. But, I still cannot see ads at the bottom of the page. I assume the package should be writing the code on index.template.php, just as it did a few moments ago in the duplicate code case. If that is the case I don't understand why I can't get bottom page and index locations to work.

Did a little more experimenting and I find that I can get a google ad on the top of the page, or the bottom of the page, but not both at the same time! I tried creating two different ads, one top and one bottom, but same result. I was able to do that before. There are no conflicts with any other ads either.

I looked through the code and I saw code for the bottom of the page ad, but none for the top of the page. I then reinserted the top page code you gave me. I saved and uploaded the file, and now there is a google ad at the top of the page, but not at the bottom! Boggling my mind...
« Last Edit: August 11, 2006, 12:54:08 am by qualtrough »

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ad question
« Reply #6 on: August 11, 2006, 12:51:59 am »
Is all of this in your index.template.php file:

Code: [Select]
//Close table for towerright ads
$ads = show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">', $ads['type']==0 ? $ads['content'] : eval($ads['content']) ,'</td></tr></table>';

unset($ads);
//Close table for towerleft ads
$ads = show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);

//Show ads on the bottom of the page
$ads = show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Re: Ad question
« Reply #7 on: August 11, 2006, 09:10:52 am »
bigguy-It is late here so I will check the code and report back tomorrow. Thank you very much for taking the time to assist.

John

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ad question
« Reply #8 on: August 11, 2006, 09:25:14 am »
Ok, no problem. I`ll be around. :)

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Re: Ad question
« Reply #9 on: August 12, 2006, 09:24:24 am »
Hi bigguy-Wasted a lot of time getting there but eventually found out that the bottom of the page code was missing. Copied yours, pasted, uploaded, and I can now see Google Adsense Ads on top and bottom! Tested other locations and looks like they are working as well. Thanks much!

One issue remaining if you or anyone else can answer or point me in the right direction:

1. How can I center the Google Ads? I have a banner in the 728 x 90 size and the right hand side hangs over the right side of the forum table by, I don't know, what looks like 3-4 mm, 20 pixels? I thought maybe I could center align the table instead and inserted align="center" in the forum table but that didn't seem to have any effect. Tried alot of other stuff as well, but nothing works yet.


Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ad question
« Reply #10 on: August 12, 2006, 10:57:32 am »
Try using the center tag around the the ad code (< center> </ center>)

Offline qualtrough

  • Jr. Member
  • **
  • Posts: 26
Re: Ad question
« Reply #11 on: August 12, 2006, 11:59:40 am »
I wasn't sure if you meant the Google AdSense code in the Ad Mod code box, or the top ad and bottom ad code in index.templates.php. I started by applying the center tags in the Ad Mod text box enclosing the script tags, but that didn't work. I then moved progressively inwards, but nothing worked. A lightbulb went on (I thought) and I tried to used the center tags around the ad code in index.template.php. That didn't seem to work either. I have tried div align as well, no luck. Here is the code for the top ad with the center tags from index.template.php:

<center>
   //Display ads on the top of the page
   $ads = show_topofpageAds();   
   if(!empty($ads))
      if($ads['type']==0)
         echo $ads['content'];
      else
         eval($ads['content']);   
   unset($ads);
   echo '
   </center>

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Ad question
« Reply #12 on: August 12, 2006, 12:51:13 pm »
I meant around the adsense code, but I guess as you say, that didn`t work. There was a post on SMF about centering a banner maybe that would help. I`m not exactly sure where it is right now.

SMF Ads Support Forum

Re: Ad question
« Reply #12 on: August 12, 2006, 12:51:13 pm »
.