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.

Chronological

Chronological
«1

Comments

  • Why didn't u just Sink all discussions by default?
  • This is great but I really need to be able to switch between this mode and normal mode.

    Can this be turned into a side bar filter or perhaps even something that users can decide upon in their own forum preferences

    thanks in advance
  • That just happens to be why I didn't sink all new posts by default--so that it can be a preference.

    Maybe I've already done that in a development version... ::goes looking through old fles::...
  • Give this a shot--Its been months since I last tested it so I don't know if it will work, this should replace everything in the existing file including the if line down:$Context->SetDefinition('DisplayInChronological', 'Display discussions in chronological order'); // Change to '0' to require users to set a preference before making everything chronological: $Configuration['PREFERENCE_ShowChronological'] = '1'; // Add the preference switch to the account functionality form if ('account.php' == $Context->SelfUrl && ForceIncomingString('PostBackAction', '') == 'Functionality') { function PreferencesForm_AddChronologicalSwitch(&$PreferencesForm) { $PreferencesForm->AddPreference('ControlPanel', 'DisplayInChronological', 'ShowChronological'); } $Context->AddToDelegate('PreferencesForm', 'Constructor', 'PreferencesForm_AddChronologicalSwitch'); } if ( ('index.php' == $Context->SelfUrl) ) { if ((0 < $Context->Session->UserID) && ($Context->Session->User->Preference('ShowChronological')) || ($Context->Configuration['PREFERENCE_ShowChronological'] = '1') ) { // Order by date created instead of last active: $DatabaseColumns['Discussion']['DateLastActive'] = 'DateCreated'; // Make the dictionary match the above change $Context->Dictionary['LastActive'] = 'Posted'; } }
  • Would there be by chance a way to select categories where discussions are displayed chronologically? I'm currently working on a project using Jazzman's Discussion Overview, and I'd love to be able to use this addon only in specific categories (basically, there will be categories for discussions and categories for information only).

    Could someone suggest a hack to do this? That would be veeeery nice :)
  • Could do that pretty easily considering if you are viewing the category directly, but if you want to view the chronological posts mixed with standard posts on the main discussions page, that could be a bit more involved.
  • i think what he wants to do is use certain sections for things like documentation. in that case, those categories could be omitted on the main discussion page.
  • I'm currently working on a netlabel website: chronological discussions would be used for official news and album releases in specific categories - this way people could comment but these discussions would stay in place if they do. And another category would be dedicated to "normal" discussions.

    Discussion Overview seemed pretty cool for this, because it displays discussions ordered per categories. It would be quite weird to mix chronological and normal discussions on the standard discussion page. Ideally I wouldn't mind two separated tabs, one for announcements and one for discussions.
  • For that may want to try MySchitzoBuddy's blog extension--it will give a category chronological ordering, turn it into a separate tab for your news, and (I think optionally) take news posts out of the regular lineup.

    If you would rather view the posts forum-style, I wrote a category hider that can remove the news category from the main list, and you would just need to paste a couple lines from chronological inside that to turn that category only into chronological listing.
  • Thanks, these ideas sound cool! So I would use Page Manager to create a tab pointing to the chronological category hidden from the main discussion list, am I right? I guess it would be perfect for a catalogue category.

    I think I'll use both solutions : blog for the news and hidden chronological category for the releases - but probably Spode's BlogThis instead of MySchizoBuddy's Blog. This way I'll be able to blog new stuff from the catalogue while keeping a clean catalogue on the dedicated tab.

    What should I add o the category hider to make it chronological?
  • Wow... I never looked at BlogThis until you mentioned it... very cool.

    There is only one or two lines of code in chronological, it just basically tricks Vanilla into reading the wrong database column for sorting discussions, so you could just paste that into the IF statement inside category hider, set your category IDs and be done.
  • I've tried this, but while the category is hidden, its posts aren't displayed chronologicaly:
    if ( ('index.php' == $Context->SelfUrl) && !in_array(ForceIncomingString('CategoryID', ''), array('3')) ) { $DatabaseColumns['Discussion']['DateLastActive'] = 'DateCreated'; // Make the dictionary match the above change $Context->Dictionary['LastActive'] = 'Posted'; function Category_HideFromDiscussions(&$DiscussionManager) { $SB = &$DiscussionManager->DelegateParameters['SqlBuilder']; foreach ( array('3') as $CurrentBlock ) { $SB->AddWhere('t', 'CategoryID', '', $CurrentBlock, '<>', 'and', '', 0, 0); } } $Context->AddToDelegate('DiscussionManager', 'PostGetDiscussionBuilder', 'Category_HideFromDiscussions'); $Context->AddToDelegate('DiscussionManager', 'PreGetDiscussionCount', 'Category_HideFromDiscussions'); }

    However, the discussions list is chronological. I guess I'm missing something pretty simple but I don't know what.
  • Whoops... I guess I was wrong with how I pictured it working.

    We're going to have to add a whole new IF in there based on part of the existing one:if ('index.php' == $Context->SelfUrl) { if (in_array(ForceIncomingString('CategoryID', ''), array('3')) ) { $DatabaseColumns['Discussion']['DateLastActive'] = 'DateCreated'; // Make the dictionary match the above change $Context->Dictionary['LastActive'] = 'Posted'; } else { function Category_HideFromDiscussions(&$DiscussionManager) { $SB = &$DiscussionManager->DelegateParameters['SqlBuilder']; foreach ( array('3') as $CurrentBlock ) { $SB->AddWhere('t', 'CategoryID', '', $CurrentBlock, '<>', 'and', '', 0, 0); } } $Context->AddToDelegate('DiscussionManager', 'PostGetDiscussionBuilder', 'Category_HideFromDiscussions'); $Context->AddToDelegate('DiscussionManager', 'PreGetDiscussionCount', 'Category_HideFromDiscussions');
  • Yay, it works! Thanks a lot!
  • This is a great add-on, can it be made to work on only one category and leave the rest as normal?
  • How differently do you need it done than was discussed in the nine posts prior to yours? (LOL)
  • Parse error: syntax error, unexpected $end in /path.to/forum/extensions/Chronological/default.php on line 31

    I guess I was hoping the extension would be updated so I didn't have to hack it?
  • IIRC, that error means something about braces or somesuch. Three day weekend here in the states, maybe I'll get around to it.
  • Hi, when I see this add-on, i thought it would be really suitable for me.
    however, it didn't work on my vanilla 1.1.4, when I installed.

    I checked box for activation from Extensions menu. then nothing happened.

    Is there any I shoud set up more? or is it version error? or I missed something else?

    would you tell me what is the problem between Chronological 1.0 and Vanilla 1.1.4
    I use theme "YHBeta!"

    thank you for your helping. :)
  • I've got a new version that you can try out, and it does require some new delegates in 1.1.3 and 1.1.4. It'll work fine with YHBeta.
Sign In or Register to comment.