Changeset 61 for trunk/Modules/Meet


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/Meet
Files:
2 edited

Legend:

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

    r59 r61  
    111111{
    112112  return ($Char == ' ') or ($Char == "\t");
     113}
     114
     115function GetDefaultMeetFilter($Table = '')
     116{
     117  global $Config;
     118
     119  if ($Table != '') $Table = $Table.'.';
     120
     121  return '('.$Table.'Hidden=0) AND ('.$Table.'Time > "'.TimeToMysqlDateTime(time() - $Config['MeetInterval']).'")';
    113122}
    114123
  • trunk/Modules/Meet/MeetPage.php

    r56 r61  
    3636  function Show()
    3737  {
     38    global $Config;
     39
    3840    $Filter = new Filter();
    3941    $Filter->Items = array(
     
    5961
    6062    $DbResult = $this->Database->query('SELECT COUNT(*) FROM (SELECT *, '.
    61       '(SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName FROM `MeetItem`) AS T WHERE (T.Hidden=0) AND '.$Where);
     63      '(SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName FROM `MeetItem`) AS T '.
     64      'WHERE '.GetDefaultMeetFilter('T').' AND '.$Where);
    6265    $DbRow = $DbResult->fetch_row();
    6366    $PageList = GetPageList($DbRow[0]);
     
    8285    $Output .= $Order['Output'];
    8386    $DbResult = $this->Database->query('SELECT * FROM (SELECT *, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    84       '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL FROM MeetItem) AS T WHERE (T.Hidden=0) AND '.
     87      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL FROM MeetItem) AS T WHERE '.GetDefaultMeetFilter('T').' AND '.
    8588      $Where.$Order['SQL'].$PageList['SQLLimit']);
    8689    while ($MeetItem = $DbResult->fetch_assoc())
     
    209212    $RSS->Link = $this->System->AbsoluteLink('/seznamka/');
    210213
    211     $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    212       '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '`Hidden`=0 ORDER BY `Time` DESC LIMIT 30');
     214    $DbResult = $this->Database->query('SELECT *, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
     215      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL FROM MeetItem WHERE '.
     216      GetDefaultMeetFilter().' ORDER BY `Time` DESC LIMIT 30');
    213217    while ($MeetItem = $DbResult->fetch_assoc())
    214218    {
Note: See TracChangeset for help on using the changeset viewer.