Changeset 838 for trunk/alert.php


Ignore:
Timestamp:
Jan 9, 2016, 11:45:01 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Some libraries moved to Common package located at Packages directory.
  • Modified: Application class System renamed to Core. System class is not just basic parent class for application.
  • Fixed: alert file now use same application class as other files.
  • Modified: Error application module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/alert.php

    r816 r838  
    11<?php
    22
    3 include('includes/config.php');
     3$InitSystem = true;
     4include_once('includes/global.php');
    45
    5 function HumanDate($SQLDateTime)
     6class PageAlert extends Page
    67{
    7   $DateTimeParts = explode(' ', $SQLDateTime);
    8   if($DateTimeParts[0] != '0000-00-00')
     8  function Show()
    99  {
    10     $DateParts = explode('-', $DateTimeParts[0]);
    11     return(($DateParts[2] * 1).'.'.($DateParts[1] * 1).'.'.($DateParts[0] * 1));
    12   } else return('&nbsp;');
    13 }
    14 
     10    $this->RawPage = true;
    1511    $Output = 'SERVERALERT:'."\n";
    1612
    1713    $Output .= 'Toto jsou aktuality z projektu wowpreklad.zdechov.net:'."\n"."\n";
    1814
    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`, '.
    2216        '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC ');
    2317    while($Article = $DbResult->fetch_assoc())
     
    2519      $Output .= ('> '.HumanDate($Article['Time']).' '.$Article['Title']."\n".strip_tags($Article['Text'])."\n\n");
    2620    }
    27     echo ($Output);
     21    return($Output);
     22  }
     23}
     24
     25$Page = new PageAlert($System);
     26ShowPageClass($Page);
Note: See TracChangeset for help on using the changeset viewer.