$chars) { do { $result .= substr($str,1,$chars)." "; $str = substr($str,$chars); } while (strlen($str) > $chars); } $result .= $str." "; } return $result; } function CropText($text, $chars) { return (($text != "") && (strlen($text) > $chars)) ? substr($text, 0, $chars)."..." : $text; } function DeleteFile($file) { $delete = @unlink($file); if (@file_exists($file)) { $filesys = eregi_replace("/","\\",$file); $delete = @system("del $filesys"); if (@file_exists($file)) { $delete = @chmod ($file, 0775); $delete = @unlink($file); $delete = @system("del $filesys"); } } return $delete; } function SaveContentToFile($content, $id, $path) { if ($handle = fopen($path.$id,"wb")) { fwrite($handle,$content); fclose($handle); return $id; } } function ReadContentFromFile($id, $path) { if ($handle = @fopen($path.$id,"rb")) { $result = @fread($handle,999999); @fclose($handle); } return nl2br($result); } function CopyFile($image, $id, $path) { $img_size = @getimageSize($image); if ($img_size[2] == 0) return; $psize = filesize($image); $picture = fread(fopen($image, "rb"), $psize); if ($handle = fopen($path.$id,"wb")) { fwrite($handle,$picture,$psize); fclose($handle); return $id; } else { return ""; } } function DateToTimestamp($date) // !!! { if (preg_match("=^(\d{1,2})\.(\d{1,2})\.(\d{4})$=", $date, $mat)) { if (checkdate($mat[2],$mat[1],$mat[3])) { return mktime (0,0,0,$mat[2],$mat[1],$mat[3]); } else { return -1; } } else { return -1; } } function TimestampToDate($timestamp) { global $dateformat; return ($timestamp == -1) ? "" : date($dateformat,$timestamp); } function TimestampToDateTime($timestamp) { global $datetimeformat; return ($timestamp == -1) ? "" : date($datetimeformat,$timestamp); } function AdminEmailSender($root) { global $phpext; $ini = new Ini($root."/admin/cfg".$phpext); $from = $ini->Get("from"); $reply = $ini->Get("reply"); if (($from == "") && ($reply == "")) return ""; if ($from == "") $from = $reply; if ($reply == "") { return "From: \"{$from}\"\n"; } else { return "From: \"{$from}\" <{$reply}>\nReply-To: \"{$from}\" <{$reply}>\n"; } } function CommonCfg($root,$value) { global $phpext; $ini = new Ini($root."/admin/cfg".$phpext); return $ini->Get($value); } function IconFilter($text) { $data = array(":X",":\(\)",":Q","%\)",";\)",":P",":\)","X\(","=\)",":\(",":]","8O",";\(","8\)",":D",":O"); for ($i=0; $i",$text); $data = array(":-X",":-\(\)",":-Q","%-\)",";-\)",":-P",":-\)","X-\(","=-\)",":-\(",":-]","8-O",";-\(","8-\)",":-D",":-O"); for ($i=0; $i",$text); return $text; } function BadwordFilter($root, $strings) { global $phpext; $badwords = file($root."lib/badwords".$phpext); for ($i=0; $i -1) return true; } } return false; } function URLFilter($strings) { $token = array("www.","ww.","http"); for($i=0; $i -1) return true; } } return false; } function LinkReplace($text) { return preg_replace("/(http:\/\/[^ ]*)/i", "\\1",$text); } function CommonError($root, $key, $values, $pwd = 0) { global $phpext; $lng = new Ini($root."/lib/lib.lng".$phpext); $error = ($pwd == 1) ? $lng->Get("pwd_error") : $lng->Get($key); for ($i=0; $iGet($template.".filtercount"); for ($i=1; $i<=$count; $i++) { $filter = $ini->Get($template.".filter$i"); $values = split(";",$filter); $val = $GLOBALS[$values[1]]; if ($values[5]) { if (is_array($val)) { if (count($val) == 0) return CommonError($root,"required_error",array($values[2]),$values[7]); } else { if (!$val) return CommonError($root,"required_error",array($values[2]),$values[7]); } } if ($values[3] && (strlen($val) < $values[3])) return CommonError($root,"min_error",array($values[2],$values[3]),$values[7]); if ($values[4] && (strlen($val) > $values[4])) return CommonError($root,"max_error",array($values[2],$values[4]),$values[7]); if (($values[0] == 0) & ($val != "")) { switch ($values[6]) { case 1: if (!preg_match("/^[a-zδόφίΔάΦ0-9]+$/i",$val)) return CommonError($root,"format_alphanumeric",array($values[2]),$values[7]); break; case 2: if (!preg_match("/^[0-9]+$/",$val)) return CommonError($root,"format_numeric",array($values[2]),$values[7]); break; case 3: if (!preg_match("/^[a-zδόφίΔάΦ]+$/i",$val)) return CommonError($root,"format_alpha",array($values[2]),$values[7]); break; case 4: if (!eregi("^[0-9a-z_]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$val,$check)) return CommonError($root,"format_email",array($values[2]),$values[7]); break; case 5: if ((!preg_match("=^(\d{1,2})\.(\d{1,2})\.(\d{2,4})$=", $val, $mat)) || (!checkdate($mat[2],$mat[1],$mat[3]))) { return CommonError($root,"format_date",array($values[2]),$values[7]); } break; case 6: if ((!preg_match("=^(\d{1,2})\:(\d{1,2})\$=", $val, $mat)) || ($mat[1] > 23) || ($mat[2] > 59)) { return CommonError($root,"format_time",array($values[2]),$values[7]); } break; case 7: if (!preg_match("/^\d{5}$/",$val)) return CommonError($root,"format_postal",array($values[2]),$values[7]); break; } } } } ?>
Anrede  
Name  
Firma  
Strasse  
PLZ/Ort  
    
Telefon  
Email  
   
Mitteilung  
   
  Senden Sie mir den Gesamtkatalog

Abschicken