Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
how to sort desc the comments numbers
Hi, I want to sort="posted desc"
my comments’ numbers, I’m using ajw_comment_num
plugin
Is there a way to do that please?
I don’t find any attributes to the plugin tag.
Thanks :)
Offline
Re: how to sort desc the comments numbers
sort="discussid desc"
or sort="posted desc"
should both work as attributes for the <txp:comments />
tag.
Offline
Re: how to sort desc the comments numbers
ruud wrote:
sort="discussid desc"
orsort="posted desc"
should both work as attributes for the<txp:comments />
tag.
yea sort="posted desc"
works great!
but that wasn’t my question lol ;)
I want that the comments’ numbers
will be sort="posted desc"
too.
so I will get something like this:
#3
- name
- 26.04.08
- message
#2
- name
- 25.04.08
- message
#1
- name
- 24.04.08
- message
what I get now is:
#1
- name
- 26.04.08
- message
#2
- name
- 25.04.08
- message
#3
- name
- 24.04.08
- message
thanks :)
Last edited by THE BLUE DRAGON (2008-04-26 12:44:22)
Offline
Re: how to sort desc the comments numbers
You can use this instead of that comment number plugin:
<txp:php>
global $thisarticle, $my_comment_count;
$limit = 0; # this is a configurable setting, change it to be equal to the limit attribute in <txp:comments /> (default: no limit = 0)
if (!isset($my_comment_count)) $my_comment_count = 0;
echo (min($limit, $thisarticle['comments_count'])) - $my_comment_count++;
</txp:php>
Last edited by ruud (2008-04-26 14:32:09)
Offline
Re: how to sort desc the comments numbers
ruud wrote:
bc. <txp:php> global $thisarticle, $my_comment_count; $limit = 0; # this is a configurable setting, change it to be equal to the limit attribute in <txp:comments /> (default: no limit = 0) if (!isset($my_comment_count)) $my_comment_count = 0; echo (min($limit, $thisarticle[‘comments_count’]) – $my_comment_count++;
</txp:php>
thanks but where do I put this code please?
I tried to put in the my comments form and got the next error:
Parse error: parse error, unexpected ';' in /textpattern/publish/taghandlers.php(2804) : eval()'d code on line 5
I dont know php :/
Last edited by THE BLUE DRAGON (2008-04-26 13:35:03)
Offline
Re: how to sort desc the comments numbers
See previous post for explanation and fixed code. Simply place it where you want the comment number to show up.
Offline
Re: how to sort desc the comments numbers
thank you works great! :)
I had just need to change: $limit = 0;
to $limit = 9999;
Offline
Pages: 1