Author Topic: How to Insert Allstudentforum type of ads within smf forum first post  (Read 1174 times)

0 Members and 1 Guest are viewing this topic.

Offline mfoniso

  • Administrator
  • Hero Member
  • *****
  • Posts: 2273
  • Country: ng
  • Karma: +0/-0
  • Gender: Male
    • Play Lsit Hub
How to Insert Allstudentforum type of ads within smf forum first post.
If you have been a regular user of all student forum, you most have notice the placement
of our sponsored ads within our first post and most of you have been asking how you could
also do this for your smf forum. This was actually inspired by my desire on How to place Nairaland type of ads on my smf forum.
Hoever i am here today to guide you guys through on how you can also do
this.

How to place Allstudentforum type of ads within smf forum first post.
To do this, 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:308px;">
<table width="308" height="190" border="0" cellspacing="5" cellpadding="1">
  <tr>
    <td><a href="Company website 1"><img src="Yoursite.com/Company website 1 ads" /></td>
    <td><a href="Company website 2"><img src="Yoursite.com/Company website 2 ads" /></td>
  </tr>
  <tr>
    <td><a href="Company website 3"><img src="Yoursite.com/Company website 3 ads" /></td>
    <td><a href="Company website 4"><img src="Yoursite.com/Company website 4 ads" /></td>
  </tr>
</table>                       
</div>';
      echo '   
               ', $message['body'], '</div>

Now you can save this changes. Remember to replace the company website with the real website link of the company you which to advertise and also make sure
the image source of the company ads is correct. this what i mean, replace the Yoursite.com/Company website 1 ads, with the real location of your website link
holding the company ads.

Finally to make the ads rotate every time a user or quest visit your site, you will need to download this php script that has been put together to help you achieve this, download this php script and follow this step bellow.
To install the script, simply download it and place it in any folder, preferably the one that holds your ads in your root server. How ever in this default configuration, all ads (banner, image, etc) from the folder where the script is located will been display.
Example
Code: [Select]
public_html/ads/local ads/rotate.php Now once you have this script on your server, remember to place the script in the same directory or folder where the company ads will be located. if you have 4 folder for your different company, make sure you copy the rotate.php into those 4 folder.
That is all.  :be happy:, ask your questions and i will answer them for you.
« Last Edit: October 14, 2013, 11:56:34 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 jearile2006

  • Jr. Member
  • **
  • Posts: 85
  • Country: ng
  • Karma: +0/-0
    • Uniport forum
Re: How to Insert Allstudentforum type of ads within smf forum first post
« Reply #1 on: November 20, 2013, 06:31:12 PM »
Tanx a great deal for sharing ur skillful secrets... but i think the "a href" closing tag for one of the codes is missing; plz cross check and correct me if am wrong... I really do appreciate your time and efforts, ciao.

Offline mfoniso

  • Administrator
  • Hero Member
  • *****
  • Posts: 2273
  • Country: ng
  • Karma: +0/-0
  • Gender: Male
    • Play Lsit Hub
Re: How to Insert Allstudentforum type of ads within smf forum first post
« Reply #2 on: November 20, 2013, 09:51:07 PM »
Thanks for pointing me to that, i most have missed that, bellow is the corrected code
Code: [Select]
<div class="inner" id="msg_', $message['id'], '"', '>';
                 if ($message['id'] == $context['first_message'])
      echo '
                       <div style="float:right; width:308px;">
<table width="308" height="190" border="0" cellspacing="5" cellpadding="1">
  <tr>
    <td><a href="Company website 1"><img src="Yoursite.com/Company website 1 ads" /></a></td>
    <td><a href="Company website 2"><img src="Yoursite.com/Company website 2 ads" /></a></td>
  </tr>
  <tr>
    <td><a href="Company website 3"><img src="Yoursite.com/Company website 3 ads" /></a></td>
    <td><a href="Company website 4"><img src="Yoursite.com/Company website 4 ads" /></a></td>
  </tr>
</table>                       
</div>';
      echo '   
               ', $message['body'], '</div>
Please do not PM me questions, ask all your questions in the forum, for others to learn from.

All Student Forum

Re: How to Insert Allstudentforum type of ads within smf forum first post
« Reply #2 on: November 20, 2013, 09:51:07 PM »

 

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
13 Replies
4681 Views
Last post November 18, 2016, 05:12:48 PM
by mfoniso
0 Replies
1955 Views
Last post October 14, 2013, 12:24:12 PM
by mfoniso
5 Replies
710 Views
Last post February 06, 2015, 05:51:21 PM
by mfoniso
16 Replies
1047 Views
Last post October 04, 2015, 04:50:31 PM
by nobleman
0 Replies
97 Views
Last post May 29, 2017, 10:29:54 AM
by mfoniso