Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // +----------------------------------------------------------------------
- // | PHP Source
- // +----------------------------------------------------------------------
- // | Copyright (C) 2009 by Sabart Otto <seberm@gmail.com>
- // +----------------------------------------------------------------------
- //
- //... - index.php
- //...Default page
- if ($_GET["page"]) $page = $_GET["page"]; else $page = "main";
- //...Sql include protection
- $invalide = array ('/','/\/',':','.');
- $page = str_replace ($invalide, ' ', $page); //...Nahrazeni znaku
- //...Vlozeni tridy webu
- include_once ("include/functions.class.php");
- $trida = new Functions;
- $trida->Config['title'] = "Seberm's Page";
- $trida->Config['description'] = "Personal Seberm's Page";
- $trida->Config['author'] = "Seberm";
- $trida->Config['MyIcq'] = 123456789;
- $trida->Config['keywords'] = "seberm junior personal osobní web arch archlinux linux gnu";
- $trida->Config['favicon'] = "favicon.ico";
- $trida->Config['web_version'] = "v0.9.9";
- $trida->Config['MainLang'] = "cz"; //...Defautl page language
- $trida->Actual['lang'] = $trida->Config['MainLang'];
- //...Nastaveni jazyka z cookie + vytvoreni cookie jestli neexistuje
- if (($_COOKIE["lang"] == "cz") || ($_COOKIE["lang"] == "en"))
- $trida->Actual["lang"] = $_COOKIE["lang"];
- else {
- $trida->Actual["lang"] = $trida->Config["MainLang"];
- //...Cookie doesn't exists -> Make new lang cookie -> for one year
- setcookie ("lang", $trida->Config["MainLang"], time() + 60*60*24*365, "/");
- }
- if ($_GET['lang'] == "cz" || $_GET['lang'] == "en") {
- $trida->Actual['lang'] = $_GET['lang'];
- setcookie ("lang", $_GET["lang"], time() + 60*60*24*365, "/");
- }
- //...Vyskytnuti spravy pro uzivatele
- if ($_GET['message']) {
- $trida->Message = True;
- $trida->Actual['message'] = $_GET['message'];
- include_once ("pages/messages/{$trida->Actual['lang']}/data.php");
- }
- //...Aktualni stranka, na ktere se nachazi uzivatel
- $trida->Actual['page'] = $page;
- //...Vlozeni textu podle zvoleneho jazyka
- include_once ("pages/data/{$trida->Actual['lang']}/data.php");
- //...Vlozeni obsahu webu - taky podle zvoleneho jazyka
- if (!file_exists("pages/content/{$trida->Actual['lang']}/{$page}.php")) $page = "404";
- include_once ("pages/content/{$trida->Actual['lang']}/{$page}.php");
- //////////////////
- /////Make Web/////
- $trida->MakeWeb();
- //////////////////
- ?>
Add Comment
Please, Sign In to add comment