Changeset 61 for trunk/Modules/Event


Ignore:
Timestamp:
Apr 28, 2021, 6:11:27 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Limit display of meet and event to defined time interval.
Location:
trunk/Modules/Event
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Event/Event.php

    r55 r61  
    22
    33include_once(dirname(__FILE__).'/Import/JoeClub.php');
     4
     5function GetDefaultEventFilter($Table = '')
     6{
     7  global $Config;
     8
     9  if ($Table != '') $Table = $Table.'.';
     10
     11  return '('.$Table.'Hidden=0) AND ('.$Table.'TimeFrom > "'.TimeToMysqlDateTime(time() - $Config['EventInterval']).'")';
     12}
    413
    514function ReduceSpaces($Content)
  • trunk/Modules/Event/EventPage.php

    r56 r61  
    5757
    5858    $DbResult = $this->Database->query('SELECT COUNT(*) FROM (SELECT *, '.
    59       '(SELECT EventSource.Name FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceName FROM `Event`) AS T WHERE (T.Hidden=0) AND '.$Where);
     59      '(SELECT EventSource.Name FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceName FROM `Event`) AS T WHERE '.GetDefaultEventFilter('T').' AND '.$Where);
    6060    $DbRow = $DbResult->fetch_row();
    6161    $PageList = GetPageList($DbRow[0]);
     
    7777    $Output .= $Order['Output'];
    7878    $DbResult = $this->Database->query('SELECT * FROM (SELECT *, (SELECT EventSource.Name FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceName, '.
    79       '(SELECT EventSource.URL FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceURL FROM Event) AS T WHERE (T.Hidden=0) AND '.
     79      '(SELECT EventSource.URL FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceURL FROM Event) AS T WHERE '.GetDefaultEventFilter('T').' AND '.
    8080      $Where.$Order['SQL'].$PageList['SQLLimit']);
    8181    while ($Event = $DbResult->fetch_assoc())
     
    198198
    199199    $DbResult = $this->Database->select('Event', '*, (SELECT EventSource.Name FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceName, '.
    200       '(SELECT EventSource.URL FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceURL', '`Hidden`=0 ORDER BY `TimeFrom` DESC LIMIT 30');
     200      '(SELECT EventSource.URL FROM EventSource WHERE EventSource.Id = Event.Source) AS SourceURL', GetDefaultEventFilter().' ORDER BY `TimeFrom` DESC LIMIT 30');
    201201    while ($Event = $DbResult->fetch_assoc())
    202202    {
Note: See TracChangeset for help on using the changeset viewer.