Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Latest topics

TwainTwain New
edited July 2006 in Vanilla 1.0 Help
Hello everyone,

Firstly let me say that vanilla is just the best forum out there and I am happy that I have it installed!

I moved my forum from phpBB to vanilla sometime ago and I was wondering if there is a plug in or extension that allows me to show the 10 latest topics posted in my forum. I would like to display the latest topics on my frontpage of my site.

Does anyone have such a plug in??? phpBB have it and I think its a nice little plug in to have.

Thanks people.

Comments

  • Options
    MarkMark Vanilla Staff
    Well, I know that this is a common request and that people have found various different ways to make it happen. The most obvious answer to me would be to query the database for those records. It's a pretty simple thing to do. Do you have any programming experience at all?

    Does anyone else have any easier suggestions?
  • Options
    Thanks for the quick reply Mark!

    Unfortunately I have NO programming experience :(

    All I want to show is the date and then say 20 words from the topic and then maybe the name of the person who posted the topic...

    I hope this is not too much of a pain.

    Thanks again
  • Options
    NickENickE New
    edited January 2006
    Here's an implementation of what you're talking about, albeit it not quite as user-friendly as it could be: http://nick_e.cjb.cc/misc/DiscussionPreview.php.txt Set the $VanillaDir variable to whereever the root folder of your Vanilla install is (relative to the script calling this), then you can include it and call GetDiscussionPreview([max discussion num, [comment preview character len]]) to display the list where you want (sidebar, footer, etc.). It dosn't parse any formatting options the comments may have, and you may want to change the ordering field from DateCreated to DateLastActive (adding in a 'distinct' directive so you won't get multiples of the same topic), but other than that it should work as planned.
  • Options
    can it not be done via rss? i wouldn't know how to implement it, but it's an idea.
  • Options
    Yeah, depending on what your front page is built on, there may be some really nice RSS plugins that will handle this stuff
  • Options
    http://www.rss2html.com/ or http://www.feedforall.com/free-php-script.htm might help
  • Options
    Using your own rss feed'd be terribly inefficient, though.
  • Options
    Why?
  • Options
    Because you'd be basically running two different scripts to achieve what one, smaller, one could do much more efficiently and quickly. You're calling something to translate data into a different data format, only to have to decode it again yourself (into essentially the same thing as the first script had it as originally). It'd safe a heck of a lot of time and resources to lose that extra redundant step by simply obtaining the data directly from the db yourself, and displaying how you need to from there.
  • Options
    I added a preview to my homepage using the following method. I'm sure there are better ways, but works for me.

    ../feed_preview.html
  • Options
    wow thanks people for all your help! I will digitad's idea....

    Thanks again!
  • Options
    hm...i think the script from http://dev.digifad.com/vanilla/feed_preview.html displays more than 10 latest posts. anyone here knows how to make it displays only 10posts? i tried: for(var i=1; i<_item.length+1; i++) and changed it to [i] for(var i=1; i<10; i++) [/i] but it doesn't help :(
  • Options
    edited July 2006
    'would be great if there is a sweet way to have this function (5/10/all latest topics) in vanilla v1 - maybe as an extension.
This discussion has been closed.