1
acegamer
Banner afther post 3
  • 2009/4/25 10:51

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Hi, i'm wondering if it is possible to place a banner afther 3 content post (news module 1.44) (i use this version because i run 3 of them in clones... the later versions i can't get cloned :( )

I have an screen made of an example... what i mean.

Resized Image

I hope someone can help me out :o

Kind Regards,

Kevin

2
acegamer
Re: Banner afther post 3
  • 2009/4/28 16:39

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Anyone?

3
ghia
Re: Banner afther post 3
  • 2009/4/28 23:17

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


You can enter an if statement in the loop of the template where the posts are listed as in this example where the header is repeated every five rows:
<table>
{foreach 
from=$items key=myId item=i name=foo}
  {if 
$smarty.foreach.foo.index == 0}
     <
tr><th>Title</th></tr>
  {/if}
  <
tr><td>{$i.label}</td></tr>
{/foreach}
</
table>

4
acegamer
Re: Banner afther post 3
  • 2009/4/29 10:35

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


@ ghia
First of all, thx for your response and help i realy appriciated that.
i will try it ;)

kind regards,

kevin

5
acegamer
Re: Banner afther post 3
  • 2009/4/30 7:14

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


@ ghia

Hey, i tried and tried but i can't get it work. It shows up on the wrong places.

I have made a screen of it. It shows up at the end of alle post (end of the page) our if i put your code somewhere else it shows at the top of the first post.

<center>Resized Image</center>

hope you can help me? :o

6
acegamer
Re: Banner afther post 3
  • 2009/5/3 9:59

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


You sure thats the right code ? I still don't get it fixed :(

7
acegamer
Re: Banner afther post 3
  • 2009/5/12 9:27

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


*bump*

8
jlm69
Re: Banner afther post 3
  • 2009/5/16 12:53

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


I have been working on something like this for my modules, the one thing I see wrong with ghia's code is that it is just smarty code and not XOOPS smarty code.

What does that mean? Well smarty uses this:

{/foreach}

but XOOPS does it this way:

<{/foreach}>


the code to do it in the jobs module would be something like this:

in the template file you would add this:

<{foreach from=$items item=item name=items}>
<{if $smarty.foreach.items.iteration eq 3}>
<table><tr><td align="center"><{$banner}></td></tr></table>
<{/if}>

then in the php file you would add this:

$banner = xoops_getbanner();
$xoopsTpl->assign('banner', $banner);

That should give you something to work with.
Hope it helps,


John


9
acegamer
Re: Banner afther post 3
  • 2011/3/3 19:12

  • acegamer

  • Not too shy to talk

  • Posts: 162

  • Since: 2005/7/11


Hi,

Here i'm again. It's been a while.. i tried and tried. But i don't get it work :s

Now a days i wanna give it back a try. It can't be that hard i think :o

So if anyone know a good working sollution?

I think if have to change something in templates (news_index.html) to get it worked.

<{if $topic_rssfeed_link != ""}>
<div align='right'><{$topic_rssfeed_link}></div>
<{/if}>

<{if $displaynav == true}>
<div style="text-align: center;">
<form name="form1" action="<{$xoops_url}>/modules/news/index.php" method="get">
<{$topic_select}> <select name="storynum"><{$storynum_options}></select> <input type="submit" value="<{$lang_go}>" class="formButton" /></form>
<hr />
</div>
<{/if}>

<{if $topic_description != ''}>
<div style="text-align: center;"><{$topic_description}></div>
<{/if}>

<div style="margin: 10px;"><{$pagenav}></div>
<table width='100%' border='0'>
<tr>
<{section name=i loop=$columns}>
<td width="<{$columnwidth}>%"><{foreach item=story from=$columns[i]}><{include file="db:news_item.html" story=$story}><{/foreach}></td>
<{/section}>
</tr>
</table>

<div style="text-align: right; margin: 10px;"><{$pagenav}></div>
<{include file='db:system_notification_select.html'}>

Hope you guys can help me out

10
kerkyra
Re: Banner afther post 3
  • 2011/3/4 11:47

  • kerkyra

  • Just can't stay away

  • Posts: 553

  • Since: 2005/2/14


hi mate i think you will have to alter the system_comments template instead of news_index.html using the <{}> smarty tags instead of {} as jlm69 pointed out.

have in mind that this will change the way comments are displayed EVERYWHERE in your site though.

if you dont mind that give it a go otherwise,

if you want this to happen ONLY in news section

you will have to replicate the comments html template.
Copy that in your news/templates folder perhaps?
and THEN include that file in your news_index.html file instead of the original system comments file.

[b]Notice that if you include it from the db like that
Quote:
<{include file='db:news_comments.html'}>

you will also have to alter modinfo.php file of news module and add the template you just created[b] - then update the module to add the new template in the db.

hope it helps
www.guidemap.gr - Beta is out...

Login

Who's Online

177 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 177


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits