Introduction | Breaking News | General Discussion | Whats On Your Mind?| My School | Campus Gist | My Career | Grants & Scholarships | Study Abroad | Student Projects | Examination Bodies | Books/Literature/Writing | Words Of Wisdom | NYSC Press Board | Self Development | Study Class Q&A | Politics | Student Travel | Religion

FB Tips On Pc's| Modems | Antivirus | Technology Market | Automobiles| Mobile Phones, | FB Tips On Phones | My Computer | Programming | Webmasters | Celebrities | Jokes & Funny Stuff | Games | Movies | Football | Other Sporting Activities | General Health & Fitness | Sexual Health | Romance | Advertising| Automobiles |

Starting an online business | Real Estate | Banking And Insurance | E-currencies | Administrative Jobs | Banking Jobs | ICT Jobs | Engineering Jobs | Law Jobs | Medical Jobs | Hotels Jobs | Vacancies | Unclassified Jobs | OverSea Jobs | SCAM DESK | Business And Related issues

Author Topic: How to place Google Adsense and other Ads within your smf forum first post  (Read 12562 times)

0 Members and 1 Guest are viewing this topic.

Offline mfoniso

  • Administrator
  • Hero Member
  • *****
  • Posts: 1984
  • Country: ng
  • Karma: +0/-0
  • Gender: Male
    • Play Lsit Hub
How to place Google Adsense and other Ads within your smf forum first post.
You most have noticed this in a lot of smf forum, and probably you wish to do same on you own forum. well you will be delighted that to do this is very simple, you can actually place Google adsense or that of any ads network.
To place Google Adsense and other Ads within your smf forum first post, you will need to follow the steps bellow.
1. Log Into Your Control panel, where your files are hosted in the root server of your site, that is public_html

2. Navigate and click on the Themes Folder .

3. Then Click on Default folder.

4. Select Display.template.php file and click Edit your.

After the Edit page has opened, Find this code bellow by press Ctrl F on your keyboard and then typing or copy and paste the code in the find box.
Code: [Select]
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>Once you have located the code, then replace the code with this one bellow.
Code: [Select]
<div class="inner" id="msg_', $message['id'], '"', '>';
                 if ($message['id'] == $context['first_message'])
      echo '
                        <div style="float:right; width:270px;">
                        <script type="text/javascript"><!--
                        google_ad_client = "pub-xxxxxxxxxxxxxxx";
                        /* 250x250, created 9/07/11 bforum text */
                        google_ad_slot = "xxxxxxxxxxxx";
                        google_ad_width = 250;
                        google_ad_height = 250;
                        //-->
                        </script>
                        <script type="text/javascript"
                        src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                        </script></div>';
      echo '   
               ', $message['body'], '</div>

Then save and you are done. Dont forget to replace the pub-xxxxxxxxxxxxxxx with your own adsense publisher ID, if not your ads wont show.
feel free to drop a reply if this work for you.


Please do not PM me questions, ask all your questions in the forum, for others to learn from.

All Student Forum


Offline lola

  • Jr. Member
  • **
  • Posts: 63
  • Country: ng
  • Karma: +0/-0
  • Gender: Female
Thank you so much sir.... I want to ask if I can do this via my admin dashboard or is it better I use control panel?
Nobody is Useless

Offline mfoniso

  • Administrator
  • Hero Member
  • *****
  • Posts: 1984
  • Country: ng
  • Karma: +0/-0
  • Gender: Male
    • Play Lsit Hub
You cant do it via admin dashboard. You will have to login to your cpanel, then
1. click on public_html
2. click on the Themes Folder, once it opens
3. click on the Default folder among the listed items in the Themes folder you opened.
4. Once the Default folder opens, Select Display.template.php file and click on Edit on the top section of your cpanel.
5. Then find the above code and replace it as i have explain above.

NOTE: Replace the above adsense code with your true adsense code. (i mean this code adsense code below).

Code: [Select]
<script type="text/javascript"><!--
                        google_ad_client = "pub-xxxxxxxxxxxxxxx";
                        /* 250x250, created 9/07/11 bforum text */
                        google_ad_slot = "xxxxxxxxxxxx";
                        google_ad_width = 250;
                        google_ad_height = 250;
                        //-->
                        </script>
                        <script type="text/javascript"
                        src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                        </script>

Let me know if you have challenges doing this.
« Last Edit: April 02, 2017, 10:36:22 AM by mfoniso »
Please do not PM me questions, ask all your questions in the forum, for others to learn from.

All Student Forum


Offline lola

  • Jr. Member
  • **
  • Posts: 63
  • Country: ng
  • Karma: +0/-0
  • Gender: Female
okay sir.... i am gonna try that... thanks a lot
Nobody is Useless

Offline mfoniso

  • Administrator
  • Hero Member
  • *****
  • Posts: 1984
  • Country: ng
  • Karma: +0/-0
  • Gender: Male
    • Play Lsit Hub
ok, no problem
Please do not PM me questions, ask all your questions in the forum, for others to learn from.

All Student Forum


Offline lola

  • Jr. Member
  • **
  • Posts: 63
  • Country: ng
  • Karma: +0/-0
  • Gender: Female
please i still don't get this...... can you please use "paste add code here" (Where we should paste the add code) instead of those adsense code u placed
Nobody is Useless

Offline mfoniso

  • Administrator
  • Hero Member
  • *****
  • Posts: 1984
  • Country: ng
  • Karma: +0/-0
  • Gender: Male
    • Play Lsit Hub
If i understand you well, you mean i should remove the dummy adsense code and use the paste add code here ok, then this is how it should be
1. In your display.templete.php,
find the code below
Code: [Select]
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
Then replace it with
Code: [Select]
<div class="inner" id="msg_', $message['id'], '"', '>';
                 if ($message['id'] == $context['first_message'])
      echo '
                        <div style="float:right; width:270px;">

PASTE YOUR ADSENSE CODE HERE                       
</div>';
      echo '   
               ', $message['body'], '</div>

NOTE: Remember to replace PASTE YOUR ADSENSE CODE HERE with your true adesense code.
Please do not PM me questions, ask all your questions in the forum, for others to learn from.

Offline lola

  • Jr. Member
  • **
  • Posts: 63
  • Country: ng
  • Karma: +0/-0
  • Gender: Female
thanks... i got it... you know for dummy like us
Nobody is Useless

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
10 minus 10 = ?:
What letter is missing in this word 'Gogle':

Related Topics

  Subject / Started by Replies Last post
0 Replies
1704 Views
Last post September 23, 2013, 10:58:44 PM
by debby
5 Replies
1824 Views
Last post October 02, 2013, 09:50:37 AM
by jearile2006
0 Replies
461 Views
Last post March 11, 2014, 11:42:53 AM
by debby
0 Replies
507 Views
Last post March 20, 2014, 10:28:22 PM
by debby
0 Replies
51 Views
Last post April 08, 2017, 03:43:08 PM
by mfoniso