Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.
Help keep Vanilla free:$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';
}
}
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');
}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 //CategoryRole end
$this->CallDelegate('PostRolesRender');
1 to 35 of 35