added some methods to convert dates and timestamps in american format into the german format!

main
hecht 13 years ago
parent cbd536d7be
commit 8fc80d7ec2

@ -18,7 +18,7 @@ function encodeNoHTMLnoBBAlBhed($msg){
$msg = $msg[1]; $msg = $msg[1];
$albhed = array ( 'e' => 'a','p' => 'b','s' => 'c','t' => 'd','i' => 'e','w' => 'f','k' => 'g','n' => 'h','u' => 'i','v' => 'j','g' => 'k','c' => 'l','l' => 'm','r' => 'n','y' => 'o','b' => 'p','x' => 'q','h' => 'r','m' => 's','d' => 't','o' => 'u','f' => 'v','z' => 'w','q' => 'x','a' => 'y','j' => 'z', $albhed = array ( 'e' => 'a','p' => 'b','s' => 'c','t' => 'd','i' => 'e','w' => 'f','k' => 'g','n' => 'h','u' => 'i','v' => 'j','g' => 'k','c' => 'l','l' => 'm','r' => 'n','y' => 'o','b' => 'p','x' => 'q','h' => 'r','m' => 's','d' => 't','o' => 'u','f' => 'v','z' => 'w','q' => 'x','a' => 'y','j' => 'z',
'E' => 'A','P' => 'B','S' => 'C','T' => 'D','I' => 'E','W' => 'F','K' => 'G','N' => 'H','U' => 'I','V' => 'J','G' => 'K','C' => 'L','L' => 'M','R' => 'N','Y' => 'O','B' => 'P','X' => 'Q','H' => 'R','M' => 'S','D' => 'T','O' => 'U','F' => 'V','Z' => 'W','Q' => 'X','A' => 'Y','J' => 'Z', 'E' => 'A','P' => 'B','S' => 'C','T' => 'D','I' => 'E','W' => 'F','K' => 'G','N' => 'H','U' => 'I','V' => 'J','G' => 'K','C' => 'L','L' => 'M','R' => 'N','Y' => 'O','B' => 'P','X' => 'Q','H' => 'R','M' => 'S','D' => 'T','O' => 'U','F' => 'V','Z' => 'W','Q' => 'X','A' => 'Y','J' => 'Z',
'ü' => 'ia', 'Ü' => 'Ia', 'ö' => 'ua', 'Ö' => 'Ua', 'ä' => 'ya', 'Ä' => 'Ya', 'ß' => 'cc' 'ü' => 'ia', 'Ü' => 'Ia', 'ö' => 'ua', 'Ö' => 'Ua', 'ä' => 'ya', 'Ä' => 'Ya', 'ß' => 'cc'
); );
$in_html = 0; $in_html = 0;
$in_bb_brackets = 0; $in_bb_brackets = 0;
@ -87,7 +87,7 @@ function decodeNoHTMLNoBBAlBhed($msg){
$result .= $str; $result .= $str;
} }
} }
return $result; return $result;
} }
function encodeNoHTMLWithBB($msg){ function encodeNoHTMLWithBB($msg){
@ -211,7 +211,7 @@ function bbcode($messagetext) {
'<sup>\1</sup>', '<sup>\1</sup>',
'<span style="color:#\1">\2</span>', '<span style="color:#\1">\2</span>',
'<span style="color:\1">\2</span>', '<span style="color:\1">\2</span>',
'<span title="\1">\2</span>', '<span title="\1">\2</span>',
'<br>' '<br>'
//'<img src="\1\2">', //'<img src="\1\2">',
//'<img src="\1\2" />' //'<img src="\1\2" />'
@ -290,17 +290,17 @@ function validateStringArray($value){
for($i=0,$n=count($value);$i<$n;$i++){ for($i=0,$n=count($value);$i<$n;$i++){
$value[$i] = validateString($value[$i]); $value[$i] = validateString($value[$i]);
} }
return $value; return $value;
} }
function validateEmailAddress($mail){ function validateEmailAddress($mail){
return validateString($mail); return validateString($mail);
} }
function validateName($name){ function validateName($name){
$allowed = "/[^a-z0-9\\040\\-\\_äöü]/i"; $allowed = "/[^a-z0-9\\040\\-\\_äöü]/i";
// Beschraenke die Eingabezeichen // Beschraenke die Eingabezeichen
$da_name = trim(addslashes(preg_replace($allowed,'',$name))); $da_name = trim(addslashes(preg_replace($allowed,'',$name)));
if(strlen($da_name) < 2){ if(strlen($da_name) < 2){
return NULL; return NULL;
} }
@ -317,4 +317,18 @@ function validateURL($url){
} }
} }
function formatDate($dateString) {
return preg_replace('#([\d]+?)-([\d]+?)-([\d]+?)#', '\3.\2.\1', $dateString);
}
function formatTime($timeString) {
// Not yet required!
return $imeString;
}
function formatTimestamp($timestampString) {
return preg_replace('#([\d]+?)-([\d]+?)-([\d]+?) ([\d:]+?)#', '\3.\2.\1 \4', $dateString);
}
?> ?>

Loading…
Cancel
Save