Changeset 56 for branches/old/global.php


Ignore:
Timestamp:
Feb 21, 2015, 12:17:01 AM (9 years ago)
Author:
chronos
Message:
  • Added: Version information.
  • Modified: Used newest Database class.
  • Modified: Generated HTML code should be now compain with HTML5 standard.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/old/global.php

    r54 r56  
    88}
    99include_once('config.php');
    10 include_once('database.php');
    11 include_once('code.php');
     10include_once('Version.php');
    1211include_once('types.php');
    1312include_once('classes.php');
    14 include_once('Common/PrefixMultiplier.php');
     13include_once('Packages/Common/Package.php');
    1514$PrefixMultiplier = new PrefixMultiplier();
    1615include_once('stat_functions.php');
    17 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
    18 if ($Database->connect_error) {
    19   die('Connect Error (' . $Database->connect_errno . ') '.$Database->connect_error);
    20 }
    21 
     16$Database = new Database();
     17$Database->Connect($Config['Database']['Host'], $Config['Database']['User'],
     18  $Config['Database']['Password'], $Config['Database']['Database']);
    2219$Database->Prefix = $Config['Database']['Prefix'];
    2320$Database->charset($Config['Database']['Charset']);
     21$Database->ShowSQLError = $Config['Web']['ShowSQLError'];
     22$Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
    2423
    2524// SQL injection hack protection
     
    2726foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
    2827
     28function HumanDate($Time)
     29{
     30  return(date('j.n.Y', $Time));
     31}
     32
    2933function ShowPage($Content)
    3034{
    31   global $Config;
    32   $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'."\n". // <? 
    33 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    34 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    35 <head>
    36   <meta http-equiv="Content-Language" content="cs"/>
    37   <meta http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'"/>
    38   <title>'.$Config['Web']['Title'].'</title>
    39   <link rel="StyleSheet" href="style/style.css" type="text/css" media="all"/>
    40   </head><body>';
    41   $Output .= $Content.'</body></html>';
     35  global $Config, $ReleaseTime, $Revision;
     36
     37  $Output = '<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>'."\n".
     38  '<!DOCTYPE html>'.
     39  '<html>'.
     40  '<head>'.
     41  '<meta http-equiv="Content-Language" content="cs"/>'.
     42  '<meta http-equiv="content-type" content="text/html; charset='.$Config['Web']['Charset'].'" />'.
     43  '<meta name="robots" content="all" />'.
     44  '<title>'.$Config['Web']['Title'].'</title>'.
     45  '<link rel="StyleSheet" href="style/style.css" type="text/css" media="all"/>'.
     46  '</head><body>';
     47  $Output .= $Content;
     48  $Output .= '<br/><div style="text-align: center; font-size: small;">Verze: '.$Revision.' ('.HumanDate($ReleaseTime).')'.
     49    ' &nbsp; <a href="http://svn.zdechov.net/trac/statistic/browser/trunk">Zdrojový kód</a> &nbsp; '.
     50    '<a href="http://svn.zdechov.net/trac/statistic/log/trunk?verbose=on">Historie změn</a></div>';
     51  $Output .= '</body></html>';
    4252  echo($Output);
    4353}
Note: See TracChangeset for help on using the changeset viewer.