Changeset 61 for trunk/Modules/Event
- Timestamp:
- Apr 28, 2021, 6:11:27 PM (4 years ago)
- Location:
- trunk/Modules/Event
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Event/Event.php
r55 r61 2 2 3 3 include_once(dirname(__FILE__).'/Import/JoeClub.php'); 4 5 function 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 } 4 13 5 14 function ReduceSpaces($Content) -
trunk/Modules/Event/EventPage.php
r56 r61 57 57 58 58 $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); 60 60 $DbRow = $DbResult->fetch_row(); 61 61 $PageList = GetPageList($DbRow[0]); … … 77 77 $Output .= $Order['Output']; 78 78 $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 '. 80 80 $Where.$Order['SQL'].$PageList['SQLLimit']); 81 81 while ($Event = $DbResult->fetch_assoc()) … … 198 198 199 199 $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`=0ORDER 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'); 201 201 while ($Event = $DbResult->fetch_assoc()) 202 202 {
Note:
See TracChangeset
for help on using the changeset viewer.