- Timestamp:
- Apr 28, 2021, 6:11:27 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Config/Config.sample.php
r55 r61 9 9 $Config['Encoding'] = 'utf-8'; 10 10 $Config['BaseURL'] = ''; 11 $Config['HostName'] = 'https://localhost'; 11 12 $Config['ItemsPerPage'] = 30; 12 13 $Config['VisiblePagingItems'] = 5; … … 15 16 $Config['Web']['Title'] = 'Tanec'; 16 17 $Config['Web']['AdminPassword'] = rand(1, 10000000); 18 $Config['MeetInterval'] = 90 * 24 * 60 * 60; 19 $Config['EventInterval'] = 90 * 24 * 60 * 60; -
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 { -
trunk/Modules/Meet/Meet.php
r59 r61 111 111 { 112 112 return ($Char == ' ') or ($Char == "\t"); 113 } 114 115 function 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']).'")'; 113 122 } 114 123 -
trunk/Modules/Meet/MeetPage.php
r56 r61 36 36 function Show() 37 37 { 38 global $Config; 39 38 40 $Filter = new Filter(); 39 41 $Filter->Items = array( … … 59 61 60 62 $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); 62 65 $DbRow = $DbResult->fetch_row(); 63 66 $PageList = GetPageList($DbRow[0]); … … 82 85 $Output .= $Order['Output']; 83 86 $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 '. 85 88 $Where.$Order['SQL'].$PageList['SQLLimit']); 86 89 while ($MeetItem = $DbResult->fetch_assoc()) … … 209 212 $RSS->Link = $this->System->AbsoluteLink('/seznamka/'); 210 213 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'); 213 217 while ($MeetItem = $DbResult->fetch_assoc()) 214 218 { -
trunk/index.php
r56 r61 235 235 236 236 // Meets 237 $DbResult = $this->Database->query('SELECT `Id`,`Time` FROM `MeetItem` WHERE (`Hidden`=0)');237 $DbResult = $this->Database->query('SELECT `Id`,`Time` FROM `MeetItem` WHERE '.GetDefaultMeetFilter()); 238 238 while ($DbRow = $DbResult->fetch_array()) 239 239 { … … 247 247 248 248 // Events 249 $DbResult = $this->Database->query('SELECT `Id`,`TimeFrom` FROM `Event` WHERE (`Hidden`=0)');249 $DbResult = $this->Database->query('SELECT `Id`,`TimeFrom` FROM `Event` WHERE '.GetDefaultEventFilter()); 250 250 while ($DbRow = $DbResult->fetch_array()) 251 251 {
Note:
See TracChangeset
for help on using the changeset viewer.