Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Latest threads - how to get them?

Hi!

I'm looking for a best way to build latest threads widget/portlet. There is "latest" page in Sphene's board but it's code is based on "the oldest and ugliest (function) in the whole SCT source" so it is a bit complicated. There is also "sphboard_latest_threads" tag but it is probably unused and it is undocumented. Another solution is to write my own tag and just retrive threads from db. What do you recommend?
hi,
i would go with the template tag if this is all you need. i am using it myself on two websites:

            {% sphboard_latest_threads sph_settings.groups_sphene_news_category_id %}
              {% for post in threads %}
                <h2>{{ post.postdate|sph_date:"ONLY_DATE" }}</h2>
                <p><a href="{{ post.get_absolute_url }}">{{ post.subject }}</a></p>
                <p>{{ post.body_escaped }}</p>
              {% endfor %}
            {% endsphboard_latest_threads %}


but you are right, i should write documentation for it .. grml
Hey, we have Signatures !!! Great, isn't it ? ;)
i have now extended the documentation: Board/TemplateTags

--- Last Edited by Herbert Poul at 2009-08-13 23:02:19 ---
Hey, we have Signatures !!! Great, isn't it ? ;)
Cool. Thanks a lot!
Hi,

how can i get the latest threads of all categories in my forum?

greets moses
currently .. you can't .. feel free to look into sphboard/templatetags/sphboard_extras.py and to add that feature to sphboard_latest_threads .. shouldn't be too hard. if you can send a patch i'll commit it to the trunk.
thanks
Hey, we have Signatures !!! Great, isn't it ? ;)

Please login to post a reply.



Powered by Sphene Community Tools