Custom Event Sorting (v. 2.84 - 2.91)
The events page sorts entries by date only. If you have several entries, and you'd like to specify the order in which those entries are sorted after the date, you can use the following modification:
-
Open the events.php file in the /enc/ folder.
-
Change the code (around line 55) from:
$evquery = "SELECT DAY(date) AS dateday, name, description FROM " . SB_DB_PREFIX . "_events WHERE date LIKE '" . addslash_mq($datesearch) . "%' AND (expire > '" . addslash_mq($today_short) . "' OR expire = '0000-00-00') AND name<>'' AND description<>''";
to:
$evquery = "SELECT DAY(date) AS dateday, name, description FROM " . SB_DB_PREFIX . "_events WHERE date LIKE '" . addslash_mq($datesearch) . "%' AND (expire > '" . addslash_mq($today_short) . "' OR expire = '0000-00-00') AND name<>'' AND description<>'' ORDER BY date ASC, expire ASC";
-
Change the code (around line 98) from:
natsort($evlist);
to:
// natsort($evlist);
-
In your events, use the expiration date (which is the date the entry no longer appears on the site) to act as a sorting field.
e.g.) If three events are held on 10/6/16, instead of setting an expiration date of 10/1/17 for all of them, you could specify 10/1/17 for the one you want to show first, 10/2/17 for the one you want to show second, and 10/3/17 for the one to be shown last.