".$name."');"; $len = strlen($str); for ($i = 0; $i < $len; $i++) { $hex .= '%'.str_pad(dechex(ord($str[$i])), 2, 0, STR_PAD_LEFT); } return ''; } /*=========================================================================*/ /*========================================================================= * Function Act_ExecuteSQL($SQL) Führt SQL-Befehl aus und gibt das Resultat als Recordset zurück /*-------------------------------------------------------------------------*/ function Act_ExecuteSQL($SQL) { global $DB_SERVER, $DB_USER, $DB_PASS, $DB; $connection = mysql_connect($DB_SERVER,$DB_USER,$DB_PASS); $res = mysql_db_query($DB,$SQL); return $res; mysql_close($connection); } /*=========================================================================*/ /*========================================================================= * Function Act_ScanDir($dir) Sucht Dateien und Verzeichnisse und gibt das Resultat als Array zurück /*-------------------------------------------------------------------------*/ function Act_ScanDir($dir) { $arrfiles = array(); if (is_dir($dir)) { if ($handle = opendir($dir)) { chdir($dir); while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (is_dir($file)) { $arr = Act_ScanDir($file); foreach ($arr as $value) { $arrfiles[] = $dir."/".$value; } } else { $arrfiles[] = $dir."/".$file; } } } chdir("../"); } closedir($handle); } return $arrfiles; } /*=========================================================================*/ /*========================================================================= * Function Act_GetImage($filename) Holt Bild wenn existiert aus Kategorie-Ordner, sonst aus allg. /*-------------------------------------------------------------------------*/ function Act_GetImage($filename) { if ( file_exists($GLOBALS["DocumentRoot"]."images/".$GLOBALS["Fusebox"]["circuit"]."/".$filename) ) { $size = GetImageSize($GLOBALS["DocumentRoot"]."images/".$GLOBALS["Fusebox"]["circuit"]."/".$filename); return "src=\"images/".$GLOBALS["Fusebox"]["circuit"]."/".$filename."\" ".$size["3"]; } elseif ( file_exists($GLOBALS["DocumentRoot"]."images/".$filename) ) { $size = GetImageSize($GLOBALS["DocumentRoot"]."images/".$filename); return "src=\"images/".$filename."\" ".$size["3"]; } else return "src=\"images/pixel.gif\""; } /*=========================================================================*/ /*========================================================================= * Function Act_GetBackgroundImage($filename) Holt Bild wenn existiert aus Sprach-Ordner, sonst aus allg. /*-------------------------------------------------------------------------*/ function Act_GetBackgroundImage($filename) { if ( file_exists($GLOBALS["DocumentRoot"]."images/".$GLOBALS["Fusebox"]["circuit"]."/".$filename) ) { $size = GetImageSize($GLOBALS["DocumentRoot"]."images/".$GLOBALS["Fusebox"]["circuit"]."/".$filename); return "images/".$GLOBALS["Fusebox"]["circuit"]."/".$filename; } elseif ( file_exists($GLOBALS["DocumentRoot"]."images/".$filename) ) { $size = GetImageSize($GLOBALS["DocumentRoot"]."images/".$filename); return "images/".$filename; } else return "images/pixel.gif"; } /*=========================================================================*/ /*========================================================================= * Function Act_GetUploadedImage($filename) Holt hochgeladene Bilder /*-------------------------------------------------------------------------*/ function Act_GetUploadedImage($filename) { if ( file_exists($GLOBALS["ImageDir"].$filename) ) { $size = GetImageSize($GLOBALS["ImageDir"].$filename); return "src=\"download/images/".$filename."\" ".$size["3"]; } else return "src=\"images/pixel.gif\""; } /*=========================================================================*/ /*========================================================================= * Function Act_GetMoviePreview($filename) Holt hochgeladene VorschauBilder /*-------------------------------------------------------------------------*/ function Act_GetMoviePreview($filename) { if ( file_exists($GLOBALS["MovieDir"]."images/".$filename) ) { $size = GetImageSize($GLOBALS["MovieDir"]."images/".$filename); return "src=\"download/movies/gallery/images/".$filename."\" ".$size["3"]; } else return "src=\"images/pixel.gif\""; } /*=========================================================================*/ /*========================================================================= * Function Act_GetRollover($name,$over,$ext,$id) Sucht Bild in Sprach-Ordner und gibt das JS zurück, sonst in allg. /*-------------------------------------------------------------------------*/ function Act_GetRollover($name,$over,$ext,$id) { $filename = $name.$over.".".$ext; if ( file_exists("images/".$filename) || file_exists("../images/".$filename) || file_exists("../../images/".$filename) ) return "javascript:ChangeImg('images/','".$name."','".$over."','".$ext."','".$id."');"; else return "javascript:;"; } /*=========================================================================*/ /*========================================================================= * Function Act_GetFlash($folder,$file,$width,$height,$hex,$loop) Holt eine Flash-Datei und stellt sie dar /*-------------------------------------------------------------------------*/ function Act_GetFlash($folder,$file,$width,$height,$hex,$loop) { if (substr($folder,-1,1) != "/") $folder .= "/"; $flash = ""; $flash .= " "; $flash .= " "; $flash .= " "; $flash .= " "; $flash .= " "; $flash .= " "; $flash .= " "; $flash .= " "; $flash .= ""; return $flash; } /*=========================================================================*/ /*========================================================================= * Function Act_Filesize($filename) Holt Bild wenn existiert aus Sprach-Ordner, sonst aus all /*-------------------------------------------------------------------------*/ function Act_Filesize($filepath) { $size = filesize($GLOBALS["DocumentRoot"]."/".$filepath); $KB = $size/1024; if ($KB < 1000) { return number_format($KB,1,".","'")." KB"; } else { $MB = $KB/1024; return number_format($MB,2,".","'")." MB"; } } /*=========================================================================*/ /*========================================================================= * Function Act_Spacer($width,$height) Holt Bild wenn existiert aus Sprach-Ordner, sonst aus all /*-------------------------------------------------------------------------*/ function Act_Spacer($width,$height) { $line = "\n"; $line .= "\n"; $line .= "
\n"; return $line; } /*=========================================================================*/ /*========================================================================= * Function Act_GetLine($hexcolor) Zieht eine Linie in entsprechender Farbe /*-------------------------------------------------------------------------*/ function Act_GetLine($hexcolor) { $line = "\n"; $line .= "\n"; $line .= "\n"; $line .= "\n"; $line .= "
\n"; return $line; } /*=========================================================================*/ /*========================================================================= * Function Act_GetCSS($path) Formatiert das CSS für die Ausgabe /*-------------------------------------------------------------------------*/ function Act_GetCSS($path) { $css = file($path); foreach($css as $elem) { $elem = str_replace("\r\n","",$elem); $elem = str_replace(" : ",":",$elem); $elem = str_replace(" {","{",$elem); $elem = str_replace("}"," }\r\n",$elem); $elem = str_replace("*/","*/\r\n",$elem); $elem = str_replace(" "," ",$elem); echo $elem; } } /*=========================================================================*/ /*========================================================================= * Function Act_DisplayDateTime($DateTime) /*-------------------------------------------------------------------------*/ function Act_DisplayDateTime($DateTime) { list($year, $month, $day, $hour, $min, $sec) = split ('[- :]', $DateTime); $DateTime = $day.".".$month.".".$year." / ".$hour.":".$min.":".$sec; return $DateTime; } /*=========================================================================*/ /*========================================================================= * Function Act_DisplayUnixDateTime($Tstamp) /*-------------------------------------------------------------------------*/ function Act_DisplayUnixDateTime($Tstamp) { $Date = date ('d.m.Y H:i:s', $Tstamp); return $Date; } /*=========================================================================*/ /*========================================================================= * Function Act_DisplayDate($Date) /*-------------------------------------------------------------------------*/ function Act_DisplayDate($Date) { list($year, $month, $day) = split ('[-]', $Date); $Date = $day.".".$month.".".$year; return $Date; } /*=========================================================================*/ /*========================================================================= * Function Act_DisplayUnixDate($Tstamp) /*-------------------------------------------------------------------------*/ function Act_DisplayUnixDate($Tstamp) { $Date = date ('d.m.Y', $Tstamp); return $Date; } /*=========================================================================*/ /*========================================================================= * Function Act_DisplayTime($Time) /*-------------------------------------------------------------------------*/ function Act_DisplayTime($Time) { list($hour, $min, $sec) = split ('[:]', $Time); $Time = $hour.":".$min; return $Time; } /*=========================================================================*/ /*========================================================================= * Function Act_DisplayUnixTime($Tstamp) /*-------------------------------------------------------------------------*/ function Act_DisplayUnixTime($Tstamp) { $Time = date ('H:i:s', $Tstamp); return $Time; } /*=========================================================================*/ /*========================================================================= * Function Act_DBDate($Date) /*-------------------------------------------------------------------------*/ function Act_DBDate($Date) { list($day, $month, $year) = split ('[.]', $Date); $Date = $year."-".$month."-".$day; return $Date; } /*=========================================================================*/ /*========================================================================= * Function multi_strpos($pattern, $sequence) /*-------------------------------------------------------------------------*/ function multi_strpos($sequence,$pattern) { $n = 0; $position = Array("0"); while (ereg($pattern, $sequence)) { $n++; $fragment = split($pattern, $sequence); $trimsize = (strlen($fragment[0]))+1; $sequence = "*".substr($sequence, $trimsize); $position[$n] = (strlen($fragment[0]) + $position[($n-1)]); } return $position; } /*=========================================================================*/ /*========================================================================= * Function in_str($haystack, $needle, $sensitive) /*-------------------------------------------------------------------------*/ function in_str($haystack,$needle,$sensitive) { if ($sensitive) $re = strstr($haystack,$needle); else $re = stristr($haystack,$needle); return ( (boolean) $re); } /*=========================================================================*/ /*========================================================================= * Function stripTags($tags, $string) /*-------------------------------------------------------------------------*/ function stripTags($tags, $string) { if (is_array($tags)) { foreach ($tags as $tag) { $regExp = "<".$tag."[^>]*>"; $string = str_replace("", "", $string); $string = ereg_replace($regExp, "", $string); } } elseif (is_string($tags)) { $tag = $tags; $regExp = "<".$tag."[^>]*>"; $string = str_replace("", "", $string); $string = ereg_replace($regExp, "", $string); } return $string; } /*=========================================================================*/ /*========================================================================= * Function Act_GenKey($nameLength) Generiert Schlüssel /*-------------------------------------------------------------------------*/ function Act_GenKey($nameLength) { $NameChars = "abcdefghijklmnopqrstuvwxyz0123456789"; $Numbers = "0123456789"; $Name = ""; for ($index=1; $index<=$nameLength; $index++) { if ($index % 3 == 0) { $randomNumber = rand(1,strlen($Numbers)); $Name .= substr($Numbers,$randomNumber-1,1); } else { $randomNumber = rand(1,strlen($NameChars)); $Name .= substr($NameChars,$randomNumber-1,1); } } return $Name; } /*=========================================================================*/ /*========================================================================= * Function Act_ZipFileErrMsg($errno) Gibt Zip-Fehlermeldung aus /*-------------------------------------------------------------------------*/ function Act_ZipFileErrMsg($errno) { // using constant name as a string to make this function PHP4 compatible $zipFileFunctionsErrors = array( 'ZIPARCHIVE::ER_MULTIDISK' => 'Multi-disk zip archives not supported.', 'ZIPARCHIVE::ER_RENAME' => 'Renaming temporary file failed.', 'ZIPARCHIVE::ER_CLOSE' => 'Closing zip archive failed', 'ZIPARCHIVE::ER_SEEK' => 'Seek error', 'ZIPARCHIVE::ER_READ' => 'Read error', 'ZIPARCHIVE::ER_WRITE' => 'Write error', 'ZIPARCHIVE::ER_CRC' => 'CRC error', 'ZIPARCHIVE::ER_ZIPCLOSED' => 'Containing zip archive was closed', 'ZIPARCHIVE::ER_NOENT' => 'No such file.', 'ZIPARCHIVE::ER_EXISTS' => 'File already exists', 'ZIPARCHIVE::ER_OPEN' => 'Can\'t open file', 'ZIPARCHIVE::ER_TMPOPEN' => 'Failure to create temporary file.', 'ZIPARCHIVE::ER_ZLIB' => 'Zlib error', 'ZIPARCHIVE::ER_MEMORY' => 'Memory allocation failure', 'ZIPARCHIVE::ER_CHANGED' => 'Entry has been changed', 'ZIPARCHIVE::ER_COMPNOTSUPP' => 'Compression method not supported.', 'ZIPARCHIVE::ER_EOF' => 'Premature EOF', 'ZIPARCHIVE::ER_INVAL' => 'Invalid argument', 'ZIPARCHIVE::ER_NOZIP' => 'Not a zip archive', 'ZIPARCHIVE::ER_INTERNAL' => 'Internal error', 'ZIPARCHIVE::ER_INCONS' => 'Zip archive inconsistent', 'ZIPARCHIVE::ER_REMOVE' => 'Can\'t remove file', 'ZIPARCHIVE::ER_DELETED' => 'Entry has been deleted', ); $errmsg = 'unknown'; foreach ($zipFileFunctionsErrors as $constName => $errorMessage) { if (defined($constName) and constant($constName) === $errno) { return 'Zip File Function error: '.$errorMessage; } } return 'Zip File Function error: unknown'; } /*=========================================================================*/ /*========================================================================= * Function Act_CreateFolder($folder, $chmod) Erstellt ein Verzeichnis mit angegebenen Schreibrechten /*-------------------------------------------------------------------------*/ function Act_CreateFolder($folder, $chmod) { if (!is_dir($folder)) { mkdir("$folder", $chmod); return true; } else { return false; } } /*=========================================================================*/ /*=========================================================================*/ ?> 0) $title .= " » ".$news[$attributes["ID"]]; */ $title .= " "; ?> 0) { include("frontend/home/act_SearchResults.php"); include("frontend/home/dsp_SearchResults.php"); } break; case "content": if (isset($attributes["module"]) && (isset($attributes["ID"]) && $attributes["ID"] > 0)) { $ContentItem["ContentID"] = $attributes["ID"]; @ include("frontend/modules/mod_".$attributes["module"].".php"); } else { Redirect("?fuseaction=".$XFA["home"]."&skiptintro"); } break; case "menu": include("dsp_Nav.php"); break; case "submenu": include("act_SubNav.php"); break; case "service": include("dsp_ServiceNav.php"); break; case "tellafriend": include("act_TellAFriend.php"); if (isset($attributes["sent"]) && $attributes["sent"] > 0) { include("act_TellAFriendCheck.php"); if ($attributes["errors"] == "0") { include("act_TellAFriendSend.php"); include("dsp_TellAFriendConfirm.php"); $attributes["confirm"] = true; } } if (!isset($attributes["confirm"])) include( "dsp_TellAFriend.php" ); break; case "download": if (isset($attributes["file"])) { $file = $attributes["file"]; if (strpos($file,"/") != false) { $filename = substr($file,(strpos($file,"/")-strlen($file)+1),strlen($file)); } else { $filename = $file; } $filepath = $GLOBALS["FileDir"]."/".$file; if (strtoupper(substr($file,strlen($file)-3,3)) == "PDF") { header("Content-Type: application/pdf"); } else { header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filepath)); header("Content-Disposition: attachment; filename=".$filename); } readfile($filepath); exit; } else { Redirect("?fuseaction=".$XFA["home"]."&skipintro"); } break; case "login": if ($attributes["sent"] > 0) { include("functions/fct_Login.php"); include("act_CheckLogin.php"); if ($attributes["errors"] == 0) { Redirect("index.php?fuseaction=".$XFA["cms"]["main"]); } } include("dsp_Login.php"); break; case "logout": session_destroy(); Redirect("index.php?fuseaction=".$XFA["home"]); break; default: if ($debug == 1) { print "I received a fuseaction called '" . $Fusebox["fuseaction"] . "' that circuit '" . $Fusebox["circuit"] . "' does not have a handler for."; } else { Redirect("index.php"); } break; } ?>