Top Comments
The Top Comments snippet returns a list of entries, which have been most commented on. The number of entries returned can ofcourse be altered. The output of the snippet is fully customizable using specific %tags%.
Download the ZIP file, unpack it to your extensions/snippets/ folder, put the topcomments-tag somewhere in your template file and you'll be up and running. Read the included readme file or down here on info howto adjust the output of the tag.
Snippet-title: Top Commented-on Entries
Content of zipped file:
Creator: Bram "Tenshi" Nijmeijer
E-mail: bram@nijmeijer.org
Website: http://bram.nijmeijer.org
Creation date: 16 January 2005
Usage:
- snippet_topcomments.php
- readme_topcomments.txt (this file)
Description:
- unpack this package in your extensions/snippets/ folder
- place a Mar 3, 2007 at 15:46">Virb Invites: 8 comments
May 1, 2006 at 18:29">Version 3 Roadsho…: 7 comments
tag in any of your template files.
This tag will show a 'Top X' of most commented-on entries, where X has a default value of 3.
The tag has two parameters which one can set to change the appearance of the output.
Parameters:
- Parameter 1 - Changing the number of entries:
The number of entries being shown can be changed by setting the first parameter like this: where Y is the number of entries being shown. E.g. Mar 3, 2007 at 15:46">Virb Invites: 8 comments
May 1, 2006 at 18:29">Version 3 Roadsho…: 7 comments
Aug 28, 2005 at 23:38">... years!: 6 comments
Jul 10, 2006 at 19:29">Vacation: 5 comments
Feb 6, 2007 at 13:59">bramn v3.5: 5 comments
Jan 24, 2005 at 16:40">Ich bin Schnappie…: 5 comments
Dec 3, 2004 at 16:29">Rije' rije' rije'…: 5 comments
Jun 17, 2005 at 23:45">This is it!: 5 comments
Jul 13, 2005 at 19:36">Walibi World (2): 5 comments
to show a Top 10.- Parameter 2 - Changing the format of shown entries:
To change the format of the output, one can set the second parameter like f.i. as follows:
The default output format for Mar 3, 2007 at 15:46">Virb Invites: 8 comments
May 1, 2006 at 18:29">Version 3 Roadsho…: 7 comments
is: '<a xhref="%url%" mce_href="%url%" title="%date%"%popup%>%safetitle%</a>: %commentlink%<br />'.
The date of an entry will be formatted according to the format set for Jan 17, 2005 at 16:02 in your weblog configuration.
One can use the following variables to change the output format:
One can also use the extra date formatting tags, replacing %date%, like shown on http://www.pivotlog.net/help/help_date_formatting.php
- %commentlink% - Shows the same comment line as in your entries in the current weblog. E.g. '3 comments, already'
- %url% - The URL to the entry
- %popup% - If used and if comment popups are enabled in your weblog configuration the above link will become a popup
- %date% - The date of the entry formatted the same as your Jan 17, 2005 at 16:02
- %title% - Entry title
- %safetitle% - Truncated version of entry title
- %n% - Amount of comments in numbers
- %num% - Amount of comments in words
