Connect($dbhost, $dbuser, $dbpasswd, $dbname, $dberror); $cmd = $_GET[cmd]; if (isset($_POST[cmd])){ $_GET[cmd]=$_POST[cmd]; } function timeconv ($datum){ $datum = date("d.m.Y", $datum); return $datum; } if ($cmd == "setlang"){ setcookie("language",$_GET[la],time()+3600*24); header('Location: index.php'); } if (!isset($_COOKIE[language])){ setcookie("language","de",time()+3600*24); header('Location: index.php'); } $language = $_COOKIE[language]; $itera=1; function get_tree_upwards($id, $db, $itera, $language){ global $name; global $itera; $query = "select * from golf_mainnav where id='$id'"; $db -> Query($query); if ($rvrek = $db -> FetchArray()){ $names[$itera]= " > "; if ($language == "de"){$names[$itera] .= $rvrek[linkname_de];}else{$names[$itera] .= $rvrek[linkname_en];} $names[$itera] .= ""; $parent_id = $rvrek[parent_id]; } if ($parent_id != "0"){ $itera++; get_tree_upwards($parent_id, $db, $itera, $language); } $i = $itera; while ( $i >=0 ){ $name .= $names[$i]; $i--; } return $name; } /*********************ALL CMD'S**************************/ /****************** DEFAULT_HEADER **********************/ $tpl -> Add("golf_top"); $query = "SELECT * FROM golf_mainnav WHERE parent_id='0' AND (divide='' OR divide='tournament') ORDER BY ordnung ASC"; $db -> Query($query); $kl=1; while ($rvtopmenu = $db -> FetchArray()){ $rvids[$kl]=$rvtopmenu[id]; $linkname_de[$kl] = $rvtopmenu[linkname_de]; $linkname_en[$kl] = $rvtopmenu[linkname_en]; $kl++; } $kl--; for ($l=1; $l<=$kl; $l++){ $pid = $rvids[$l]; $menu_all .= "\n
  • "; if ($language=="de"){$menu_all .= $linkname_de[$l]; }else{$menu_all .= $linkname_en[$l];} $menu_all .= ""; $queryx = "SELECT * FROM golf_mainnav WHERE parent_id='$pid' AND date_stamp='' ORDER BY ordnung ASC"; $db -> Query($queryx); while ($rvsubmenu = $db -> FetchArray()){ $submenu .= "\n
  • "; if ($language=="de"){$submenu .= $rvsubmenu[linkname_de];}else{$submenu .= $rvsubmenu[linkname_en];} $submenu .= "
  • "; } if ($submenu != ""){ $menu_all .= "\n\n"; } $submenu=""; $menu_all .= ""; }//END FOR $rv[menuoben] = $menu_all; $tpl -> Add("golf_topmenu", $rv); $menu_all = ""; $rv[menuoben] = ""; /***************END_DEFAULT_HEADER ********************/ /*************** COLUMN_LEFT_START ********************/ $query = "SELECT * FROM golf_mainnav WHERE divide='news' AND parent_id !='0' ORDER BY id DESC"; $db -> Query($query); while ($rvnews = $db -> FetchArray()){ $rvc[news].="
    "; if ($language=="de"){$rvc[news].=substr($rvnews[linkname_de],0,70);}else{$rvc[news].=substr($rvnews[linkname_en],0,70);} $rvc[news].="

    "; if ($language=="de"){$rvc[news].="mehr info";}else{$rvc[news].="read more";} $rvc[news].="
    "; } $tpl -> Add("golf_left_start", $rvc); if ($language=="de"){ $tpl -> Add("featuring_de"); }else{ $tpl -> Add("featuring_en"); } $query = "SELECT * FROM golf_mainnav WHERE frontfeature='1' ORDER BY id DESC"; $db -> Query($query); while ($rvnews = $db -> FetchArray()){ $rvfull[featureing].="
    "; if ($language=="de"){ $rvfull[featureing] .= $rvnews[linkname_de]; }else{ $rvfull[featureing] .= $rvnews[linkname_en]; } $rvfull[featureing].="
    "; if ($language=="de"){ $rvfull[featureing] .= $rvnews[feature_de]; }else{ $rvfull[featureing] .= $rvnews[feature_en]; } $rvfull[featureing] .= ""; if ($language=="de"){ $rvfull[featureing] .= "mehr info"; }else{ $rvfull[featureing] .= "read more"; } $rvfull[featureing] .= "
    "; } /********************IMPRESSIONS*************************/ $handle1 = opendir ("userfiles/Bilder/Impressionen/"); while ($datei1 = readdir ($handle1)) { if ($datei1 != "." && $datei1 != "..") { $testthumb = substr($datei1,-7,-4); if ($testthumb=="_kl"){ $thumb = $datei1; $bigtarget = str_replace($testthumb,"", $datei1); $slider1[pimp].="Forst 300, A-8812 Mariahof \">"; } } } closedir($handle1); if ($language=="de"){ $tpl -> Add("golf_imressions_de", $slider1); }else{ $tpl -> Add("golf_imressions_en", $slider1); } /******************IMPRESSIONS_END***********************/ /************COLOUMN_LEFT_END***********************/ /********************SLIDER*************************/ $handle = opendir ("userfiles/Bilder/Slider/"); while ($datei = readdir ($handle)) { if ($datei != "." && $datei != "..") { $slider[pics].="
  • "; } } closedir($handle); if (isset($_GET[id])){ $slider[crumb] = get_tree_upwards($_GET['id'], $db, $itera, $language); } $tpl -> Add("golf_slider", $slider); /********************SLIDER_END*************************/ /////////////////*** MAIN ***/////////////////////////// if ($_GET[cmd]==""){ include ("start.php"); } if ($_GET[cmd]=="search"){ $searchterm = mysql_real_escape_string($_POST[searchterm]); if (isset($_POST[searchterm])){ $rvs[searchtermx] = mysql_real_escape_string($_POST[searchterm]); }else{ $rvs[searchtermx] = "Suchbegriff"; } include ("searchx.php"); } if ($_GET[cmd]=="s"){ $query = "SELECT * FROM golf_mainnav WHERE id='$_GET[id]'"; $db -> Query($query); if ($rvctype = $db -> FetchArray()){ $tournment = $rvctype[divide]; } if ($tournment==""){ include ("cont.php"); } if ($tournment=="news"){ include ("cont.php"); } if ($tournment=="tournament"){ include ("tournment.php"); } } ////////////////*** MAIN_END ***/////////////////////////// /********************WEATHER******************************/ if ($language=="de"){ $tpl -> Add("golf_weather_de"); }else{ $tpl -> Add("golf_weather_en"); } /********************WEATHER_END*************************/ /******************COMMONS_RIGHT*************************/ $tpl -> Add("golf_anreisser_front", $rvfull); /*****************COMMONS_RIGHT_END**********************/ if ($language=="de"){ $tpl -> Add("golf_footer_de"); }else{ $tpl -> Add("golf_footer_en"); } $tpl -> Show(); ?>