Permalink
Browse files

resolve conflicts

  • Loading branch information...
2 parents f8dccff + aeca29a commit dd1fe2a147f295386fd57e49bc286096c8d11a4f @arthurk arthurk committed Dec 1, 2009
Showing with 57 additions and 3 deletions.
  1. +4 −3 .gitignore
  2. +27 −0 README.markdown
  3. +26 −0 disqus/templatetags/disqus_tags.py
View
@@ -1,9 +1,10 @@
+*.pyc
+*.swp
+.Python
+bin/
build/
dev/
dist/
django_disqus.egg-info/
-.Python
-*.swp
-bin/
include/
lib/
View
@@ -81,6 +81,33 @@ Show recent comments.
* `avatar_size`: Size of the avatars (default: 32)
* `shortname`: Use a different shortname than `settings.DISQUS_WEBSITE_SHORTNAME`
+### disqus\_top\_commenters
+
+Shows top commenters
+
+ {% load disqus_tags %}
+ {% disqus_top_commenters %}
+
+##### Options
+
+* `num_items`: Number of comments to show (default: 3)
+* `avatar_size`: Size of the avatars (default: 32)
+* `shortname`: Use a different shortname than `settings.DISQUS_WEBSITE_SHORTNAME`
+* `hide_mod`: Set to 1 to hide moderators
+* `hide_avatars`: Set to 1 to hide avatars
+
+### disqus\_popular\_threads
+
+Shows most popular threads
+
+ {% load disqus_tags %}
+ {% disqus_popular_threads %}
+
+#### Options
+
+* `num_items`: Number of comments to show (default: 3)
+* `shortname`: Use a different shortname than `settings.DISQUS_WEBSITE_SHORTNAME`
+
## Management Commands
### disqus-export
@@ -81,7 +81,33 @@ def disqus_recent_comments(num_items=3, avatar_size=32, shortname=''):
num_items=num_items,
avatar_size=avatar_size)
+def disqus_top_commenters(num_items=5, hide_mod=0, hide_avatars=0, avatar_size=32, shortname=''):
+ """
+ Returns the HTML/js code necessary to display top commenters
+ """
+ if not shortname:
+ shortname = settings.DISQUS_WEBSITE_SHORTNAME
+ return """
+ <script type="text/javascript" src="http://disqus.com/forums/%(shortname)s/top_commenters_widget.js?num_items=%(num_items)d&hide_mods=%(hide_mod)d&hide_avatars=%(hide_avatars)d&avatar_size=%(avatar_size)d"></script>
+ """ % dict(shortname=shortname,
+ num_items=num_items,
+ hide_mod=hide_mod,
+ hide_avatars=hide_avatars,
+ avatar_size=avatar_size)
+
+def disqus_popular_threads(num_items=5, shortname=''):
+ """
+ Returns the HTML/js code necessary to display top commenters
+ """
+ if not shortname:
+ shortname = settings.DISQUS_WEBSITE_SHORTNAME
+ return """
+ <script type="text/javascript" src="http://disqus.com/forums/%(shortname)s/popular_threads_widget.js?num_items=%(num_items)d"></script>
+ """ % dict(shortname=shortname,
+ num_items=num_items)
+
register.simple_tag(disqus_dev)
register.simple_tag(disqus_num_replies)
register.simple_tag(disqus_show_comments)
register.simple_tag(disqus_recent_comments)
+register.simple_tag(disqus_top_commenters)

0 comments on commit dd1fe2a

Please sign in to comment.