Advertisement:

Author Topic: Google AdSense in SMF, various positions...  (Read 398974 times)

Offline Moonray

  • Semi-Newbie
  • *
  • Posts: 50
    • Joomlaspan Forum
Re: Google AdSense in SMF, various positions...
« Reply #40 on: December 13, 2005, 04:36:20 AM »
Okay, I just changed the layout as per your suggestions, is that what you need?

Offline Eternity

  • Semi-Newbie
  • *
  • Posts: 59
  • Gender: Female
Re: Google AdSense in SMF, various positions...
« Reply #41 on: December 13, 2005, 05:07:50 AM »
Okay, I just changed the layout as per your suggestions, is that what you need?

Yes that was exactly what I was looking for.  How do I do that please.  Thanks so much for all your patience and assistance.  Our layout  is a bit different though for us it is more like this forum with a menu box at the top with all the login menus then a space then the main forum body.  Between that menu at the top and the forum body would be great. 
« Last Edit: December 13, 2005, 05:10:03 AM by Query »
http://www.tesda.org.uk
http://www.tesda.org.uk/Downloads

Open Source software is an innovative form and opportunity to break through the barriers of poverty and contribute positively to development and free trade.

Offline fanime7

  • Newbie
  • *
  • Posts: 1
Re: Google AdSense in SMF, various positions...
« Reply #42 on: December 16, 2005, 01:57:58 AM »
How do I add adsense under the first topic under (subject).  Just like joomlahacks.com

Offline Moonray

  • Semi-Newbie
  • *
  • Posts: 50
    • Joomlaspan Forum
Re: Google AdSense in SMF, various positions...
« Reply #43 on: December 16, 2005, 02:35:17 AM »
That's been added to the "to do" list. Thank you for the tip.

Watch this page on "Integration of Google AdSense in SMF"

Offline unExpected

  • Jr. Member
  • **
  • Posts: 101
  • Gender: Male
Re: Google AdSense in SMF, various positions...
« Reply #44 on: December 16, 2005, 02:39:39 AM »
Open Display.template.php Find
Code: [Select]
// 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>';

replace it with

Code: [Select]
// 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>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "YOURADSENSECODE";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text";
        google_ad_channel ="";
        google_color_border = "577494";
        google_color_bg = "577494";
        google_color_link = "FFFFFF";
        google_color_url = "999999";
        google_color_text = "EFEFEF";
        //--></script>
        <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
        </div>
         ';
      //End of the adsense Code
« Last Edit: August 05, 2007, 03:08:10 AM by Mashahood »
Newbie :)

Offline Moonray

  • Semi-Newbie
  • *
  • Posts: 50
    • Joomlaspan Forum
Re: Google AdSense in SMF, various positions...
« Reply #45 on: December 16, 2005, 03:00:25 AM »
Dear Mashahood,

The script you suggested inserts a google ad as a "second post". An example has already been posted here. What fanime7 asked was to add it as a "second topic" in a board.

Thanks

Offline bjp

  • Jr. Member
  • **
  • Posts: 163
Re: Google AdSense in SMF, various positions...
« Reply #46 on: December 20, 2005, 10:42:53 AM »
if ($message['id'] == $context['first_message'])

What about to show adsense in second post just for non member ?
« Last Edit: December 20, 2005, 12:44:14 PM by bjp »

Offline peterstannard

  • Full Member
  • ***
  • Posts: 536
Re: Google AdSense in SMF, various positions...
« Reply #47 on: December 21, 2005, 09:23:01 AM »
Is it possible to add Google Adsense to the "forum news" or to user signatures?
« Last Edit: December 21, 2005, 09:40:25 AM by peterstannard »

Offline EQWebHost

  • Newbie
  • *
  • Posts: 8
  • Gender: Male
  • EQWebHost.com
    • EQWebHost
Re: Google AdSense in SMF, various positions...
« Reply #48 on: December 23, 2005, 06:04:36 AM »
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here.
Have made new changes and will be releasing them soon. Need your feedback on any further improvements.
Thanks
--------
All information is now being compiled at hxxp:joomla.medspan.info/forum/index.php/board,15.0.html [nonactive] also.


Position 1: After 1st post

File to be modded: Display.template.php

Find this in the file:
Code: [Select]
// Show the member's signature?
if (!empty($message['member']['signature']) && empty($options['show_no_signatures']))
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%; padding-bottom: 3px;" class="signature">', $message['member']['signature'], '</div>';

echo '
</td>
</tr>
</table>
</td></tr>
</table>
</td></tr>';
[color=red]}[/color]

Insert this code, just ABOVE the "}" indicated in red, above.

Code: [Select]
if ($message['id'] == $context['first_message'])
echo '
<div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-youradsenseID";
        google_ad_width = 468;
        google_ad_height = 60;
        google_ad_format = "468x60_as";
        google_ad_type = "text";
        google_ad_channel ="yourCHANNEL";
        google_color_border = "577494";
        google_color_bg = "577494";
        google_color_link = "FFFFFF";
        google_color_url = "999999";
        google_color_text = "EFEFEF";
        //--></script>
        <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
  </div>
';

PS: Do not forget to put in your AdSense ID.

Demo:
hxxp:www.medspan.info/mediscuss/index.php/topic,3.0.html [nonactive]

Position 2: Top of all pages, mimicking a category! (High CTR)

File to be modded: index.template.php

This example is specifically for the smfaqua theme. Necessary modifications may be done for other themes also.


Find this in the file:
Code: [Select]
// The main content should go here.  A table is used because IE 6 just can't handle a div.

Insert this code, just BELOW the code given above.

Code: [Select]
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>


<td style="padding: 1ex 1px 2ex 1px;" width="100%" valign="top">
<div class="tborder">
<table border="0" width="100%" cellspacing="1" cellpadding="5" height="72">
<tr>
<td  colspan="4" class="catbg" height="18"><img src="/Themes/smfaqua/images/post_old.gif" class="midimage" alt="No New Posts" title="No New Posts" border="0" />
<font size="1">Sponsored Links</font>
</td>
</tr>
<tr class="topicbg1">
<td class="topicbg1" align="center" valign="middle"><img src="/Themes/smfaqua/images/on.gif"  border="0" /></td>
<td class="topicbg1" align="left" width="70%">
<div style="float:right;text-align:right;">
    <a href="index.php?action=post;board=1.0"><img src="/Themes/smfaqua/images/n.gif" alt="n" border="0" title="Start new topic" /></a>
    <a href="index.php?action=markasread;sa=board;board=1.0"><img src="/Themes/smfaqua/images/m.gif" alt="m" border="0" title="Mark Topics as Read for this Forum" /></a>
    <a href="index.php?action=notifyboard;sa=on;board=1.0;sesc=233047cc065c2e23891b5ce3e234432f"><img src="/Themes/smfaqua/images/z.gif" alt="z" border="0" title="Notify of replies" /></a>
</div>
<script type="text/javascript"><!--
    google_ad_client = "pub-youradsenseID";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
google_alternate_color = "F1F4F9"
    google_ad_type = "text";
    google_ad_channel ="youadsenseCHANNEL";
    google_color_border = "F1F4F9";
    google_color_bg = "F1F4F9";
    google_color_link = "094899";
    google_color_url = "787878";
    google_color_text = "333333";
    //--></script>
    <script type="text/javascript"
      src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
</td>
<td class="topicbg1" valign="middle" align="center" style="width: 10%;" nowrap="nowrap">
<span class="smalltext">1 Post in<br/>1 Topic</span></td>
<td class="topicbg1" valign="middle" width="30%" nowrap="nowrap">
<span class="smalltext"><img border="0" src="/Themes/smfaqua/images/f.gif" align="middle" title="" alt="" />Posted <b>Today</b>,at 12:00:00 AM<br>by <u>Google</u></span></td>
</tr>
<tbody class="sep_display"><tr style="height:5px;"><td style="height:5px;padding:0;" colspan="4" class="catbg"></td></tr><tr style="padding:0;"><td style="padding:0;" colspan="4"><div class="catsep"></div></td></tr></tbody>
</table>
</div>';

PS: Do not forget to put in your AdSense ID.

Demo:
hxxp:www.medspan.info/mediscuss/index.php [nonactive]

BOTH these have been tested to work seamlessly with the smfaqua theme. Will work in all themes with very little adaptations.


Also look at this if you are interested:


hxxp:mambo.medspan.info/myblog/tips-tricks/how-to-change-colors-the-chameleon-code-for-google-adsense/ [nonactive]

I followed all that, but I kept getting "parse errors"
hxxp:"http://EQWebHost.com" [nonactive]
hxxp:"http://WebJunky.info" [nonactive] (New) submit your hxxp:"www.webjunky.info/links" [nonactive] and hxxp:"www.webjunky.info/articels" [nonactive] now!
hxxp:"www.RateAHost.onfo" [nonactive] Rate Your Web host, or hxxp:"http://www.rateahost.info/add.php" [nonactive] and have your users hxxp:"http://www.rateahost.info/index.php?cmd=rateme" [nonactive] your service!

Offline aufordboy

  • Newbie
  • *
  • Posts: 4
  • Gender: Male
    • Talk Hunting Online
Re: Google AdSense in SMF, various positions...
« Reply #49 on: December 25, 2005, 05:55:15 PM »
Thanks - code works great!
-AUFordBoy
hxxp:www.talkhuntingonline.com [nonactive]
hxxp:www.aufordboy.com [nonactive]
hxxp:www.sportsbettingcash.com [nonactive]
hxxp:www.debt-consolidation-service.biz [nonactive]

Offline nokonium

  • Full Member
  • ***
  • Posts: 680
  • Gender: Male
  • TinyPortal Support Team
    • Our-Local
Re: Google AdSense in SMF, various positions...
« Reply #50 on: January 02, 2006, 07:35:47 PM »
One of my co-admins and I have been trying to get Adsense working properly with RC2. One insertion works fine, but adding a second and a third brings display problems, mostly only the first one shows. Sometimes with few refreshes you can get more than one.

Adsense and RC2 don't work well together.



Offline sadiqbaig

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
    • wapforum
Re: Google AdSense in SMF, various positions...
« Reply #51 on: January 17, 2006, 12:54:31 AM »
Google AdSense and SMF:


--------
EDIT:
Please check my new post in this thread here.
Have made new changes and will be releasing them soon. Need your feedback on any further improvements.
Thanks
--------
All information is now being compiled at this thread in Joomlaspan forum also.




i tried dowloading 4rm this url

http://joomla.medspan.info/joomla-downloads/func,fileinfo/id,12/

but i m not getting complete download

so plz copy ur code in here

GreenSense Index file with Google Banner on Top

or email me

sadiqbaig@gmail.com

plz plz

Offline sadiqbaig

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
    • wapforum
Re: Google AdSense in SMF, various positions...
« Reply #52 on: January 17, 2006, 01:00:19 AM »

plz give the code in here

i want to add it in default theme

its in display.template.php

but its not working

google ads in users avataar , n signatures

also i tried skyscaper ad but how to get it in left

no links to the forum or other site plz

plz post the code in here

Offline sadiqbaig

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
    • wapforum
Re: Google AdSense in SMF, various positions...
« Reply #53 on: January 17, 2006, 01:07:00 AM »

also how to add it in

board category

like

General Discussion
Feel free to talk about anything and everything in this board.

Google ads


Offline StanJ

  • Jr. Member
  • **
  • Posts: 173
Re: Google AdSense in SMF, various positions...
« Reply #55 on: February 05, 2006, 01:41:55 PM »
Strange

When I put the code in as given by shashikiranu, and ad my own adsense pub-etc  etc etc

I get a link basically sending them to his referal page for amazom or similar.

Am I doing something wrong or is he getting a zillion links on this?

Thanks
« Last Edit: February 05, 2006, 01:52:52 PM by StanJ »

Offline StanJ

  • Jr. Member
  • **
  • Posts: 173
Re: Google AdSense in SMF, various positions...
« Reply #56 on: February 05, 2006, 01:57:04 PM »
This is what i have now, and it is coming up blank...
??

Any ideas?
www.foroadventista.com
Quote
// 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>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-4098094541740579";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text_image";
        google_ad_channel ="4809291968";
        google_color_border = "577494";
        google_color_bg = "577494";
        google_color_link = "FFFFFF";
        google_color_url = "999999";
        google_color_text = "EFEFEF";
        //--></script>
        <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
        </div>
         ';
      //End of the adsense Code
}
   echo '
   <tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>

Offline TheChicken

  • Semi-Newbie
  • *
  • Posts: 61
Re: Google AdSense in SMF, various positions...
« Reply #57 on: February 05, 2006, 01:59:58 PM »
This is just a guess but try this,
Code: [Select]
// 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><tr><td>';
      //Show Google Adsense after the 1st post
if ($message['id'] == $context['first_message'])
         echo '
         <div align="center">
        <script type="text/javascript"><!--
        google_ad_client = "pub-4098094541740579";
        google_ad_width = 728;
        google_ad_height = 90;
        google_ad_format = "728x90_as";
        google_ad_type = "text_image";
        google_ad_channel ="4809291968";
        google_color_border = "577494";
        google_color_bg = "577494";
        google_color_link = "FFFFFF";
        google_color_url = "999999";
        google_color_text = "EFEFEF";
        //--></script>
        <script type="text/javascript"
          src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
        </script>
        </div>
         ';
      //End of the adsense Code
}
   echo '
   </td><tr><td style="padding: 0 0 1px 0;"></td></tr>
</table>

Offline StanJ

  • Jr. Member
  • **
  • Posts: 173
Re: Google AdSense in SMF, various positions...
« Reply #58 on: February 05, 2006, 02:24:29 PM »
Appreciate your input ,  it is still not working BUT  the blank is not under the first post rather than on top of it.

I am using tinyportal  but do not think that affects it at all.  When I used the other guys code it was showing up with links to his afflicate page...

Weird

« Last Edit: February 07, 2006, 08:23:17 AM by StanJ »

Offline TheChicken

  • Semi-Newbie
  • *
  • Posts: 61
Re: Google AdSense in SMF, various positions...
« Reply #59 on: February 05, 2006, 02:33:33 PM »
Oh yeah, Google ads can take time to show up for some reason. There usually not instant to show up.