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

Why are my topics listed backwards? (oldest to newest?)

my topics are all showing up backwards... the newest reply is always at the bottom of the page instead of the top, and i don't see an option to switch it. how can i change it?
«1

Comments

  • Options
    in fact, i just looked and it's doing very odd things with the sorting... i have topics that look like this now: topic 1: 7 days ago topic 2: 4 days ago topic 3-6: 6 days ago topic 7: 1 minute ago topic 8: 6 days ago topic 9: 6 seconds ago what's the deal? why are they not sorted by last reply time by default?
  • Options
    Isn't that the way all boards work?! O_O
  • Options
    no! normally all message boards will sort the topics by the last post. so when someone replies to a post it moves it to the top of the page. on my install, it doesn't move the post to the top of the page, it just leaves it wherever it wants.
  • Options
    (this board works like that, but i have no idea why my install is not working how it should...)
  • Options
    NickENickE New
    edited February 2006
    I believe it had something to do with the whispers extension, although I'm not 100% sure so you'll have to wait for mark to reply for a more helpful/definitive answer.
  • Options
    MarkMark Vanilla Staff
    edited February 2006
    Are you talking about topics, or comments? The topics *should* show up as the most recently active first, while the comments should show up as most recently added last. Are you using version 0.9.2.6? What version of PHP do you have? What versoin of MySQL do you have?
  • Options
    Oooh I see! Sorry, I thought you meant comments :(
  • Options
    yes i'm talking about the 'discussions' page - the post page sorts fine adding the latest comment to the bottom. it seems like it's just not sorting by the last active date. it's a fresh install of 9.2.6 PHP Version 4.4.2 MySQL Version 5.0.16 http://forum.coopernerds.com/phpinfo.php http://forum.coopernerds.com/ here's the forum if you want to see the weird sorting yourself.
  • Options
    also i looked in the database and the DateLastActive column is being updated correctly and i can sort the column in phpMyAdmin just fine... it just isn't sorting it for some reason on the discussions page.
  • Options
    I just added a whisper to myself in a thread, and it *almost* fixed it... but there is still one thread out of order, which makes me think it's still all broken.
  • Options
    and when i just added a new topic, it added it in the middle of the page. wtf is that about.
  • Options
    anyone?
  • Options
    I'd stab a guess it's due to mysql5 but i'm not certain and i cant tell you how to fix it. With any luck that might jog someones memory who can help you out?
  • Options
    MarkMark Vanilla Staff
    You're going to need to enable public browsing so we can actually see it happening. Once you do that, there is debugging built into Vanilla that will allow you to see what queries are run on the page. That way you can see exactly what is being queried to mysql and maybe figure out what the problem is.
  • Options
    whoop, i thought public browsing was on. it's on now, have a look. is the debugger thing an extension? where do i get it?
  • Options
    MarkMark Vanilla Staff
    Go here: http://forum.coopernerds.com/debug.php And switch it to Debug mode. Then go back to the discussions and all of the queries will be at the bottom of the screen.
  • Options
    MarkMark Vanilla Staff
    Looking at that query, my guess is that mysql is having a problem with:

    greatest(tuwf.DateLastActive, t.DateLastActive)

    The simple solution is to remove the tuwf.DateLastActive sort, but that will make whispers *not* raise a discussion to the top of the list.
  • Options
    all set
  • Options
    so is it just not compatible with mysql 5?
  • Options
    MarkMark Vanilla Staff
    Try this:

    Open up extensions/Whispers.php. Change lines 429-433 from this:

    if ($this->Context->Session->User->ShowAllWhispers) { $s->AddOrderBy("greatest(t.DateLastWhisper, t.DateLastActive)", "", "desc"); } else { $s->AddOrderBy("greatest(tuwf.DateLastActive, t.DateLastActive)", "", "desc"); }

    to this

    $s->AddOrderBy('t.DateLastActive', '', 'desc');

    Let's just see if that does the trick.
This discussion has been closed.