Query for latest threads and their URL

edited September 2009 in Vanilla 1.0 Help
Hi,

I would like to make a query for the latest 5 threads for Vanilla.
The threads should be open.
Also, how can I make the friendly URLs for those.
Please help.

Comments

  • You would need to write a plugin to do this I believe. I would consider looking at the "In this discussion" plugin as an example to figure it out.
  • I actually need that code outside of vanilla so I was kind of hoping there was a simple

    Select ..... Limit 5

    Kind of code for it.
    Your thoughts!!!
  • @Mark and @Flam9
    Any ideas about how to do it without going into plugin. Read my comments above.
  • MarkMark Vanilla Staff
    It's been a long time since I did this with Vanilla 1, but there was a debug plugin and/or a core debug setting that spit out all of the queries on a page. If that's all you needed (the SQL), you could definitely use that.
  • [CODE]select DiscussionID, name
    from frm_discussion
    where WhisperUserID = 0
    and Active = '1'
    and Sink = '0'
    ORDER BY DateCreated desc
    LIMIT 5[/CODE]
Sign In or Register to comment.