SHARE
TWEET

seberm

seberm Mar 8th, 2009 18 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | PHP Source                                                          
  4. // +----------------------------------------------------------------------
  5. // | Copyright (C) 2009 by Sabart Otto <seberm@gmail.com>
  6. // +----------------------------------------------------------------------
  7. //
  8. //... - index.php
  9.  
  10. //...Default page
  11. if ($_GET["page"]) $page = $_GET["page"]; else $page = "main";
  12.  
  13. //...Sql include protection
  14. $invalide = array ('/','/\/',':','.');
  15. $page = str_replace ($invalide, ' ', $page); //...Nahrazeni znaku
  16.  
  17. //...Vlozeni tridy webu
  18. include_once ("include/functions.class.php");
  19. $trida = new Functions;
  20.  
  21. $trida->Config['title'] = "Seberm's Page";
  22. $trida->Config['description'] = "Personal Seberm's Page";
  23. $trida->Config['author'] = "Seberm";
  24. $trida->Config['MyIcq'] = 123456789;
  25. $trida->Config['keywords'] = "seberm junior personal osobnÝ web arch archlinux linux gnu";
  26. $trida->Config['favicon'] = "favicon.ico";
  27. $trida->Config['web_version'] = "v0.9.9";
  28. $trida->Config['MainLang'] = "cz"; //...Defautl page language
  29.  
  30. $trida->Actual['lang'] = $trida->Config['MainLang'];
  31.  
  32. //...Nastaveni jazyka z cookie + vytvoreni cookie jestli neexistuje
  33.  
  34. if (($_COOKIE["lang"] == "cz") || ($_COOKIE["lang"] == "en"))
  35.         $trida->Actual["lang"] = $_COOKIE["lang"];
  36. else {
  37.         $trida->Actual["lang"] = $trida->Config["MainLang"];
  38.        
  39.         //...Cookie doesn't exists -> Make new lang cookie -> for one year
  40.         setcookie ("lang", $trida->Config["MainLang"], time() + 60*60*24*365, "/");
  41. }
  42.  
  43.  
  44. if ($_GET['lang'] == "cz" || $_GET['lang'] == "en") {
  45.         $trida->Actual['lang'] = $_GET['lang'];
  46.         setcookie ("lang", $_GET["lang"], time() + 60*60*24*365, "/");
  47. }
  48.  
  49.  
  50. //...Vyskytnuti spravy pro uzivatele
  51. if ($_GET['message']) {
  52.         $trida->Message = True;
  53.         $trida->Actual['message'] = $_GET['message'];
  54.         include_once ("pages/messages/{$trida->Actual['lang']}/data.php");
  55. }
  56. //...Aktualni stranka, na ktere se nachazi uzivatel
  57. $trida->Actual['page'] = $page;
  58.  
  59. //...Vlozeni textu podle zvoleneho jazyka
  60. include_once ("pages/data/{$trida->Actual['lang']}/data.php");
  61.  
  62. //...Vlozeni obsahu webu - taky podle zvoleneho jazyka
  63. if (!file_exists("pages/content/{$trida->Actual['lang']}/{$page}.php")) $page = "404";
  64. include_once ("pages/content/{$trida->Actual['lang']}/{$page}.php");
  65.  
  66. //////////////////
  67. /////Make Web/////
  68. $trida->MakeWeb();
  69. //////////////////
  70.  
  71.  
  72. ?>
RAW Paste Data
Top