solved ads in timeline feed

alt=
MONEE
@monee
3 months ago
39 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
3 months ago
2,791 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
3 months ago
7,715 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
3 months ago
39 posts
Thanks. I will try this
boplive
@boplive
one week 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 week ago
39 posts
you add it to the jrAction_item_list.tpl under the foreach
boplive
@boplive
6 days 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
6 days ago
39 posts
{if $item@iteration %5 == 0}
PUT YOUR ADVERT IN HERE
{/if}

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