Many User ask me how to set the sorting from events, here is small tutorial
Modification for 6.1.x.
If you want, that the next events from the future are shown first at home page block, account, profile and events.php
..:: Modification for ALL EVENTS (events.php) ::..
edit the file "inc/classes/BxDolEvents.php"
1. in function PageSDatingShowEvents
find the code (~466 line)
$sOrderBySQL = "ORDER BY `SDatingEvents`.`EventStart` DESC";
and replace it with
$sOrderBySQL = "ORDER BY `SDatingEvents`.`EventStart` ASC";
..:: Modification for EVENT BLOCK at homepage, your account and profile ::..
1. edit the file "inc/classes/BxDolEvents.php" in function GenAnyBlockContent
find the code (~2240 line)
$sOrderS = '';
switch ($sOrder) {
case 'last':
case 'latest':
$sOrderS = "ORDER BY `EventStart` DESC";
break;
case 'rand':
$sOrderS = "ORDER BY RAND()";
break;
case 'first':
$sOrderS = "ORDER BY `EventStart` ASC";
break;
}
and replace with
$sOrderS = '';
switch ($sOrder) {
case 'latest':
$sOrderS = "ORDER BY `EventStart` DESC";
break;
case 'rand':
$sOrderS = "ORDER BY RAND()";
break;
case 'last':
case 'first':
$sOrderS = "ORDER BY `EventStart` ASC";
break;
}
2. edit the file "templates/base/BxBaseIndex.php" in function getBlockCode_Events
find the code (~976 line)
$mode = $_REQUEST['events_mode'];
if( $mode != 'rand' and $mode != 'latest' )
$mode = 'latest';
$aDBTopMenu = array();
foreach( array( 'latest', 'rand' ) as $myMode ) {
switch( $myMode ) {
case 'latest':
$sTabTitle = _t( '_Latest' );
break;
case 'rand':
$sTabTitle = _t( '_Random' );
break;
}
and replace with
$mode = $_REQUEST['events_mode'];
if( $mode != 'first' and $mode != 'rand' and $mode != 'latest' )
$mode = 'first';
$aDBTopMenu = array();
foreach( array( 'first','latest', 'rand' ) as $myMode ) {
switch( $myMode ) {
case 'first':
$sTabTitle = _t( '_First' );
break;
case 'latest':
$sTabTitle = _t( '_Latest' );
break;
case 'rand':
$sTabTitle = _t( '_Random' );
break;
}
To fix this - use the following SQL
$sOrderS = "AND `EventStart` BETWEEN NOW() AND NOW()+ INTERVAL 362 DAY ORDER BY `EventStart` ASC";
There's full instructions on my site...
http://www.deeemm.com/index.php?page=how%20to&id=13
My mod is a little dirtier and could do with smartmusics addition of the additional see more
DM
the blog is, that first events are shown, doesn´t matter if the first events are past or future...
so you have two choices that only future first events are shown:
1. you delete past events
2.
..:: Modification for your HOME Page event block ::..
1. edit the file "templates/base/scripts/BxBaseIndex.php"
Find code (~1192 line)
$iTotalNum = db_value("SELECT COUNT(*) AS 'Cnt' FROM `SDatingEvents` WHERE `Status` = 'Active'");
and see more