SimplePortal
Customization => Custom Coding => Topic started by: allemand1 on May 01, 2009, 11:01:34 AM
-
Hi, i need to know the contexzt of the first post en SMF 1.1.8.
Something like this:
if ($context['first_post'])
-
What's "context"? You mean the id or the data? And where? In Display.template.php?
-
I want to put a banner, only in the first post.
So in display.template, i have to made a modification.
Something like:
if ($context['first_post'])
echo ' <script type="text/javascript"><!--
google_ad_client = "pub-7294251511049014";
/* 125x125, creado 1/05/09 */
google_ad_slot = "6302082580";
google_ad_width = 125;
google_ad_height = 125;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>';
-
You can use $context['first_message'] for the first post on the page and $context['topic_first_message'] for the first post of the topic in the messages loop in Display.template.php. Should be something like this:
if ($message['id'] == $context['first_message'])
echo 'Ads';
However, I'd suggest using this mod instead:
http://custom.simplemachines.org/mods/index.php?mod=255
-
Thanks.. i will try it...
I known that mod.... but i need to put the banners in especific places...