Adding adsense after first and last post

Started by Owdy, May 22, 2005, 03:30:44 PM

Previous topic - Next topic

Owdy

Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

shishira

Quote from: J. S. on June 21, 2005, 09:20:17 AM
Here is my Display.template.php code:

http://www.artdust.ro/test/Display.template.php.txt

Do not forgot to backup your  Display.template.php

Demo:  http://forum.lovesms.ro


sorry file not found anybody with the complete code ???
It always takes longer than you expect, even when you take into account Hofstadter's Law.

http://shiroid.com
http://bangaloreforums.com


legolas

Hi,
I used the displayed.template.php provided by J.S which displays the ads in the 2nd and last post. However, the 2nd ad always displays Russian ads (mostly from adzone.ro). has anyone encountered this when using the displayed.template.php provided by J.S?? BTW my website is not russian.

Owdy

That has nothing to do with template. Use google-ad filter to remove that advertiser. Put 'adzone.ro' to filter list.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

yellow1912

So am I allowed to put google ads on my SMF forum?
My SMF forum ^^
An Ecommerce site I help to build

thetzfreak

Well, I really need to do this, but I have another template, not the default, and I don't have that default.template.php file. All I have in my theme folder is index.php, template.index.php, boardindex.template.php, and themes.template.php. I can't seem to find the correct place anywhere =\

J. S.

Hello.

please edit Display.template.php.
Find there the AdSense code and edit this:

google_ad_client = "xxxx";
replace xxxx with your ad client ID.
second, find this line:
google_alternate_ad_url = "xxxxx";
replace that url wit your alternate add url. If you don`t know what is that, or you don`t have one, please delete that line.

Good luck!

J. S.

Owdy: read below :)
yellow1912: Yes. You may put Google Ads on a SMF forum, however, read the google policy before doing that.
thetzfreak: When you ask for help please provide a URL where we can see what is happening. If you don`t have a Display.template.php file in your theme folder, then the default one will be used (by SMF).

jennypretty

#29
Can you please look at my code? why does the google ad does not show?
It showed after the first post but not on the last one.
Please help...
big thanks...

      // Show the member's signature?
      if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
         echo '
                     <hr width="100%" size="1" class="hrcolor" />
                     <div class="signature">', $message['member']['signature'], '</div>';

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


if ($message['id'] == $context['first_message'])
echo '<tr><td class="titlebg"  style="border: 1px solid gray" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-710";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "2D5893";
google_color_bg = "99AACC";
google_color_link = "000000";
google_color_url = "000099";
google_color_text = "003366";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td></tr>'; }
if ( $context['num_replies'] > 1 )
echo '
<tr><td style="padding: 0 0 1px 0;"></td></tr><tr><td class="titlebg"  style="border: 1px solid gray" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-710";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "2D5893";
google_color_bg = "99AACC";
google_color_link = "000000";
google_color_url = "000099";
google_color_text = "003366";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td></tr>';


   echo '
</table>


dejiman

Hi thanks for all your effort . But i have tried to down load various mod form my SMF 1.1.4  eg global header and footer mod. and adsense Mod etc. But they are not just implementing after i have installed it. Please what can i do because i am what to add bidvertiser adsense code on my Forum and also include chat to my forum. Please help me.
IS YOUR DESTINY ELECETED?

Let's know here

ELECTED DESTINIES

Advertisement: