insert pre-defined row after every x message on listing page
Posted by Mark Fresh
insert pre-defined row after every x message on listing page January 18, 2007 06:48AM |
Registered: 18 years ago Posts: 85 |
Similar to this post I would like to make every x row on the messages list page contain some predefined text. e.g. after ever 10 messgaes i could show a row that says "register and receive benefits..." or I could place in some some PHPadsnew code.
Please could someone tell me how to do this if possible?
thanks
Mark
Please could someone tell me how to do this if possible?
thanks
Mark
January 19, 2007 06:19AM |
Admin Registered: 20 years ago Posts: 8,532 |
You'll have to add some logic to the list template. You can add some pure PHP code to do this. I won't do the full template change for you, but here's some hints.
Before {LOOP MESSAGES}, you'll have to initialize a counter. Right after it, you can increment that counter and act on it. Look at the green code in the example below:
Untested code, but I think this should get you going.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
Before {LOOP MESSAGES}, you'll have to initialize a counter. Right after it, you can increment that counter and act on it. Look at the green code in the example below:
............................ .. original template code .. ............................ <?php $rowcount = 0; ?> {LOOP MESSAGES} <?php $rowcount ++; if ($rowcount % 10 == 0) { ?> <tr> <td class="PhorumTableRow"> Your template code for adding advertisements or whatever can go in this spot. </td> </tr> <?php } ?> ............................ .. original template code .. ............................
Untested code, but I think this should get you going.
Maurice Makaay
Phorum Development Team



Re: insert pre-defined row after every x message on listing page February 26, 2007 04:10PM |
Registered: 18 years ago Posts: 85 |
Sorry, only registered users may post in this forum.