Changeset 838 for trunk/alert.php
- Timestamp:
- Jan 9, 2016, 11:45:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/alert.php
r816 r838 1 1 <?php 2 2 3 include('includes/config.php'); 3 $InitSystem = true; 4 include_once('includes/global.php'); 4 5 5 function HumanDate($SQLDateTime) 6 class PageAlert extends Page 6 7 { 7 $DateTimeParts = explode(' ', $SQLDateTime); 8 if($DateTimeParts[0] != '0000-00-00') 8 function Show() 9 9 { 10 $DateParts = explode('-', $DateTimeParts[0]); 11 return(($DateParts[2] * 1).'.'.($DateParts[1] * 1).'.'.($DateParts[0] * 1)); 12 } else return(' '); 13 } 14 10 $this->RawPage = true; 15 11 $Output = 'SERVERALERT:'."\n"; 16 12 17 13 $Output .= 'Toto jsou aktuality z projektu wowpreklad.zdechov.net:'."\n"."\n"; 18 14 19 $Database = new mysqli($Config['Database']['Host'],$Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 20 $Database->query('SET NAMES "'.$Config['Database']['Charset'].'"'); 21 $DbResult = $Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '. 15 $DbResult = $this->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '. 22 16 '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC '); 23 17 while($Article = $DbResult->fetch_assoc()) … … 25 19 $Output .= ('> '.HumanDate($Article['Time']).' '.$Article['Title']."\n".strip_tags($Article['Text'])."\n\n"); 26 20 } 27 echo ($Output); 21 return($Output); 22 } 23 } 24 25 $Page = new PageAlert($System); 26 ShowPageClass($Page);
Note:
See TracChangeset
for help on using the changeset viewer.