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.

Discussions in Progress

dfareeddfareed New
edited November 2006 in Vanilla 1.0 Help
Now for sure this wouldn't be standard, but I am integrating vanilla into a magazine's website and would like to have an include for the front page or iframe with a brief list of ongoing/most recent threads.

ala (upper right hand corner).

Would this be hard to do?

Any tips before i start digging through the code would be freaking awesome.


  • Options
    MarkMark Vanilla Staff

    You don't really need to dig through the code.

    I use a fairly complex set of objects to build the pages, and any system you're integrating with wouldn't have access to those objects. So, you'd either need to:

    1. hack your way into my discussion manager and access a method to retrieve discussions, or
    2. just write your own query on the discussions index to pull the most recently active discussions.

    I would highly recomment the latter, since the former could probably only be pulled off by me (at this point). I can give you a sample query if you want, then all you'd need to do is make a php file that pulls and displays that data and include it in your page wherever you want.

  • Options
    MarkMark Vanilla Staff
    Here's a query to return the last 10 active discussions:

    select d.DiscussionID, d.AuthUserID, d.Name, d.DateCreated, d.LastUserID, d.DateLastActive, d.CountComments, d.CategoryID, u.Name as AuthUsername, lu.Name as LastUsername, c.Name as Category

    from LUM_Discussion d
    left join LUM_User u on d.AuthUserID = u.UserID
    left join LUM_User lu on d.LastUserID = lu.UserID
    left join LUM_Category c on d.CategoryID = c.CategoryID

    where d.Active = '1'
    and d.Closed = '0'
    and (d.WhisperUserID = '0' or d.WhisperUserID = 0 or d.WhisperUserID is null )

    group by d.DiscussionID

    order by d.DateLastActive

    desc limit 0, 10
  • Options
    thanks, mark, I will give it a shot.
  • Options
    dfareed, can you keep us posted on your progress with this?
  • Options
    So I used Mark's feed script to get this working:

    Download File (zip with one file)

    Functionally it's nearly identical to the feed script. You no longer need to select which type of feed you are looking for. To view the file in your installation you must be either logged in or have an open installation (makes sense - you don't want to display the contents of a private vanilla). Whispers are also kept clear of this.

    To modify the way this displays:
    -line 185 limits the number of entries displayed. This is the same as the number of entries displayed in the RSS, so if you want to keep the RSS unchanged, just change "agDISCUSSIONS_PER_FEED" to some number (10? 4? whatever, but leave the rest of the line as is).

    -line 198 displays text for when no messages have yet been posted to vanilla.

    -line 202 is a header (can be deleted)

    -lines 207-219 format the display of information related to each thread [title, link, authorname, authorurl, publish date, updated/last comment date, summary(body with no formatting), category, categorylink, and content (body w/ formatting)]

    I have only tested this with vanilla .9.2 (version w/feeds) but am pretty sure it won't work with previous versions.
  • Options
    obviously the presentation (html) can be totally changed totally between lines 207-219. Any of the elements in the list can be taken out as needed, just figured I should put them all in there for you all.
  • Options
    awesome... so is this meant to replace feeds/index.php or go in extensions, or what?
  • Options
    do we just run an include to this file and it outputs the list of recent discussions?
  • Options
    edited July 2005
    here's another idea, how about adding an extra highlight to discussions on the front page that have been updated in the last few minutes? say making them red on the front page.
  • Options
    that's an idea.

    this isn't a replacement for the feeds. it's sort of a hack for the purpose of including recent discussions elsewhere on a site (not managed by Vanilla).
  • Options
    This is exactly what I'm looking for. I'm trying to build a new index page for my site where Vanilla is installed in www/sub-folder and on this page, I'm trying to show the some of the latest discussions as well as some other stuff from vanilla, but have been running into problems trying to use the built in functions due to their complexity.
This discussion has been closed.