solved ads in timeline feed

alt=
MONEE
@monee
4 months ago
65 posts
I want to inject ads into the timeline feed. Say an ad every x amount to action feeds. Is this possible?
updated by @monee: 11/18/24 04:58:09AM
douglas
@douglas
4 months ago
2,793 posts
I believe this would require a custom module or modifications to the timeline module.

Sorry, it's not possible at this time.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
michael
@michael
4 months ago
7,740 posts
Its possible. You can do it in the foreach loop that outputs your timeline. Figure out which template that is and it will be something like:
{foreach $_item as $_i}
.... .stuff
{/foreach}
Then just put your add in there every X number of times like this
{foreach $_item as $_i}
                        {if $_i@iteration % 2 == 0}
                            PUT YOUR ADVERT IN HERE
                        {/if}
.... .stuff
{/foreach}


That will put an add every 2 posts. change the % 2 to % 6 to do it every six times.
alt=
MONEE
@monee
4 months ago
65 posts
Thanks. I will try this
boplive
@boplive
one month ago
345 posts
Did anyone ever got this to work..what template did you end up using..didn't know what to touch in the timeline module
alt=
MONEE
@monee
one month ago
65 posts
you add it to the jrAction_item_list.tpl under the foreach
boplive
@boplive
one month ago
345 posts
So in the jrAction_item_list.tpl

" the foreach" is listed as
{foreach from=$_items item="item"}
..so I did not touh anything on the foreach
(I left it alone as is)

I try the following [3] format with both
iteration % 2 and iteration % 6 under the foreach as per below
-- Only format 2 & 3 display something on every 1 post..
So the problem is..its displaying before every post ..if there's 10 post there 10 advertising right before..
not in every 2 or 6 or what ever number I change it to

Format 1
{if $_i@iteration % 2 == 0}
PUT YOUR ADVERT IN HERE
{/if}

Format2
{if $_items@iteration % 2 == 0}
PUT YOUR ADVERT IN HERE
{/if}

Format3
{if $_item@iteration % 2 == 0}
PUT YOUR ADVERT IN HERE
{/if}
updated by @boplive: 11/17/24 12:21:14PM
alt=
MONEE
@monee
one month ago
65 posts
{if $item@iteration %5 == 0}
PUT YOUR ADVERT IN HERE
{/if}

try this. This the code I use and It works
boplive
@boplive
one month ago
345 posts
I gave that a shot and it worked.
..thank you