Advertisement:

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

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
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
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.