Documentation is available at page.php
- <?
- /**
- * page.php
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * @author Stephan Raabe
- */
- $url_complete = getCompleteUrl();
- $input = $site_home;
- $lang = "";
- $url_mode = "id";
- $mode = "?id=";
- if (isset($_GET["id"]))
- {
- $input = $_GET["id"];
- }
- else
- {
- $input = $site_home;
- $link = connectDB();
- $query = "SELECT page_path FROM ".$db_praefix."page WHERE page_path = '$input'";
- $result = mysql_query($query);
- if (mysql_num_rows($result) == 0)
- {
- $query = "SELECT page_path FROM ".$db_praefix."page WHERE page_parent = 0";
- $result = mysql_query($query);
- $home_arr = mysql_fetch_array($result);
- $input = $home_arr["page_path"];
- }
- closeDB($link);
- }
- $page = get_page($input);
- if ($page["page_rows"] == 1)
- {
- $path = get_path($url_mode);
- $start_key = $path[0]["page_key"];
- $page_lang = $path[0]["page_lang"];
- $homepage = get_homepage($start_key);
- $primary = get_primary($path,$start_key,$url_mode);
- $siblings = get_siblings($page,$url_mode);
- $childs = get_childs($page["page_key"],$url_mode);
- if ($page_lang != "")
- {
- $lang = "/".$page_lang;
- }
- else
- {
- $lang = "";
- }
- }
- /**
- * checks the syntax of the url
- */
- function checkUrl()
- {
- global $url_complete,$site_url;
- $url_complete = htmlentities($url_complete);
- $pos1 = strpos ($url_complete, "<");
- $pos2 = strpos ($url_complete, ">");
- $pos3 = strpos ($url_complete, "%3c");
- $pos4 = strpos ($url_complete, "%3e");
- if (($pos1 === false) && ($pos2 === false) && ($pos3 === false) && ($pos4 === false))
- {
- }
- else
- {
- Header("Location: $site_url");
- }
- }
- /**
- * returns the complete url
- */
- function getCompleteUrl()
- {
- if (isset($_SERVER["PHP_SELF"]))
- {
- $url_complete = $_SERVER["PHP_SELF"];
- }
- else
- {
- $url_complete = "";
- }
- if (isset($_SERVER["QUERY_STRING"]))
- {
- $url_complete .= "?".$_SERVER["QUERY_STRING"];
- }
- else
- {
- $url_complete .= "";
- }
- return $url_complete;
- }
- ?>
Documentation generated on Tue, 16 Aug 2005 17:32:22 +0200 by phpDocumentor 1.3.0RC3