Advertisement:

Author Topic: [SMF Tip] Various Ad Placements  (Read 41552 times)

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
[SMF Tip] Various Ad Placements
« on: April 22, 2011, 11:27:52 AM »
This quick SMF tip will show you where you can put various ads on your page (using Google's Adsense for example) using template edits. This is just if you would like to add a quick ad or two on your pages, if you want full control and automation for ads then I suggest you use a modification. This tutorial was made for SMF 2.0.
 
Under the navigation menu
 
This will display the ad right under your navigation menu. In your theme's index.template.php, find,
Code: [Select]
// Show the menu here, according to the menu sub template.
 template_menu();
 
 echo '
  <br class="clear" />
 </div></div>';

Above the two div tags, two new tags will be made to move the ad code down a line and a div tag with style properties to center it. Here is an example of what it should look like when done,
Code: [Select]
echo '
  <br class="clear" />
<br />
<div style="text-align: center;">
PLACE YOUR AD CODE HERE
</div>
 </div></div>';

Under the Who's Online
 
From here, your ad will be displayed under the Who's Online section of your forum. In your theme's index.template.php, find,
Code: [Select]
echo '
  </div>
 </div></div>';
 
 // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!

And replace that with,
Code: [Select]
echo '
<br />
<div style="text-align: center;">
PLACE YOUR AD CODE HERE
</div>
  </div>
 </div></div>';
 
 // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!

Remember to place your ad code in there.
 
Above the first post
 
This will display your ad above the original poster's message in a topic. In your theme's Display.template.php, find,
Code: [Select]
  echo '
        <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
       </div>';

Replace that with,
Code: [Select]
  echo '
        <div class="inner" id="msg_', $message['id'], '"', '>' . ($message['counter'] == 0 ? '<div style="text-align: left;">
YOUR AD CODE HERE
</div>
<br />' : '') . '', $message['body'], '</div>
       </div>';

This code determines if the message is the first one in the topic, it will display the ad above the message. If you want this to be displayed to guests only, in the above code change,
Code: [Select]
$message['counter'] == 0 ?To,
Code: [Select]
$message['counter'] == 0 && $context['user']['is_guest'] ?
To the right of the first post
 
This will display your ad floating to the right of the first message of the original topic. Follow the instructions above, except change,
Code: [Select]
<div style="text-align: left;">To,
Code: [Select]
<div style="float: right;">
 
That concludes this small SMF tip. Some mods of interest:
Global Headers and Footers - You can use this mod to display the ads only in the header and footer.
http://custom.simplemachines.org/mods/index.php?mod=351
 
Ad Management - Modification for displaying these ads in specified locations.
http://custom.simplemachines.org/mods/index.php?mod=255
 
Thanks for reading!

kat

  • Guest
Re: [SMF Tip] Various Ad Placements
« Reply #1 on: April 22, 2011, 11:54:46 AM »
As this is a tip, I've moved it to...


er...


Tips!

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #2 on: April 22, 2011, 11:55:50 AM »
As this is a tip, I've moved it to...


er...


Tips!

Woohoo!  O:)

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #3 on: April 22, 2011, 11:56:59 AM »
* Ad Management Mod comes to mind to simplify this...
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

kat

  • Guest

Offline Masterd

  • SMF Hero
  • ******
  • Posts: 3,921
  • Gender: Male
Re: [SMF Tip] Various Ad Placements
« Reply #5 on: April 22, 2011, 03:31:41 PM »
This is a really nice tip. :D

Offline NHWD

  • Jr. Member
  • **
  • Posts: 304
Re: [SMF Tip] Various Ad Placements
« Reply #6 on: April 23, 2011, 02:19:00 AM »
* Ad Management Mod comes to mind to simplify this...

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #7 on: April 23, 2011, 10:26:44 AM »
This is just if you would like to add a quick ad or two, if you want full control and automation for ads then I suggest you use a modification.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #8 on: April 23, 2011, 02:12:50 PM »
This is just if you would like to add a quick ad or two, if you want full control and automation for ads then I suggest you use a modification.
* Ad Management Mod comes to mind to simplify this...

:P

That mod handles large and tiny needs for ads.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #9 on: April 23, 2011, 02:17:54 PM »
This is just if you would like to add a quick ad or two, if you want full control and automation for ads then I suggest you use a modification.
* Ad Management Mod comes to mind to simplify this...

:P

That mod handles large and tiny needs for ads.

Personally, I wouldnt bother with a mod if im adding an ad or two. Like what if the mod had errors anyway, you would have to fix them just to display the one or two ads you want. :p

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #10 on: April 23, 2011, 02:19:05 PM »
This is just if you would like to add a quick ad or two, if you want full control and automation for ads then I suggest you use a modification.
* Ad Management Mod comes to mind to simplify this...

:P

That mod handles large and tiny needs for ads.

Personally, I wouldnt bother with a mod if im adding an ad or two. Like what if the mod had errors anyway, you would have to fix them just to display the one or two ads you want. :p
I'd rather be lazy and use that mod for it; it's not there just for the looks of it (can't say that it looks bad, however) :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline 008Rohit

  • Semi-Newbie
  • *
  • Posts: 84
  • Gender: Male
    • TechTage
Re: [SMF Tip] Various Ad Placements
« Reply #11 on: April 24, 2011, 10:53:35 AM »
as vbgamer's Ad Management mod doesnt completely work with CORE theme I am hoping for code from you for placing ads after the last post of a topic. :)
TechTage Forum - Vintage Technology - on MDDHosting - CloudLinux & LiteSpeed Powered - MDDHosting Review

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #12 on: April 24, 2011, 11:03:14 AM »
as vbgamer's Ad Management mod doesnt completely work with CORE theme I am hoping for code from you for placing ads after the last post of a topic. :)
Because Core is based from SMF 1.1.x and Curve is from 2.0...
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #13 on: April 24, 2011, 11:16:41 AM »
as vbgamer's Ad Management mod doesnt completely work with CORE theme I am hoping for code from you for placing ads after the last post of a topic. :)

If you need it somewhere and cant find it (which is most probable since I based this on SMF 2.0) I am willing to help find it for you.  ;)

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,982
    • StoryBB/StoryBB on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #14 on: April 24, 2011, 11:27:27 AM »
as vbgamer's Ad Management mod doesnt completely work with CORE theme I am hoping for code from you for placing ads after the last post of a topic. :)
Because Core is based from SMF 1.1.x and Curve is from 2.0...

It apparently doesn't work properly actually on the Core theme, either the 1.1.x or 2.0 versions... and by all accounts doesn't uninstall properly either.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Hj Ahmad Rasyid Hj Ismail

  • SMF Hero
  • ******
  • Posts: 4,916
  • Gender: Male
  • Busy mode is on.
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • @ahrasis on Twitter
    • ElkArte Malaysia
Re: [SMF Tip] Various Ad Placements
« Reply #15 on: April 24, 2011, 11:28:19 AM »
Though I like using mods, I like having a tip and trick like this, just in case I need to do things manually later on. Thanks for the tips and tricks PE.

Offline Sandra Khairul Riz

  • Newbie
  • *
  • Posts: 5
Re: [SMF Tip] Various Ad Placements
« Reply #16 on: April 24, 2011, 02:44:40 PM »
Hi, I really like these coding tips.  Please how can I display ad after the first post in smf 2.0. Thanks

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #17 on: April 24, 2011, 02:45:19 PM »
Hi, I really like these coding tips.  Please how can I display ad after the first post in smf 2.0. Thanks
With Ad Management Mod. And in this topic if you read further then your nose is :P
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Rs Bots Pro

  • Semi-Newbie
  • *
  • Posts: 61
Re: [SMF Tip] Various Ad Placements
« Reply #18 on: April 26, 2011, 05:21:20 PM »
Hi, I really like these coding tips.  Please how can I display ad after the first post in smf 2.0. Thanks
With Ad Management Mod. And in this topic if you read further then your nose is :P
none of the mods work with the majority of themes for RC4 & 5 and the ad management mod doesnt work with the default theme curve on RC5 =/ =[

Offline skotinos

  • Semi-Newbie
  • *
  • Posts: 16
Re: [SMF Tip] Various Ad Placements
« Reply #19 on: May 13, 2011, 10:21:14 PM »
Hi, I really like these coding tips.  Please how can I display ad after the first post in smf 2.0. Thanks
With Ad Management Mod. And in this topic if you read further then your nose is :P
none of the mods work with the majority of themes for RC4 & 5 and the ad management mod doesnt work with the default theme curve on RC5 =/ =[

yes, really do not work

Offline abidejaz4u

  • Jr. Member
  • **
  • Posts: 387
Re: [SMF Tip] Various Ad Placements
« Reply #20 on: July 17, 2011, 08:25:56 AM »
i want to put ads in the post???

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #21 on: July 17, 2011, 11:07:04 AM »
i want to put ads in the post???

Look at the last heading.

Offline DragonLady

  • Semi-Newbie
  • *
  • Posts: 98
    • Stitcher's Guild Sewing Forum
Re: [SMF Tip] Various Ad Placements
« Reply #22 on: August 02, 2011, 01:00:15 AM »
Hi everyone! :D

I'm trying to add a row of small banners to Curve theme, but everytime I try I give myself parse errors.  Can anyone give me a step-by-step like the one in the OP for putting them along the bottom under "who's online"?

I'd appreciate it very, very much!

Thanks in advance,

DL

edited to say 'curve' not 'core'
« Last Edit: August 02, 2011, 01:06:23 AM by DragonLady »

Offline DragonLady

  • Semi-Newbie
  • *
  • Posts: 98
    • Stitcher's Guild Sewing Forum
Re: [SMF Tip] Various Ad Placements
« Reply #23 on: August 02, 2011, 01:11:11 AM »
Ah...got it!  Thank-you!!!!! :D

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,075
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: [SMF Tip] Various Ad Placements
« Reply #24 on: August 13, 2011, 11:22:54 AM »
Very cool tip.
The ad mod has an annoying copyright in the footer.  This tip is the way to go.

Offline moguns

  • Semi-Newbie
  • *
  • Posts: 73
Re: [SMF Tip] Various Ad Placements
« Reply #25 on: August 14, 2011, 12:16:40 PM »
If I wanted to ad this:
Quote
<div align="center"><a href="http://membership.nrahq.org/default.asp?campaignid=XR024435"><img alt="JOIN_NRA07" src="http://www.mogunowners.net/JOIN_NRA07.gif" style="border: 0px solid; margin: 0px;"></a><a href="http://membership.nrahq.org/default.asp?campaignid=XR024435"><font color="#ff0000" face="'Arial Black', Helvetica, sans-serif" size="3">10$ off discount for full year NRA memberships through MOGO!</font><font color="#ff0000">&nbsp;</font></a></div>

What do I do? I put it in and I get a error.

Any help would be great
« Last Edit: August 14, 2011, 12:37:30 PM by moguns »

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #26 on: August 14, 2011, 12:53:54 PM »
I need to know what sort of error you get.

Offline moguns

  • Semi-Newbie
  • *
  • Posts: 73
Re: [SMF Tip] Various Ad Placements
« Reply #27 on: August 14, 2011, 01:12:48 PM »
I get this:

Quote
Parse error: syntax error, unexpected T_STRING in .../Themes/default/Display.template.php on line 506
when I add this.
Quote
echo '
        <div class="inner" id="msg_', $message['id'], '"', '>' . ($message['counter'] == 0 ? '<div style="text-align: left;">
<div align="center"><a href="http://membership.nrahq.org/default.asp?campaignid=XR024435"><img alt="JOIN_NRA07" src="http://www.mogunowners.net/JOIN_NRA07.gif" style="border: 0px solid; margin: 0px;"></a><a href="http://membership.nrahq.org/default.asp?campaignid=XR024435"><font color="#ff0000" face="'Arial Black', Helvetica, sans-serif" size="3">10$ off discount for full year NRA memberships through MOGO!</font><font color="#ff0000">&nbsp;</font></a></div>
</div>
<br />' : '') . '', $message['body'], '</div>


Thank you for you help

Offline Mick.

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,075
  • Gender: Male
    • idesignSMF on Facebook
    • @idesign360 on Twitter
    • idesignSMF.com
Re: [SMF Tip] Various Ad Placements
« Reply #28 on: August 14, 2011, 01:45:22 PM »
Looks like you forgot to add the '; after the last div..... and it may also need an echo' to start the rest of the default code.

Offline moguns

  • Semi-Newbie
  • *
  • Posts: 73
Re: [SMF Tip] Various Ad Placements
« Reply #29 on: August 14, 2011, 02:42:29 PM »
I have it showing. But it highlights the hole message as a link. Is that right?

Thanks

Offline die2mrw007

  • Jr. Member
  • **
  • Posts: 266
    • GizmoLord on Facebook
    • @Gizmo_Lord on Twitter
    • GizmoLord
Re: [SMF Tip] Various Ad Placements
« Reply #30 on: September 17, 2011, 11:00:34 AM »
I need to have adsense leaderboard layout under the top navigation menu

But there is no such code in my theme index_template.php file

Here is what I found a similar code with template_menu() function:

Quote
echo '
         </div>
      </div>
   </div>
   <div id="toolbar">
      <div class="wrapper">
         ', template_menu(), '
      </div>
   </div>
   <div id="main_body">
      <div class="wrapper">

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #31 on: September 17, 2011, 12:10:31 PM »
Try placing it under the call to template_menu().

Offline die2mrw007

  • Jr. Member
  • **
  • Posts: 266
    • GizmoLord on Facebook
    • @Gizmo_Lord on Twitter
    • GizmoLord
Re: [SMF Tip] Various Ad Placements
« Reply #32 on: September 17, 2011, 12:25:05 PM »
Try placing it under the call to template_menu().

I tried and it worked..but not at the desired location..
And sorry, I actually want it not straight under the navigation menu...

I have attached a screenshot...this is where I want the ad to be present...(currently using a mod)
And I dont wish to use any mod for this.


Offline die2mrw007

  • Jr. Member
  • **
  • Posts: 266
    • GizmoLord on Facebook
    • @Gizmo_Lord on Twitter
    • GizmoLord
Re: [SMF Tip] Various Ad Placements
« Reply #33 on: September 17, 2011, 12:25:56 PM »
I am unable to attach any file here :(
Why so ??

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #34 on: September 17, 2011, 12:42:45 PM »
Then it would probably be under where <div class="wrapper"> is.

Offline bigletterj

  • Semi-Newbie
  • *
  • Posts: 18
Re: [SMF Tip] Various Ad Placements
« Reply #35 on: October 25, 2011, 01:37:33 PM »
I just installed the google ads successfully but the
Code: [Select]
<br> doesn't work after the Google ad code. Even the
Code: [Select]
<br style="clear:both;" /> is not working. So now, it is overlapping the content on the forum. Please see http://forums.kshownow.asia/index.php [nofollow] to see how it looks like now.
« Last Edit: October 25, 2011, 01:41:21 PM by bigletterj »

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #36 on: October 25, 2011, 04:31:48 PM »
I just installed the google ads successfully but the
Code: [Select]
<br> doesn't work after the Google ad code. Even the
Code: [Select]
<br style="clear:both;" /> is not working. So now, it is overlapping the content on the forum. Please see http://forums.kshownow.asia/index.php to see how it looks like now.

I cant seem to find an issue with both IE9 and FF4. Is this happening at a certain area, what browser were you viewing it on?

Offline Bulldog091

  • Newbie
  • *
  • Posts: 3
Re: [SMF Tip] Various Ad Placements
« Reply #37 on: November 19, 2011, 02:09:43 PM »
Thanks for the tip, works like a Swiss watch  :D

Offline ayex

  • Semi-Newbie
  • *
  • Posts: 14
Re: [SMF Tip] Various Ad Placements
« Reply #38 on: November 22, 2011, 02:35:31 AM »
Please where in display.template.php will I edit to show this in message body but below the posts not above. I want the ad to be immediately after the post like its part of the post not in another line like ad management mode did it. I want the add to be part of the message content and not segmented or seperated.

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #39 on: November 22, 2011, 04:54:03 PM »
Please where in display.template.php will I edit to show this in message body but below the posts not above. I want the ad to be immediately after the post like its part of the post not in another line like ad management mode did it. I want the add to be part of the message content and not segmented or seperated.

Does this go above the last edit text? Can I have a picture example?

Offline ayex

  • Semi-Newbie
  • *
  • Posts: 14
Re: [SMF Tip] Various Ad Placements
« Reply #40 on: November 23, 2011, 12:29:43 PM »
This below is exactly what i want to achiev. i want to add my addthis code to display below every first posts.
This is my addthis code
Code: [Select]
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-4ebe356d72f8f3b3"></script>
<!-- AddThis Button END -->
Please where do i place my addthis code for it to appear inside the post like below. I want the share button to be part of the messge body and not divided by a line away from the message body like the ad management mod did it.

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #41 on: November 23, 2011, 04:43:51 PM »
Okay, lets give this a shot then. In Display.template.php,
Code: (After) [Select]
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
Code: (Add) [Select]
' . ($message['counter'] == 0 && $context['user']['is_guest'] ? '<br /><div style="text-align: left;">
   YOUR AD CODE HERE
</div>' : '') . '

All you have to do is replace YOUR AD CODE HERE with the code snippet you provided.
Therefore, the entire code modified should look something like,
Code: [Select]
echo '
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
                                ' . ($message['counter'] == 0 && $context['user']['is_guest'] ? '<br /><div style="text-align: left;">
                                    YOUR AD CODE HERE
                                </div>' : '') . '
</div>';

Offline ayex

  • Semi-Newbie
  • *
  • Posts: 14
Re: [SMF Tip] Various Ad Placements
« Reply #42 on: November 24, 2011, 01:09:52 PM »
Thanks it worked on my web version but it didnt work on my wap2. i want the codes to be showing on wap2 after inside the post too. Please how do i do that?, thanks for the help

I read that if someone want to display anything both in web and wap2, then sources/display.php is to be edit?. Please Project Evolution, where will i edit in my sources/display.php to be able to place addthis button below the first post both in web and wap2. Thanks alot for your time
« Last Edit: November 24, 2011, 02:33:51 PM by ayex »

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [SMF Tip] Various Ad Placements
« Reply #43 on: November 25, 2011, 04:38:01 PM »
Thanks it worked on my web version but it didnt work on my wap2. i want the codes to be showing on wap2 after inside the post too. Please how do i do that?, thanks for the help

I read that if someone want to display anything both in web and wap2, then sources/display.php is to be edit?. Please Project Evolution, where will i edit in my sources/display.php to be able to place addthis button below the first post both in web and wap2. Thanks alot for your time

If you go to Wireless.template.php, and find the template_wap_display function, this is responsible for what is rendered to your WAP-enabled device.

If you modify something along the lines of,
Code: [Select]
echo '
<p><u>', $message['member']['name'], '</u>:', (!$message['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '<br /></p>
<p>', $message['body'], '<br /><br /></p>';

You can get this working. I just dont know how it would work if you added the div and script tags in there, so give it a shot.

Offline swaggaderby

  • Jr. Member
  • **
  • Posts: 129
Re: [SMF Tip] Various Ad Placements
« Reply #44 on: October 17, 2014, 02:42:46 PM »
what about adding ads inside all post....?

Offline Hj Ahmad Rasyid Hj Ismail

  • SMF Hero
  • ******
  • Posts: 4,916
  • Gender: Male
  • Busy mode is on.
    • ahmad.rasyid.ismail on Facebook
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • @ahrasis on Twitter
    • ElkArte Malaysia
Re: [SMF Tip] Various Ad Placements
« Reply #45 on: October 18, 2014, 12:35:54 AM »
Code: [Select]
  echo '
        <div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
       </div>';

Replace that with,
Code: [Select]
  echo '
        <div class="inner" id="msg_', $message['id'], '"', '>' . ($message['counter'] == 0 ? '<div style="text-align: left;">
YOUR AD CODE HERE
</div>
<br />' : '') . '', $message['body'], '</div>
       </div>';

Change the replacement code to:
Code: [Select]
  echo '
        <div class="inner" id="msg_', $message['id'], '"', '>
YOUR AD CODE HERE
</div>
<br />', $message['body'], '</div>
       </div>';