Discussion corner for Developers of Serendipity.
Stefano
Post
by Stefano » Sun Dec 18, 2005 6:15 pm
I need insert php code for include adsense banner in home page
{if not $is_single_entry }
i want only view banner in 2 post (i use 4 display article for page)
i have try this solution :
Code: Select all
<? $pippo_baudo = $this->_tpl_vars['entry']['id']/2;
if(is_float($pippo_baudo) && ! $this->_tpl_vars['is_single_entry']){echo $this->_tpl_vars['entry']['id'];} ?>
But i need help for write with smarty
judebert
Regular
Posts: 2478 Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:
Post
by judebert » Sun Dec 18, 2005 8:16 pm
Sorry, I'm not really certain what you want.
Are you trying to achieve:
(On frontpage only)
Article
Article
Adsense Banner
Article
Article
Adsense Banner
If so, you could use the Static Blocks plugin. Define a static block with the Adsense Banner URL, and define it to repeat every 2 articles.
If you want something else, describe it and I'll try again.
garvinhicking
Core Developer
Posts: 30022 Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:
Post
by garvinhicking » Mon Dec 19, 2005 10:13 am
You shouldn't ever modify the .tpl.php files. Always only edit the .tpl files in the templates directory (NOT templates_c).
Inside the entries.tpl you can do your Smarty checking code like
Code: Select all
{if not $is_single_entry and $entry.id == 4711}
ADCODE
{/if}
HTH,
Garvin