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

Mark all topics read

edited May 2006 in Vanilla 1.0 Help
Hi, I am wondering if there is a way to include a button (perhaps in the Account page) that allows members to mark all topics as read? This is because after I ported a phpBB install to Vanilla all of the old topics appear as being new.

Comments

  • Options
    afraid not.

    the relevant search
  • Options
    Hold that thought... I think I may be able to apply some SQL I developed at work months ago that may be able to do this very thing.

    I am just not familiar with the table structure at this point to know if it can (efficiently) be done.
  • Options
    it can't be done efficently. the sql is easy, but due to the way the database is structured, you'd have to add one row for every user * every thread.
  • Options
    Thats what I think I can get around... by adding a column in the users table storing a time stamp before which all threads show as read.

    I poked a bit through the table structure, but now I need to dig a bit more through the code to see if what I am thinking of would work in the query.
  • Options
    That's brilliant!
  • Options
    that's not a bad idea.
  • Options
    Was this ever achieved?
  • Options
    lechlech Chicagoland
    edited May 2006
    It's been requested before (at least once) but never for whatever reason thought of as important. It would be a nice feature or extension for those extremely busy forums that spawn a ton of random threads about nothing. Perhaps a personal "sink it" option could be done to never have to revisit a thread if you mark it as such.
  • Options
    Personal Sink It...oh my.
  • Options
    I am still working on my style for Vanilla, but will take a crack at it after that is done. I think a personal sink would work better...
  • Options
    Along the same notes--which files are used to build the discussion grid? Poking around in the code and am having some trouble locating where that SQL is generated. My idea involves altering the SQL that queries the discussion grid to set the unread/read flag depending on how the date compares with the last set time.
  • Options
    This is a pure guess since i dont have the code to hand, but the words DiscussionGridRender or DiscussionGridBuilder come to mind. Dont hold me to that though. I'm insanely tired.
  • Options
    MarkMark Vanilla Staff
    The queries for discussions come from library/Vanilla/Vanilla.Class.DiscussionManager.php
  • Options
    It looks like this can be accomplished one of two ways:
    1. Superficial mark all read: changes the discussions' status (and thus the >LI< class) for all discussions older than the 'MarkedAllRead' time to read. Still shows accurate number of user's unread posts in the grid
    2. SQL monkeying: Tweak the SQL statement to show zero new posts if there are none new since the 'MarkedAllRead' time, but still jump to the actual first unread message in the thread
    I would prefer the first option, but that would require both changing the discussion's SQL and changing/overloading the way the discussion class' status property is calculated (change to number of posts since date, instead of presence of new posts)

    I think the discussion's SQL can be best changed with the preGetDiscussionsList delegate, but I am not sure how to change the discussion class... I suppose it could be recalculated in the theme file, but that just feels wrong. Is this a place for a delegate?

    Any tips? This would be my first time delving into OO in php, as well as extension writing.
  • Options
    my tip: get some beer :)
This discussion has been closed.