2010-09-08, 13:52

Aug 30, 2010 — glossaryFilter has been updated — now it has new forceUTF8 parameter. (...) »

2009-11-03, 08:40

On November 1, 2009, I bought and configured an additional domain for all web services (...) »

2009-10-14, 07:19

The site Litaratura.org is devoted to Belarusian literary works and translations. (...) »

2009-01-12, 20:46

Late November 2008 marked the 20th anniversary of the official founding of the Belarusian (...) »

Registered User Area Log into This Site
Show Credits... Credits
Show Donation/ Payment Page... Donate/ Pay
Worthwhile Software
Refresh My Local Time (GMT+1)... 2010-09-08, 13:52
  • Russian Federation (1)
    United States (5)
  • Today (134)
  • Yesterday (209)
~ / Public Domain Software / Extensions to Ditto / MostCommented Snippet $_
MostCommented Snippet
Click To View A Full Size Image...
2010-01-10, 15:09

Some people ask how to call Ditto and sort its results by the number of comments attached. The simpliest answer is that it cannot be done within the means given by Ditto itself. Ditto „realizes” neither Jot’s existence nor the way it handles comments.

This is a task for a new snippet that would correlate Ditto’s result set with a data stored in Jot-handled tables. Just this is a way that my MostCommented snippet operates: 1) runs Ditto in an invisible mode to retrieve document’s ids from the scope being the topic of interest, 2) explores Jot’s table to look/count how many comments are attached to documents within a retrieved scope; 3) sorts documents descendingly by the calculated numbers.

MostCommented snippet recognizes six parameters — parents, depth, display, filter, tpl, and noResults — that have the same meaning as in Ditto call. If you want to use more Ditto-specific parameters you need to look into the snippet’s code and follow the instructions on how to extend it.

MostCommented snippet has been initially posted to this thread on MODx Forum.

How to use MostCommented

# 1) create new snippet 'MostCommented' and paste into it content of the attached mostcommented.txt file
# 2) call your snippet something as:
[[MostCommented? &parents=`2,46` &depth=`1` &display=`5` &filter=`type,document,1` &tpl=`item-chunk` &noResults=`No comments so far.`]]
# 3) please read more details on parameters in snippet's header

Download This Attachment... MostCommented Snippet — the very latest version
Last modified: 2009-09-29, 10:26 — Size: 3,24 KB — Users: 113 — Downloads: 155
Write a comment
  • Required fields are marked with *.
  • Comments are published after the approval of the site moderator, who is a human rather than a wind-fast computer program so please be patient. Off-topic comments are definitely removed.

* Code:
 
Enter this code into the appropriate field of the form while submitting an e-mail or a comment. If you have trouble with reading it, generate another...