Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-14 09:43:16

Beto
New Member
Registered: 2009-10-13
Posts: 5
Website

Offset tag in comments

Hi all!
I’m using rvm_counter plugin to display the comment number in the comments list.
The counter needs to be set to 1 in the first comment, so this is how I am doing:

<txp:comments form="first_comment_list" limit="1" sort="posted desc" /> <txp:comments form="comment_list" offset="1" sort="posted desc" />

The difference between the two modules is that in “first_comment_list” the counter is set to 1.
But the offset tag seems to not to do what is meant to do, because in the comments list the first comment appears two times. I tried to change the value to 2 and 3 just for test, and nothing changes.

Where’s my mistake? Thank you!

—Beto.

Last edited by Beto (2009-10-14 09:46:13)

Offline

#2 2009-10-14 11:10:32

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Offset tag in comments

Beto, you don’t need to use two comment forms, that’s harder to maintain.
In order to number the comments you just put a <txp:rvm_counter reset="0" offset="0" /> (hidden via CSS) in your page before your txp:comments tag and another instance of <txp:rvm_counter /> inside your comments form where you want the number displayed.

Last edited by uli (2009-10-14 11:11:46)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2009-10-14 14:03:37

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Offset tag in comments

Also, rvm_counter may not be the tool for the job, as it saves the count on the database, and multiple concurrent hits to your site will mangle the counting…
You may prefer to use adi_calc, or a modified version of rvm_counter (this modified version doesn’t keep count on the database, instead, it generates a new count for each visit).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2009-10-14 14:06:03

Beto
New Member
Registered: 2009-10-13
Posts: 5
Website

Re: Offset tag in comments

Thank you for suggestions! :)

Offline

Board footer

Powered by FluxBB