Pragmatism in code


Waxing lyrical about life the universe and everything tech related since lunchtime 2006.
1 minute reading time (219 words)

Dolphin MOD - Upcoming Events

One thing that has always bugged me about my dolphin site, is that it always shows me events that are waaaay waaaay in the future - This is of little use as it hides the upcoming events - practically meaning that no one knows what is happening in the coming days / weeks / months / etc.

This is easily fixed with a quick hack.

To display events so that they show from the next upcoming event onward...

Edit /inc/classes/BxDolEvents.php

At approximately line 2242 you will see the following

switch ($sOrder) {

This selects the appendage to the SQL statement retrieving the events from the database. The default case select statement is 'latest'.

To change the behaviour, we simply replace this case with


$sOrderS = "AND `EventStart` BETWEEN NOW() AND NOW()+ INTERVAL 362 DAY ORDER BY `EventStart` ASC";


Now the Events Block will show the next event in time and those after it up to a year away (or the three or so events that the block is allowed to show)

To do this mod properly, ideally another case should be added for 'upcoming' and the relevent code added where required to add another tab to the block - this way the user could select to view upcoming events, latest events or a random selection.



DOLPHIN - Create Custom Blocks
UEX Ultraedit For Linux

Related Posts



No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Sunday, 05 April 2020
If you'd like to register, please fill in the username, password and name fields.

Captcha Image