SimplePortal

Customization => Custom Coding => Topic started by: allemand1 on May 01, 2009, 11:01:34 AM

Title: [Help] context first post!!!
Post 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'])
Title: Re: [Help] context first post!!!
Post by: [SiNaN] on May 04, 2009, 01:28:21 AM
What's "context"? You mean the id or the data? And where? In Display.template.php?
Title: Re: [Help] context first post!!!
Post by: allemand1 on May 04, 2009, 02:02:37 PM
I want to put a banner, only in the first post.
So in display.template, i have to made a modification.
Something like:
Code: [Select]
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>';
Title: Re: [Help] context first post!!!
Post by: [SiNaN] on May 04, 2009, 02:09:49 PM
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:

Code: [Select]
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
Title: Re: [Help] context first post!!!
Post by: allemand1 on May 04, 2009, 03:06:17 PM
Thanks.. i will try it...
I known that mod.... but i need to put the banners in especific places...
SimplePortal 2.3.8 © 2008-2024, SimplePortal