News:

Help keep this project going by donating or buying adseller pro

Main Menu
Coinbase

Ad question

Started by qualtrough, August 08, 2006, 10:32:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

qualtrough

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!

bigguy

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.

qualtrough

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>';

bigguy

This:

//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

<body>';

qualtrough

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?

qualtrough

#5
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...

bigguy

Is all of this in your index.template.php file:

//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);

qualtrough

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

bigguy

Ok, no problem. I`ll be around. :)

qualtrough

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.


bigguy

Try using the center tag around the the ad code (< center> </ center>)

qualtrough

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>

bigguy

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.