time = time(); $this->startSession(); if(empty($_SESSION['aktLanguage']))$_SESSION['aktLanguage']=""; $_SESSION['aktLanguage']=(!empty($_GET['aktLanguage'])) ? $_GET['aktLanguage'] : $_SESSION['aktLanguage']; if(isset($_GET['aktSite']))$_SESSION['aktSite']=$_GET['aktSite']; if(empty($_SESSION['aktSite']))$_SESSION['aktSite']="desktop"; if(isset($_GET['aktSubSite']))$_SESSION['aktSubSite']=$_GET['aktSubSite']; if(empty($_SESSION['aktSubSite']))$_SESSION['aktSubSite']="1"; //if($_SESSION['langKuerzel']=="templates") $_SESSION['langKuerzel']=""; } function startSession(){ global $database; //The database connection session_start(); //Tell PHP to start the session /* Determine if user is logged in */ $this->logged_in = $this->checkLogin(); /** * Set guest value to users not logged in, and update * active guests table accordingly. */ if(!$this->logged_in){ $this->username = $_SESSION['username'] = GUEST_NAME; $this->userlevel = GUEST_LEVEL; $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); } /* Update users last active timestamp */ else{ $database->addActiveUser($this->username, $this->time); } /* Remove inactive visitors from database */ $database->removeInactiveUsers(); $database->removeInactiveGuests(); /* Set referrer page */ if(isset($_SESSION['url'])){ $this->referrer = $_SESSION['url']; }else{ $this->referrer = "/"; } /* Set current url */ $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF']; } function updateStyle($param) { global $database; if($database->updateUserField($_SESSION['username'], 'style', $param)) return true;else return false; } /** * checkLogin - Checks if the user has already previously * logged in, and a session with the user has already been * established. Also checks to see if user has been remembered. * If so, the database is queried to make sure of the user's * authenticity. Returns true if the user has logged in. */ function checkLogin(){ global $database; //The database connection /* Check if user has been remembered */ /* Username and userid have been set and not guest */ if(isset($_SESSION['username']) && isset($_SESSION['userid']) && $_SESSION['username'] != GUEST_NAME){ /* Confirm that username and userid are valid */ if($database->confirmUserID($_SESSION['username'], $_SESSION['userid']) != 0) { /* Variables are incorrect, user not logged in */ unset($_SESSION['username']); unset($_SESSION['userid']); return false; } /* User is logged in, set class variables */ $this->userinfo = $database->getUserInfo($_SESSION['username']); $this->username = $this->userinfo['username']; $this->userid = $this->userinfo['userid']; $this->userRef = $this->userinfo['id']; $this->userlevel = $this->userinfo['userlevel']; //$this->standortlevel = $this->userinfo['standortlevel']; $this->bookmark = $this->userinfo['home']; $this->userStyle = $this->userinfo['style']; //$this->availStyles= $database->getStyles(); //$this->userDetailId= $database->getUserDetailId($_SESSION['username']); return true; } /* User not logged in */ else{ return false; } } /** * login - The user has submitted his username and password * through the login form, this function checks the authenticity * of that information in the database and creates the session. * Effectively logging in the user if all goes well. */ function login($subuser, $subpass, $subremember){ global $database, $form; //The database and form object /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "Kein Benutzername eingegeben"); } else { /* Check if username is not alphanumeric */ if($subuser!="super_admin") { if(!eregi("^([0-9a-z])*$", $subuser)){ $form->setError($field, "Benutzername enthält Sonderzeichen"); } } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "Kein Passwort eingegeben"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Checks that username is in database and password is correct */ $subuser = stripslashes($subuser); $result = $database->confirmUserPass($subuser, md5($subpass)); /* Check error codes */ if($result == 1){ $field = "user"; $form->setError($field, "Benutzer nicht gefunden"); } else if($result == 2){ $field = "pass"; $form->setError($field, "Passwort inkorrekt"); }else if($result == 3){ $form->setError($field, "Benutzername gesperrt"); } else if($result == 4){ $field = "nonactive"; $form->setError($field, "Account nicht aktiviert"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Username and password correct, register session variables */ /* User is logged in, set class variables */ $this->userinfo = $database->getUserInfo($subuser); $this->username = $_SESSION['username'] = $this->userinfo['username']; $this->userid = $_SESSION['userid'] = $this->generateRandID(); $this->userlevel = $this->userinfo['userlevel']; $this->userRef = $this->userinfo['id']; //$this->standortlevel = $_SESSION['standortlevel'] = $this->userinfo['standortlevel']; $this->userStyle = $_SESSION['style'] = $this->userinfo['style']; //$this->availStyles= $database->getStyles(); $this->logged_in = $_SESSION['logged_in'] = true; /* Insert userid into database and update active users table */ $database->updateUserField($this->username, "userid", $this->userid); $database->addActiveUser($this->username, $this->time); $database->removeActiveGuest($_SERVER['REMOTE_ADDR']); /* Login completed successfully */ return true; } /** * logout - Gets called when the user wants to be logged out of the * website. It deletes any cookies that were stored on the users * computer as a result of him wanting to be remembered, and also * unsets session variables and demotes his user level to guest. */ function logout(){ global $database; //The database connection /* Unset PHP session variables */ unset($_SESSION['username']); unset($_SESSION['userid']); /* Reflect fact that user has logged out */ $this->logged_in = false; /** * Remove from active users table and add to * active guests tables. */ $database->removeActiveUser($this->username); $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); /* Set user level to guest */ $this->username = GUEST_NAME; $this->userlevel = GUEST_LEVEL; } /** * register - Gets called when the user has just submitted the * registration form. Determines if there were any errors with * the entry fields, if so, it records the errors and returns * 1. If no errors were found, it registers the new user and * returns 0. Returns 2 if registration failed. */ function register($subuser, $subpass, $subemail, $level){ global $database, $form, $mailer; //The database, form and mailer object /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "Es wurde kein Benutzername eingegeben."); } else{ /* Spruce up username, check length */ $subuser = stripslashes($subuser); if(strlen($subuser) < 5){ $form->setError($field, "Der Benutzername muss aus mindestens 5 Zeichen bestehen."); } else if(strlen($subuser) > 30){ $form->setError($field, "Der Benutzername darf nicht aus mehr als 30 Zeichen bestehen."); } /* Check if username is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", $subuser)){ $form->setError($field, "Der Benutzername enthält Sonderzeichen"); } /* Check if username is reserved */ else if(strcasecmp($subuser, GUEST_NAME) == 0){ $form->setError($field, "Benutzername bereits vergeben."); } /* Check if username is already in use */ else if($database->usernameTaken($subuser)){ $form->setError($field, "Benutzername bereits vergeben."); } /* Check if username is banned */ else if($database->usernameBanned($subuser)){ $form->setError($field, "Benutzer wurde gebannt."); } } /* Standort error checking */ /* else{ if(!eregi("^([a-zA-ZäöüÄÖÜß-])+$", $standort)){ $form->setError($field, "Unerlaubte Sonderzeichen (nur '-' erlaubt)."); } }*/ /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "Bitte Passwort eingeben."); } else{ /* Spruce up password and check length*/ $subpass = stripslashes($subpass); if(strlen($subpass) < 4){ $form->setError($field, "Das Passwort ist zu kurz (mind. 4)."); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($subpass = trim($subpass)))){ $form->setError($field, "Das Passwort enthält Sonderzeichen."); } /** * Note: I trimmed the password only after I checked the length * because if you fill the password field up with spaces * it looks like a lot more characters than 4, so it looks * kind of stupid to report "password too short". */ } /* Email error checking */ $field = "email"; //Use field name for email if(!$subemail || strlen($subemail = trim($subemail)) == 0){ $form->setError($field, "Keine Emailadresse eingegeben"); } else{ /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)){ $form->setError($field, "Die Emailadresse ist inkorrekt."); } $subemail = stripslashes($subemail); } /* Errors exist, have user correct them */ if($form->num_errors > 0){ return 1; //Errors with form } /* No errors, add the new account to the */ else{ if($database->addNewUser($subuser, md5($subpass), $subemail,$level)){ if(EMAIL_WELCOME){ $mailer->sendWelcome($subuser,$subemail,$subpass); } return 0; //New user added succesfully }else{ return 2; //Registration attempt failed } } } function upgradeAccount($so, $oldlevel, $newlevel) { global $database, $form; if($oldlevel!=$newlevel){ if ($database->upgradeStandort($so, $oldlevel,$newlevel)) return true; } } /** * editAccount - Attempts to edit the user's account information * including the password, which it first makes sure is correct * if entered, if so and the new password is in the right * format, the change is made. All other fields are changed * automatically. */ function editAccount($subcurpass, $subnewpass, $subemail){ global $database, $form; //The database and form object /* New password entered */ if($subnewpass){ /* Current Password error checking */ $field = "curpass"; //Use field name for current password if(!$subcurpass){ $form->setError($field, "Es wurde kein aktuelles Passwort angegeben."); } else{ /* Check if password too short or is not alphanumeric */ $subcurpass = stripslashes($subcurpass); if(strlen($subcurpass) < 4 || !eregi("^([0-9a-z])+$", ($subcurpass = trim($subcurpass)))){ $form->setError($field, "Das aktuelle Passwort ist inkorrekt."); } /* Password entered is incorrect */ if($database->confirmUserPass($this->username,md5($subcurpass)) != 0){ $form->setError($field, "Das aktuelle Passwort ist inkorrekt."); } } /* New Password error checking */ $field = "newpass"; //Use field name for new password /* Spruce up password and check length*/ $subpass = stripslashes($subnewpass); if(strlen($subnewpass) < 4){ $form->setError($field, "Das neue Passwort ist zu kurz (min. 4 zeichen)."); } /* Check if password is not alphanumeric */ else if(!eregi("^([0-9a-z])+$", ($subnewpass = trim($subnewpass)))){ $form->setError($field, "Das neue Passwort enthält Sonderzeichen."); } } /* Change password attempted */ else if($subcurpass){ /* New Password error reporting */ $field = "newpass"; //Use field name for new password $form->setError($field, "Es wurde kein neues Passwort angegeben."); } /* Email error checking */ $field = "email"; //Use field name for email if($subemail && strlen($subemail = trim($subemail)) > 0){ /* Check if valid email address */ $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*" ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*" ."\.([a-z]{2,}){1}$"; if(!eregi($regex,$subemail)){ $form->setError($field, "Die Emailadresse ist inkorrekt"); } $subemail = stripslashes($subemail); } /* Errors exist, have user correct them */ if($form->num_errors > 0){ return false; //Errors with form } /* Update password since there were no errors */ if($subcurpass && $subnewpass){ $database->updateUserField($this->username,"password",md5($subnewpass)); } /* Change Email */ if($subemail){ $database->updateUserField($this->username,"email",$subemail); } /* Success! */ return true; } /** * isAdmin - Returns true if currently logged in user is * an administrator, false otherwise. */ function isAdmin(){ return ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME); } /** * generateRandID - Generates a string made up of randomized * letters (lower and upper case) and digits and returns * the md5 hash of it to be used as a userid. */ function generateRandID(){ return md5($this->generateRandStr(16)); } /** * generateRandStr - Generates a string made up of randomized * letters (lower and upper case) and digits, the length * is a specified parameter. */ function generateRandStr($length){ $randstr = ""; for($i=0; $i<$length; $i++){ $randnum = mt_rand(0,61); if($randnum < 10){ $randstr .= chr($randnum+48); }else if($randnum < 36){ $randstr .= chr($randnum+55); }else{ $randstr .= chr($randnum+61); } } return $randstr; } }; /** * Initialize session object - This must be initialized before * the form object because the form uses session variables, * which cannot be accessed unless the session has started. */ $session = new Session; /* Initialize form object */ $form = new Form; ?> > pfad für xml news file $webtermineSeite="termine.php"; //termine seite im Frontend >> pfad für xml termine file $xmlPrefix="x"; //Name des xml - flash galerie files prefix+id //SEO------------ define("MAXLENGTHDESCRIPTION","155"); define("MAXLENGTHSITETITLE","100"); //Datensätze Anzahl $limit=25; //Default define("ANZVIEW1","10"); define("ANZVIEW2","25"); define("ANZVIEW3","50"); //Längen von Strings in Inputs define("MAXLENGTHTITLE","100"); // Länge von "Titel" define("MAXLENGTHTEASER","150"); // Länge von "Teaser" define("MAXLENGTHTEXT","300"); // Länge von "Teaser" define("MAXLAENGETITEL","40"); //Länge des Titels der in der übersicht angezeigt wird - sonst: define("MAXLAENGETITEL2","35"); define("MAXLAENGETITELCODE"," ..."); define("MAXLENGTHPLZ","5"); //Maße define("BILDHOEHESEITE","1024"); //Bildbreite Seite define("BILDBREITESEITE","1024"); //Bilhoehe Seite define("BILDBREITE1","768"); //Bildbreite1 define("BILDHOEHE1","1024"); //Bilhoehe1 define("BILDBREITE2","200"); //Bildbreite2 define("BILDHOEHE2","200"); //Bilhoehe2 define("BILDHOEHEPRODUKT","2048"); //BILDHOEHEPRODUKT define("BILDBREITEPRODUKT","2048"); //BILDBREITEPRODUKT define("BILDHOEHEKATEGORIE","200"); //BILDHOEHEKATEGORIE define("BILDBREITEKATEGORIE","200"); //BILDBREITEKATEGORIE define("BILDHOEHEGALLERIE","1024"); //BILDHOEHEGALLERIE define("BILDBREITEGALLERIE","768"); //BILDBREITE GALLERIE define("BILDHOEHEFLAGALLERIE","200"); //BILDHOEHEGALLERIE define("BILDBREITEFLAGALLERIE","200"); //BILDBREITE GALLERIE define("BILDHOEHEGALLERIETHUMB1","21"); //BILDHOEHEGALLERIE define("BILDHOEHEGALLERIETHUMB2","50"); //BILDBREITE GALLERIE define("BILDHOEHEFORMULAR","240"); //BILDHOEHEFORMULAR define("BILDBREITEFORMULAR","250"); //BILDBREITEFORMULAR define("CONTENTCONTAINERMINSCROLL","'100px'"); //Minimale Scrollhöhe bei artikel.php (seiten) wenn umleitung aktiviert define("CONTENTCONTAINERMAXSCROLL","'auto'"); //MAximale Scrollhöhe bei artikel.php (seiten) wenn keine umleitung aktiviert define("MODUSAFTERSAVE","start"); //Modus nach speichern der Daten (start) //------------------------------------------------------------- //--------------- Module / Features --------------------------- //------------------------------------------------------------- define("MODFOOTER",true); define("MODNEWS",true); define("MODTERMINE",false); define("MODSPECIALS",false); define("MODBLOG",false); define("MODBANNER",true); define("MODFLASHGAL",true); define("MODSPRACHEN",true); define("MODUSERADMIN",true); define("MODNAV2",true); define("MODKATEGORIE",true); define("MODTAGCLOUD",false); define("MODGALERY",true); define("MODCROSSLINKS",false); define("MODSITEMAP",true); define("MODSHOP",false); //------------------------------------------------------------- //------------------ Pfade ------------------------------------ //------------------------------------------------------------- $dbname=$db; $styleRoot="../styles/"; $flashPfad="flash/"; $styleFolder=$styleRoot.$session->userStyle."/"; $styleImgFolder=$styleFolder."img/"; $styleCSSFolder=$styleFolder."css/css.css"; $homeRelative="../../"; $homeDir="../"; $imgZielPfad=$homeRelative."img/"; $bannerZielPfad=$homeRelative."upload/banner/"; $pfadGalXML=$homeRelative."xml/"; $cmsRoot=$webroot."cms/index.php"; $imgPfadRel="../tmp/"; $ressourcePfadRel="../tmp/"; $ftpUploadRelativ="../../upload/"; $ftpUploadRelativ2=$ftpUploadRoot; $ftpUpload="upload/"; $fileZielPfad="../../upload/"; $ressourceZielPfad="../../resources/"; //------------------------------------------------------------- //------------------ Header ----------------------------------- //------------------------------------------------------------- $titel="RedaktionPlus @ ".$_SERVER["HTTP_HOST"]; $css=''; $cssAdmin=''; $doctype=''; $errorStyle="color:#ff0000;"; $adminTXT="admin"; ?>db_com_open(); $this->db_com_select_db($this->db); } function db_com_open() { if($this->db_status != "connected") { if(!($this->connectid = mysql_connect($this->host, $this->user, $this->password))) { $this->db_status = "disconnected"; $this->errormessage = mysql_error(); $this->errornumber = mysql_errno(); return 0; } else { mysql_query("SET NAMES 'utf8'"); mysql_query("SET CHARACTER SET 'utf8'"); $this->db_status = "connected"; return 1; } } else { return 0; } } function db_com_select_db($dbname) { if($this->db_status == "connected") { if(!mysql_select_db($dbname)) { $this->errormessage = mysql_error(); $this->errornumber = mysql_errno(); return 0; } else { return 1; } } else { return 0; } } function db_com_query($query) { if($this->db_status == "connected") { if(!$this->result = mysql_query($query)) { $this->errormessage = mysql_error(); $this->errornumber = mysql_errno(); return 0; } else { if(substr($query, 0, 4) == "SELE") { $this->result_number = mysql_num_rows($this->result); return 1; } else { return 0; } } } } function db_com_query2($query){ if($this->db_status == "connected") { $this->result2 = mysql_query($query); return 1; } } function dbreturnID($query) { if($this->db_status == "connected") { $this->db_com_open(); if(!$this->result = mysql_query($query)) { $this->errormessage = mysql_error(); $this->errornumber = mysql_errno(); return 0; } else { $this->returnId = mysql_insert_id(); } } return $this->returnId; } function db_count_query($query) { if($this->db_status == "connected") { if(!$this->result = mysql_query($query)) { $this->errormessage = mysql_error(); $this->errornumber = mysql_errno(); return 0; } else { $this->anzahl=mysql_num_rows($this->result); } } return $this->anzahl; } function db_com_get_next_result() { if(!$this->result) { $this->errormessage = "Result is empty."; $this->errornumber = 99; return 0; } else { return mysql_fetch_array($this->result); } } function db_com_get_last_error() { return ($this->errornumber . " : " . $this->errormessage); } function db_com_close() { if($this->db_status == "connected") { if(!@mysql_close($this->connectid)) { $this->errornumber = mysql_errno(); $this->errormessage = mysql_error(); return 0; } else { $this->db_status = "disconnected"; return 1; } } else { return 0; } } function getLangDetails($id) { if(empty($id)) $id=1; if(!$this->db_com_query("SELECT * FROM sprachen where id =".$id)) return false; while($result = $this->db_com_get_next_result()) { $_SESSION['langFlag']=$result['flag']; $_SESSION['langKuerzel']=$result['kuerzel']; $_SESSION['langTitel']=$result['titel']; } } } ?> Berabeitet Title für Clean URL --------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function editTitleFE($param){ $param=str_replace(" ","-",$param); $param=str_replace("/","-",$param); $param=str_replace("ö","oe",$param); $param=str_replace("ä","ae",$param); $param=str_replace("ü","oe",$param); $param=str_replace("Ö","Oe",$param); $param=str_replace("Ä","Ae",$param); $param=str_replace("Ü","Ue",$param); $param=str_replace("ß","ss",$param); $param=str_replace(" ","-",$param); return $param; } function editFEText($param,$rootFolder){ $param= str_replace('"/img/','"img/',str_replace("../../img",$rootFolder."/img",$param)); return $param; } function returnRootFolder($fold){ $ref = $_SERVER['REQUEST_URI']; $ziel=explode("/",$ref); $pos=count($ziel)-$fold; for ($i=2;$i < $pos;$i++){$returnValue.="../";} return $returnValue; } //-------------------------------------------------------------------------------------------------------------- //getOwner from table -> ----------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function getOwner($param){ $db=new DbCon; unset($this->datasetArr); $i=0; if(!$db->db_com_query("SELECT distinct owner FROM ".$param)) return false; while($result = $db->db_com_get_next_result()) { $this->datasetArr[$i][0]=$result['owner']; $i++; } $db->db_com_close(); $this->dArr=$i; if($i==0) return false; else return true; } function getUSer($param){ $db=new DbCon; unset($this->datasetArr); $i=0; if(!$db->db_com_query("SELECT * FROM users ".$param)) return false; while($result = $db->db_com_get_next_result()) { $this->datasetArr[$i][1]=$result['username']; $this->datasetArr[$i][0]=$result['id']; $i++; } $db->db_com_close(); $this->dArr=$i; if($i==0) return false; else return true; } function getOwner2($param) { $db=new DbCon; unset($this->datasetArr); $i=0; if(!$db->db_com_query("SELECT distinct userId FROM ".$param)) return false; while($result = $db->db_com_get_next_result()) { $this->datasetArr[$i][0]=$result['userId']; $i++; } $db->db_com_close(); $this->dArr=$i; if($i==0) return false; else return true; } function getOwnerById($param){ $db=new DbCon; if(!$db->db_com_query("SELECT username FROM users where id='".$param."'")) return false; while($result = $db->db_com_get_next_result()) { $uname=$result['username']; $i++; } $db->db_com_close(); return $uname; } /* * 301 Seiten prüfen und verarbeiten */ function isPermantlyMoved($aktSegment){ $db=new DbCon; $i=0; if(!$db->db_com_query("SELECT * FROM cleanUrl_permanently_moved where cleanUrl='" . mysql_real_escape_string($aktSegment) . "'")) return false; while($result = $db->db_com_get_next_result()) { $this->datasetArr[$i][0]=$result['id']; $i++; } $db->db_com_close(); $this->dArr=$i; if($i==0) return false; else return true; } function load301Target($aktSegment) { $db=new DbCon; if(!$db->db_com_query("SELECT * FROM cleanUrl_permanently_moved where cleanUrl='" . mysql_real_escape_string($aktSegment) . "'")) return false; while($result = $db->db_com_get_next_result()) { $returnVal = $result['cleanUrlNewTarget']; $i++; } $db->db_com_close(); return $returnVal; } //-------------------------------------------------------------------------------------------------------------- //Bild löschen -------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function deleteImage($tabellenname,$datensatzId){ $db=new DbCon; if(!$db->db_com_query("update ".$tabellenname." set bild='' where id =".$datensatzId)) { $db->db_com_close(); return false; } $db->db_com_close(); return true; } function updateBookmark($username, $bookmark){ $db=new DbCon; if(!$db->db_com_query("update users set home='". $bookmark."' where username ='".$username."'")) { $db->db_com_close(); return false; } $db->db_com_close(); return true; } //-------------------------------------------------------------------------------------------------------------- //File Prüfungen ----------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function getImgInfo($url){ $imgsize=@getimagesize($url); //$info.=str_replace("../../",$_SERVER['HTTP_HOST'],$url)." - "; $info.=$imgsize[3]." "; $groesse=" ".@filesize($url); if($groesse < 1000) { $info.=number_format($groesse, 0, ",", ".")." Bytes"; } elseif($groesse < 1000000) { $info.=number_format($groesse/1024, 2, ",", ".")." kB"; } else { $info.=number_format($groesse/1048576, 2, ",", ".")." MB"; } return $info; } function checkBild ($b,$h,$url) { $imgsize=getimagesize($url); $hoehe=$imgsize[1]; $ext=$imgsize[2]; $breite=$imgsize[0]; if ( $h<$hoehe || $b<$breite ) { return false; } else { return true; } } function checkBildExact ($b,$h,$url) { $imgsize=getimagesize($url); $hoehe=$imgsize[1]; $ext=$imgsize[2]; $breite=$imgsize[0]; if ( $h!=$hoehe || $b!=$breite ) { return false; } else { return true; } } function checkBildRel ($h,$b,$url) { $imgsize=getimagesize($url); $hoehe=$imgsize[1]; $breite=$imgsize[0]; if ( $hoehe>$h || $breite>$b ) { return false; } else { return true; } } function checkExt ($url) { $imgsize=getimagesize($url); $ext=$imgsize[2]; if ( $ext!=1 && $ext!=2 && $ext!=3 ) { return false; } else { return true; } } //--------------------------------------------------------- function drawImgTable ($imgFolder, $img, $tfBezeichnung){ $st=""; $imgInfo=$this->getImgInfo($img); $ext = substr($img, -3, 3); if($ext!="swf"){ $imgsize=getimagesize($img); if($imgsize[0]>400){ $breite=400; $hoehe=round($imgsize[1]/($imgsize[0]/$breite)); $st="style='width:".$breite."px; height:".$hoehe."px;'"; } } $ff=($ext!="swf") ? "" : ""; $myTable="
"; $myTable.='
'; $myTable.=""; $myTable.='
'; $myTable.="
"; $myTable.='
'; $myTable.=""; $myTable.='
Neues Bild:
'; return $myTable; } //-------------------------------------------------------------------------------------------------------------- //resize Image -> NEU Version 2.0 !!!--------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function resizeImage($imgPfadRel,$pic,$hoehe2,$breite2, $quality, $imgPfadRel2){ $groesse=getimagesize($imgPfadRel.$pic); $typ=$groesse[2]; $breite=$groesse[0]; $hoehe=$groesse[1]; $thumbNameZusatz=""; if($quality=="x"){$quality=100;$thumbNameZusatz="2_";} if($hoehe>$breite){//Hochvormat $t=$hoehe/$hoehe2; $breite2=$breite/$t; }else{ $t=$breite/$breite2; $hoehe2=round($hoehe/$t); } $image1 = imagecreatetruecolor($breite2, $hoehe2); switch ($typ) { case 1: $image = imagecreatefromgif($imgPfadRel.$pic); imagecopyresized($image1, $image, 0,0, 0,0,$breite2,$hoehe2,$breite,$hoehe); break; case 2: $image = imagecreatefromjpeg($imgPfadRel.$pic); imagecopyresampled($image1, $image, 0, 0, 0, 0, $breite2,$hoehe2,$breite,$hoehe); break; case 3: $image = imagecreatefrompng($imgPfadRel.$pic); imagecopyresized($image1, $image, 0,0, 0,0,$breite2,$hoehe2,$breite,$hoehe); break; case 4: $image = imagecreatefromwbmp($imgPfadRel.$pic); imagecopyresized($image1, $image, 0,0, 0,0,$breite2,$hoehe2,$breite,$hoehe); break; default: $gestorben="ja"; } switch ($typ) { case 1: imagegif($image1,$imgPfadRel2."thumb_".$thumbNameZusatz.$pic); break; case 2: imagejpeg($image1, $imgPfadRel2."thumb_".$thumbNameZusatz.$pic, $quality); break; case 3: imagepng($image1,$imgPfadRel2."thumb_".$thumbNameZusatz.$pic); break; case 4: imagewbmp($image1,$imgPfadRel2."thumb_".$thumbNameZusatz.$pic); break; default: $gestorben="ja"; } @chmod($imgPfadRel2."thumb_".$thumbNameZusatz.$pic,0777); } //-------------------------------------------------------------------------------------------------------------- //Mailprüfung -------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function checkmail($email){ if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {$i=false;} else {$i=true;} return $i; } function check_email($email) // Checkt, ob Emails gültig sind { $nonascii = "\x80-\xff"; # Non-ASCII-Chars are not allowed $nqtext = "[^\\\\$nonascii\015\012\"]"; $qchar = "\\\\[^$nonascii]"; $protocol = '(?:mailto:)'; $normuser = '[a-zA-Z0-9][a-zA-Z0-9_.-]*'; $quotedstring = "\"(?:$nqtext|$qchar)+\""; $user_part = "(?:$normuser|$quotedstring)"; $dom_mainpart = '[a-zA-Z0-9][a-zA-Z0-9._-]*\\.'; $dom_subpart = '(?:[a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*'; $dom_tldpart = '[a-zA-Z]{2,5}'; $domain_part = "$dom_subpart$dom_mainpart$dom_tldpart"; $regex = "$protocol?$user_part\@$domain_part"; // RegEx end return preg_match("/^$regex$/",$email); } //-------------------------------------------------------------------------------------------------------------- //Diverse Funktionen -------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function checkinput($cvalue,$cmethod) { switch($cmethod) { # texteingabe prüfen - alle eingaben auf leere eingaben prüfen case 'text': $cvalue=trim($cvalue); if ($cvalue!='') { return true; } else { return false; } break; # auf nur zahlen prüfen case 'numbers': if (preg_match("#^[0-9]+$#",$cvalue)) { return true; } else { return false; } break; # auf telefonnummer prüfen mit min. 6 zahlen case 'telnumbers': if (preg_match("#^[ 0-9\/-]{6,}+$#",$cvalue)) { return true; } else { return false; } break; # auf nur buchstaben prüfen case 'letter': if (preg_match("/^[ a-za-zäöüß]+$/i",$cvalue)) { return true; } else { return false; } break; # auf nur ein wort prüfen case 'word': if (preg_match("/^[a-za-zäöüß]+$/i",$cvalue)) { return true; } else { return false; } break; # auf deutsche postleitzahl prüfen case 'plz': if (preg_match("/^[0-9]{5}$/",$cvalue)) { return true; } else { return false; } break; # url prüfen case 'url': $cvalue=trim($cvalue); if (preg_match("#^(http|https)+(://www.)+([a-z0-9-_.]{2,}\.[a-z]{2,4})$#i",$cvalue)) { return true; } else { return false; } break; # nur email-alias prüfen case 'alias': $cvalue=trim($cvalue); if (strpos($cvalue,"@")) { return false; } if ($cvalue!='') { $_pat="^[_a-za-z0-9-]+(.[_a-za-z0-9-]+)$"; if (!preg_match("|$_pat|i",$cvalue)) { return false; } else { return true; } } else { return false; } break; # email-domain prüfen case 'emaildomain': $cvalue=trim($cvalue); if (strpos($cvalue,"@")) { return false; } if ($cvalue!='') { $_pat="^([a-z0-9-]{3,})+.([a-za-z]{2,4})$"; if (!preg_match("|$_pat|i",$cvalue)) { return false; } else { return true; } } else { return false; } break; # auf datum prüfen case 'date': if (preg_match("/^([0-9]{1,2}).([0-9]{1,2}).([0-9]{2,4})$/i",$cvalue)) { return true; } else { return false; } break; } } //--------------------------------------------------------------------------------------------------------------- // CrossLinks --------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------- function loadCrossLinks($id,$sourceTabName){ $db=new DbCon; if(!$db->db_com_query("SELECT * FROM crossLink where sourceTableName='".$sourceTabName."' and rootId=".$id." order by position")) return false; $i=0; while($result = $db->db_com_get_next_result()) { $res[$i][0]=$result["tableName"]; $res[$i][1]=$result["refId"]; $res[$i][2]=$result["rootId"]; $db2 = new DbCon; $db2->db_com_query("SELECT * FROM ".$result["tableName"]." where id=".$result["refId"]); while($subResult = $db2->db_com_get_next_result()) { $res[$i][3]=$subResult["titel"]; } $db2->db_com_close(); $i++; } $db->db_com_close(); return $res; } //CrossLinks Speichern function saveCrossLinks($crossLinkSet,$sourceTableName) { $db=new DbCon; $crossLinks = explode(";",$crossLinkSet); //Alte Crosslinks aus Datenbank löschen for($i=0;$idb_com_query($query); } } for($i=0;$idb_com_query($query); } $db->db_com_close(); } //--------------------------------------------------------------------------------------------------------------- // Pfade ------------------------------------------------------------------------------------------------------ //--------------------------------------------------------------------------------------------------------------- function getRelativeURL($realUrl,$rootFolder) { $url=$realUrl; $url=str_replace("http://","",$url); $url=str_replace("www.","",$url); $url=str_replace($_SERVER["HTTP_HOST"],"",$url); if(!strstr($url,$rootFolder)) $url="../../".$url; else $url=str_replace($rootFolder,"../../",$url); return $url; } function cleanPathes($text,$rootSubFolder) { $text=str_replace('../../',"http://".$_SERVER["HTTP_HOST"]."/".$rootSubFolder,$text); return $text; } //-------------------------------------------------------------------------------------------------------------- //Sonstige Hilfsfunktionen ------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- //Prüfen auf eindeutiges und gültiges cleanUrlSegment //liefert true wenn gültig und nicht bereits vorhanden function checkCleanUrlSegment($modulId, $id, $cleanUrlSegment) { $res=true; if (ereg("^[A-Za-z0-9_-]+$",$cleanUrlSegment) == true) { $db=new DbCon; $query="SELECT cleanUrlSegment FROM ".$_SESSION['langKuerzel']."cleanUrl where modulId='".$modulId."' and fremdId<>".$id.""; $db->db_com_query($query); while($result = $db->db_com_get_next_result()) { if($result['cleanUrlSegment']==$cleanUrlSegment) { $res=false; } } $db->db_com_close(); } else { $res=false; } return $res; } //Liefert die ModulId zu einem bestimmten URL Segment function getModulByUrlSegment($cleanUrlSegment) { $db=new DbCon; $res=false; $query="SELECT modulId FROM ".$_SESSION['langKuerzel']."cleanUrl where cleanUrlSegment='".mysql_real_escape_string($cleanUrlSegment)."'"; $db->db_com_query($query); while($result = $db->db_com_get_next_result()) { $res=$result['modulId']; } $db->db_com_close(); return $res; } //Liefert die ModulId zu einem bestimmten URL Segment function getModulByUrlSegmentFromSeiten($cleanUrlSegment) { $db=new DbCon; $res=false; $query="SELECT s.modulId FROM ".$_SESSION['langKuerzel']."seiten s join ".$_SESSION['langKuerzel'].".cleanUrl c on s.id=c.fremdId where c.cleanUrlSegment='".mysql_real_escape_string($cleanUrlSegment)."'"; $db->db_com_query($query); while($result = $db->db_com_get_next_result()) { $res=$result['modulId']; } $db->db_com_close(); return $res; } //Liefert die fremdId zu einem bestimmten URL Segment function getIdByUrlSegment($cleanUrlSegment) { $db=new DbCon; $res=false; $query="SELECT fremdId FROM ".$_SESSION['langKuerzel']."cleanUrl where cleanUrlSegment='".mysql_real_escape_string($cleanUrlSegment)."'"; $db->db_com_query($query); while($result = $db->db_com_get_next_result()) { $res=$result['fremdId']; } $db->db_com_close(); return $res; } //Liefert das URL Segment zu einer ModulId function getUrlSegmentByModul($mid) { $db=new DbCon; $res=false; $query="SELECT cleanUrlSegment FROM ".$_SESSION['langKuerzel']."cleanUrl cu join ".$_SESSION['langKuerzel']."seiten s on cu.fremdId=s.id where s.modulId='".mysql_real_escape_string($mid)."' and cu.modulId='0'"; $db->db_com_query($query); while($result = $db->db_com_get_next_result()) { $res=$result['cleanUrlSegment']; } $db->db_com_close(); return $res; } //Prüfung auf gültige URL function checkURL($requestURL, $rootfolder) { $requestURL = str_replace($rootfolder,"",$requestURL); $urlArr = explode("/", $requestURL); unset($urlArr[0]); //ersten leerwert entfernen $db=new DbCon; $res=true; $query="SELECT * FROM ".$_SESSION['langKuerzel']."cleanUrl where cleanUrlSegment='".mysql_real_escape_string($urlArr[count($urlArr)])."'"; if($db->db_count_query($query) <1) $res=false; /*foreach ($urlArr as $value) { $query="SELECT * FROM ".$_SESSION['langKuerzel']."cleanUrl where cleanUrlSegment='".$value."'"; if($db->db_count_query($query) <1) $res=false; }*/ return $res; } //Ermittelt Rekursiv die Oberste ID (Ebene 0) der aktuellen Seite function getTopId($currentPageId) { $errorController = new ErrorController; $seiten = new Seiten; $seiten->load($currentPageId); if(!empty($seiten->parentId) && $seiten->parentId!=0 && $seiten->parentId!=-1) { $this->topId = $this->getTopId($seiten->parentId);//Rekursiver Funktionsaufruf } else { $this->topId=$seiten->id; } return $this->topId; } //Ermittelt Rekursiv die Oberste ID (Ebene 0) des aktuellen Moduls function getTopIdByModul($currentModulId) { $errorController = new ErrorController; $seiten = new Seiten; $param = " and seiten.modulId='".$currentModulId."' and seiten.parentId=0 and seiten.aktiv=1 and seiten.verbergen=0 "; $seiten->loadAll($param); if($seiten->dArr>0) { foreach($seiten->datasetArr as $value) { $topId=$value['id']; } } return $topId; } } ?>table." where fremdId=" . $fremdId . " and tabelle='" . $tabelle . "' and nr=" . $nr; if(!$db->db_com_query($query)) return false; while($result = $db->db_com_get_next_result()) { $text = stripslashes($result['text']); } return $text; } function checkds ($fremdId, $tabelle, $nr, $db) { $returnValue = false; $query="SELECT text FROM ".$_SESSION['langKuerzel'].$this->table." where fremdId=" . $fremdId . " and tabelle='" . $tabelle . "' and nr=" . $nr; if(!$db->db_com_query($query)) return false; while($result = $db->db_com_get_next_result()) { $returnValue = true; } return $returnValue; } //-------------------------------------------------------------------------------------------------------------- //Löschen ------------------------------------------------------------------------------------------------------ //-------------------------------------------------------------------------------------------------------------- function deleteObj($navigationId) { if ($this->id!=0) { $db=new DbCon; //Löschen $db->db_com_query("delete from ".$_SESSION['langKuerzel'].$this->table." where id=".$this->id); $db->db_com_close(); return true; } else { return false; } } //-------------------------------------------------------------------------------------------------------------- //Speichern ---------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function save($fremdId, $tabelle, $nr, $text, $db) { if(!$this->checkds ($fremdId, $tabelle, $nr, $db)) $typ="insert"; if ($typ=="insert") { $this->id=$db->dbreturnID("Insert into ".$_SESSION['langKuerzel'].$this->table." (datum, text, fremdId, tabelle, nr) values ('".time()."','".mysql_real_escape_string($text)."', '".mysql_real_escape_string($fremdId)."', '".mysql_real_escape_string($tabelle)."' ,'".mysql_real_escape_string($nr)."')"); } else { $query="update ".$_SESSION['langKuerzel'].$this->table." set " ."text='".mysql_real_escape_string($text)."' " ." where fremdId=" . $fremdId . " and tabelle='" . $tabelle . "' and nr=" . $nr; $db->db_com_query($query); } } //-------------------------------------------------------------------------------------------------------------- //Objekt füllen --------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function fillObject() { } } ?> clear(); } function load ($id) { $db=new DbCon; if(!$db->db_com_query("SELECT titel, standartsprache, kuerzel, charset, id, bild, aktiv, flag, position, kuerzel FROM sprachen where id =".$id)) return false; while($result = $db->db_com_get_next_result()) { $this->titel=ucfirst(stripslashes($result[0])); $this->kuerzel=stripslashes($result['kuerzel']); $this->charset=stripslashes($result['charset']); $this->id=stripslashes($result['id']); $this->flag=stripslashes($result['flag']); $this->standartsprache=stripslashes($result['standartsprache']); $this->bild=stripslashes($result['bild']); $this->aktiv=stripslashes($result['aktiv']); $this->position=stripslashes($result['position']); $this->isEdit=true; $db->db_com_close(); } return true; } function loadAll ($param) { $db=new DbCon; unset($this->datasetArr); $i=0; if(!$db->db_com_query("SELECT * FROM ".$this->table.$param)) return false; while($result = $db->db_com_get_next_result()) { $this->datasetArr[$i][0]=$result['id']; $this->datasetArr[$i][1]=stripslashes($result['titel']); $this->datasetArr[$i][2]=stripslashes($result['datum']); $this->datasetArr[$i][3]=stripslashes($result['bild']); $this->datasetArr[$i][4]=stripslashes($result['teaser']); $this->datasetArr[$i][5]=stripslashes($result['charset']); $this->datasetArr[$i][6]=stripslashes($result['aktiv']); $this->datasetArr[$i][7]=stripslashes($result['kuerzel']); $this->datasetArr[$i][8]=(!empty($result['datum'])) ? "" : "-"; $this->datasetArr[$i][9]=stripslashes($result['flag']); $this->datasetArr[$i][10]=stripslashes($result['position']); $this->datasetArr[$i][11]=stripslashes($result['standartsprache']); $i++; } $this->dArr=$i; if($i==0) return false; else return true; } function deleteObj() { $db=new DbCon; if ($this->id!=0) { $db->db_com_query("select id from ".$this->table." where position > ".$this->position); while($result = $db->db_com_get_next_result()) { $query="update ".$this->table." set position=position-1 where id='".$result['id']."'"; mysql_query($query); } $db->db_com_query("delete from sprachen where id=".$this->id); $this->deleteTables(); return true; } else { return false; } $db->db_com_close(); } function deleteTables(){ $db=new DbCon; for ($i=0;$itblArr);$i++){ $mysql="DROP TABLE ".$this->kuerzel.$this->tblArr[$i]; $db->db_com_query($mysql); } $mysql="DELETE FROM sprachen where kuerzel='".$this->kuerzel."'"; $db->db_com_query($mysql); @unlink("../../header/header_".$this->kuerzel.".php"); $db->db_com_close(); } function save() { $db=new DbCon; if(!empty($this->kuerzel)) { if ($this->id==-1) { $this->dump_tables($db); $nextPos=1; $db->db_com_query("select position from ".$this->table." order by position desc limit 0,1 "); while($result = $db->db_com_get_next_result()) {$nextPos=$result['position']+1;} $this->id=$db->dbreturnID("Insert into ".$this->table." (datum, position) values ('".time()."','".$nextPos."')"); } if($this->id==1)$this->kuerzel=""; //reset für basis sprache $sql="update sprachen " ."set titel='".mysql_real_escape_string($this->titel)."', " ."kuerzel='".mysql_real_escape_string($this->kuerzel)."', " ."charset='".mysql_real_escape_string($this->charset)."', " ."standartsprache='".mysql_real_escape_string($this->standartsprache)."', " ."flag='".mysql_real_escape_string($this->flag)."', " ."bild='".mysql_real_escape_string($this->bild)."', " ."aktiv='".mysql_real_escape_string($this->aktiv)."' where id=".mysql_real_escape_string($this->id); $db->db_com_query($sql); if($this->id!=1) $this->generateHeader(); } $db->db_com_close(); } function dump_tables($db) { for ($i=0;$itblArr);$i++){ $mysql="CREATE TABLE ".$this->kuerzel.$this->tblArr[$i]." SELECT * FROM ".$this->tblArr[$i]; $db->db_com_query($mysql); $mysql="ALTER TABLE `".$this->kuerzel.$this->tblArr[$i]."` CHANGE `id` `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY"; $db->db_com_query($mysql); } } function generateHeader(){ $pfad="../../header/"; $daten="charset."');?>"; $myfile = "header_".$this->kuerzel.".php"; $datei = fopen ($pfad.$myfile,"w+b"); chmod($pfad.$myfile,0777); fwrite ($datei, $daten); } function fillObject() { if ($_POST["id"]!=-1) { $this->load($_POST["id"]); $this->id=$_POST["id"]; } $this->bild=$_POST['picName']; if($this->altesBild!="back")$this->altesBild=$_POST['picName']; $this->titel=$_POST["titel"]; $this->charset=$_POST["charset"]; $this->flag=$_POST["flag"]; $this->kuerzel= $_POST["kuerzel"]; $this->aktiv=($_POST["aktiv"]=="1") ? "1" : "0"; $this->standartsprache=($_POST["standartsprache"]=="1") ? "1" : "0"; if ($_POST["id"]==-1) { $this->kuerzelCheck = true; if(!$this->checkKuerzel($_POST["kuerzel"])) $this->kuerzelCheck = false; } } function checkKuerzelDblEntry($kuerzel) { //checken ob Kuerzel schon benutzt wird $db = new DbCon; $c = $db->db_count_query("select position from ".$this->table." where kuerzel='" . $kuerzel . "'"); return $c; } function checkKuerzel($kuerzel) { if (preg_match("#^[a-z]+$#i",$kuerzel)) { $returnVal = true; }else{ $returnVal = false; } return $returnVal; } //-------------------------------------------------------------------------------------------------------------- //Position up/down --------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function positionDown($id){ $v=0; $db=new DbCon; $id=mysql_real_escape_string($id); if(!$db->db_com_query("SELECT position FROM ".$this->table." where id =".$id)) return false; while($result = $db->db_com_get_next_result()) { $aktPos=$result['position']; } if(!$db->db_com_query("SELECT id FROM ".$this->table." where position >".$aktPos." order by position asc")) return false; while($result = $db->db_com_get_next_result()) { if($v==0){ $query="update ".$this->table." set position=position-1 where id=".$result['id']; mysql_query($query); } $v++; } $query="update ".$this->table." set position=position+1 where id=".$id; mysql_query($query); $db->db_com_close(); } function positionUp($id){ $v=0; $db=new DbCon; $id=mysql_real_escape_string($id); if(!$db->db_com_query("SELECT position FROM ".$this->table." where id =".$id)) return false; while($result = $db->db_com_get_next_result()) { $aktPos=$result['position']; } if(!$db->db_com_query("SELECT id FROM ".$this->table." where position <".$aktPos." order by position desc")) return false; while($result = $db->db_com_get_next_result()) { if($v==0){ $query="update ".$this->table." set position=position+1 where id=".$result['id']; mysql_query($query); } $v++; } $query="update ".$this->table." set position=position-1 where id=".$id; mysql_query($query); $db->db_com_close(); } function clear() { $this->titel=""; $this->aktiv=0; $this->kuerzel=""; $this->id=-1; $this->bild=""; $this->charset=""; $this->isEdit=false; } function returnExtension($ext) { $rext=""; if($ext == 1) { $rext="gif"; } elseif($ext == 2) { $rext="jpg";; } elseif($ext == 3) { $rext="png"; } return $rext; } } $sprache=new Sprachen; ?> clear(); } //-------------------------------------------------------------------------------------------------------------- //Load Methoden ------------------------------------------------------------------------------------------------ //-------------------------------------------------------------------------------------------------------------- function load ($id) { $db=new DbCon; $contents = new Contents; $lib = new Lib; $query="SELECT * FROM ".$_SESSION['langKuerzel'].$this->table." where id=".$id; if(!$db->db_com_query($query)) return false; while($result = $db->db_com_get_next_result()) { $this->id=stripslashes($result['id']); $this->navigationId=stripslashes($result['navigationId']); $this->navigationIdOld=$this->navigationId; $this->modulId=stripslashes($result['modulId']); $this->kategorieId=stripslashes($result['kategorieId']); $this->parentId=stripslashes($result['parentId']); $this->parentIdOld=$this->parentId; $this->datum=(!empty($result['datum'])) ? date("d:m:Y",$result['datum']) : ""; $this->position=stripslashes($result['position']); $this->titel=stripslashes($result['titel']); $this->text=stripslashes($result['text']); $this->text2=stripslashes($result['text2']); $this->seitenTitel=stripslashes($result['seitenTitel']); $this->teaser=stripslashes($result['teaser']); $this->description=stripslashes($result['description']); $this->bild=stripslashes($result['bild']); $this->galerieId=stripslashes($result['galerieId']); $this->aktiv=stripslashes($result['aktiv']); $this->verbergen=stripslashes($result['verbergen']); $this->startseite=stripslashes($result['startseite']); $this->weiterleitung=stripslashes($result['weiterleitung']); $this->slideshow=stripslashes($result['slideshow']); $this->owner=stripslashes($result['owner']); $this->requireLogin=stripcslashes($result['requireLogin']); $this->template=stripslashes($result['template']); $this->noindex=stripslashes($result['noindex']); $this->nofollow=stripslashes($result['nofollow']); $this->nocashe=stripslashes($result['nocashe']); $this->modultopeintrag=stripslashes($result['modultopeintrag']); for ($x=1;$x<=$lib->anzahlContents; $x++){ $this->content[$x]=$contents->load($this->id, $this->table, $x, $db); } } //CleanUrlSegment laden $query="SELECT * FROM ".$_SESSION['langKuerzel']."cleanUrl where fremdId=".$id." and modulId=".$this->cleanUrlSegmentModulId; $db->db_com_query($query); while($result = $db->db_com_get_next_result()) { $this->cleanUrlSegment=$result['cleanUrlSegment']; } $db->db_com_close(); } function loadAll ($param) { $db=new DbCon; unset($this->datasetArr); $i=0; $query="SELECT ".$_SESSION['langKuerzel'].$this->table.".*,".$_SESSION['langKuerzel']."cleanUrl.cleanUrlSegment FROM ".$_SESSION['langKuerzel'].$this->table." left outer join ".$_SESSION['langKuerzel']."cleanUrl on ".$_SESSION['langKuerzel'].$this->table.".id=".$_SESSION['langKuerzel']."cleanUrl.fremdId where ".$_SESSION['langKuerzel']."cleanUrl.modulId=".$this->cleanUrlSegmentModulId." ".$param; if(!$db->db_com_query($query)) return false; while($result = $db->db_com_get_next_result()) { $this->datasetArr[$i]['id']=$result['id']; $this->datasetArr[$i]['navigationId']=$result['navigationId']; $this->datasetArr[$i]['modulId']=stripslashes($result['modulId']); $this->datasetArr[$i]['kategorieId']=stripslashes($result['kategorieId']); $this->datasetArr[$i]['parentId']=stripslashes($result['parentId']); $this->datasetArr[$i]['datum']=stripslashes($result['datum']); $this->datasetArr[$i]['datumLabel']=(!empty($result['datum'])) ? "" : "-"; $this->datasetArr[$i]['position']=stripslashes($result['position']); $this->datasetArr[$i]['titel']=stripslashes($result['titel']); $this->datasetArr[$i]['seitenTitel']=stripslashes($result['seitenTitel']); $this->datasetArr[$i]['cleanUrlSegment']=stripslashes($result['cleanUrlSegment']); $this->datasetArr[$i]['teaser']=stripslashes($result['teaser']); $this->datasetArr[$i]['description']=stripslashes($result['description']); $this->datasetArr[$i]['text']=stripslashes($result['text']); $this->datasetArr[$i]['text2']=stripslashes($result['text2']); $this->datasetArr[$i]['bild']=stripslashes($result['bild']); $this->datasetArr[$i]['galerieId']=stripslashes($result['galerieId']); $this->datasetArr[$i]['aktiv']=stripslashes($result['aktiv']); $this->datasetArr[$i]['verbergen']=stripslashes($result['verbergen']); $this->datasetArr[$i]['startseite']=stripslashes($result['startseite']); $this->datasetArr[$i]['weiterleitung']=stripslashes($result['weiterleitung']); $this->datasetArr[$i]['slideshow']=stripslashes($result['slideshow']); $this->datasetArr[$i]['owner']=stripslashes($result['owner']); $this->datasetArr[$i]['requireLogin']=stripslashes($result['requireLogin']); $this->datasetArr[$i]['noindex']=stripslashes($result['noindex']); $this->datasetArr[$i]['nofollow']=stripslashes($result['nofollow']); $this->datasetArr[$i]['nocashe']=stripslashes($result['nocashe']); $i++; } $db->db_com_close(); $this->dArr=$i; if($i==0) return false; else return true; } function loadStartseite () { $db=new DbCon; if(!$db->db_com_query("SELECT id FROM ".$_SESSION['langKuerzel'].$this->table." where startseite=1")) return false; while($result = $db->db_com_get_next_result()) { $id=stripslashes($result['id']); } $db->db_com_close(); return $id; } function loadAnzSub($id) { $db=new DbCon; $i=0; if(!$db->db_com_query("SELECT id FROM ".$_SESSION['langKuerzel'].$this->table." where parentId=".$id)) return false; while($result = $db->db_com_get_next_result()) { $i++; } $db->db_com_close(); return $i; } function loadSubTitle($id) { $db=new DbCon; if(!$db->db_com_query("SELECT titel FROM ".$_SESSION['langKuerzel'].$this->table." where parentId=".$id." order by position")) return false; while($result = $db->db_com_get_next_result()) { $res.=$result["titel"]." ,"; } $db->db_com_close(); return substr($res, 0, -2); } //-------------------------------------------------------------------------------------------------------------- //SeitenArray (OptionList, Sitemap, ...) ----------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------- function getSiteOptionList($currentNavigationId, $currentParentId, $filter) { $db=new DbCon; $this->siteOptionList = ""; //Navi holen if(!$db->db_com_query("SELECT id, titel, aktiv FROM navigation order by position, titel")) return false; //Haupt Liste für Navigationen erstellen while($result = $db->db_com_get_next_result()) { $selected = ($currentParentId==0 && $currentNavigationId==$result['id']) ? "selected" : ""; $this->siteOptionList.='