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
0
Comments
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
Maybe I've already done that in a development version... ::goes looking through old fles::...
$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'; } }
Could someone suggest a hack to do this? That would be veeeery nice
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.
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.
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?
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.
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.
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');
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?
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.