1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
|
/**
* (C) 2006 e-WebWork
* http://www.e-webwork.de
* kboehme@e-webwork.de
*
* @name: letterfunctions
* @author: Kevin Boehme
* @version: 1.0
*
* start
*/
/**
* function filter_chars
*
* Helperfunction for text2pic
*/
function filter_chars($strLetter, $strReplace = " "){
$search = array("\"", ":", "\$", "'", "§", "&", "\\", "/", "*", "[", "]", "<", ">", "}", "{", "=", "(", ")", "|", ";", "-", "%", "?");
$replace = array("quote", "dd", "doller", "simplequote", "paragraph", "and", "backslash", "slash", "start", "k2_auf", "k2_zu", "k_left", "k_right", "k3_zu", "k3_auf", "is", "k1_auf", "k1_zu", "pipe", "semicolon", "minus", "percent", "questionmark");
$return = $strLetter;
for($i = 0; $i < count($search); $i++) $return = str_replace($search[$i], $replace[$i], $return);
$return = preg_replace("/(^[a-z][A-Z][0-9])/s", $strReplace, $return);
return $return;
}
/**
* function test2pic
*
* Mainfunction to make a text looking like an image
*/
function text2pic($strText){
$tmp = $strText;
// Strip german "Umlaute" (bevor rehtmlconvert to avoid UTF-8 problems) && Strip the other htmlentites
$tmp = str_replace("ü", "ue", $tmp);
$tmp = str_replace("Ü", "Ue", $tmp);
$tmp = str_replace("Ä", "Ae", $tmp);
$tmp = str_replace("ä", "ae", $tmp);
$tmp = str_replace("ö", "oe", $tmp);
$tmp = str_replace("Ö", "Oe", $tmp);
$tmp = rehtmlconverter($tmp);
// Parse the letters
for($i = 0; $i < strlen($tmp); $i++){
if(substr($tmp, $i, 1) == " ") $imgText .= '<img src="images/letters/spacer.gif" style="width: 4px" border="0" />';
else $imgText .= '<img src="images/letters/'.filter_chars(substr($tmp, $i, 1)).'.gif" alt="'.$posts['posttopic'].'" border="0" />';
}
// Output
return $imgText;
}
/**
* end
*/
?> |