| 1 |
lars |
1 |
<?
|
|
|
2 |
//require_once "connect2.php";
|
|
|
3 |
|
|
|
4 |
$wert = $zeile;
|
|
|
5 |
$query = "select * from directory";
|
|
|
6 |
$result = mysql_query ($query) or die (mysql_errno().": ".mysql_error());
|
|
|
7 |
while ($zeile=mysql_fetch_array($result))
|
|
|
8 |
{
|
|
|
9 |
$bt_ja = $wert[background]; // Name des Button
|
|
|
10 |
$imgname = $webs[verzeichnis]."/images/bt_original/".$bt_ja; // Wo er sich befindet
|
|
|
11 |
$bt_ja_f2 = $wert[background2]; // Name des Mouseover Button
|
|
|
12 |
$imgname_f2 = $webs[verzeichnis]."/images/bt_original_f2/".$bt_ja_f2; // Wo er sich befindet
|
|
|
13 |
$fontfile = $DOCUMENT_ROOT."/fonts/".$wert[textart]; // Name der Schrift
|
|
|
14 |
$pixelhoehe = $wert[textgroesse]; // Höhe des Textes
|
|
|
15 |
$inhalt = $zeile[Name]; // Der auszugegebene Text
|
|
|
16 |
$angle = 0; // Winkel vom Text
|
|
|
17 |
$bt_name = $wert[background]."/images/bt/bt_".$zeile[ID].".png"; // Schreiben des Button
|
|
|
18 |
$bt_name_f2 = $wert[background];"/images/bt/bt_".$zeile[ID]."_f2.png"; // Schreiben des Mouseover Button
|
|
|
19 |
$bt_ho = $wert[horizontal]; // Höhe des Button
|
|
|
20 |
$bt_la = $wert[vertikal]; // Länge des Button
|
|
|
21 |
$bg_colhex = $wert[bgcolor]; // Hintergrundfarbe
|
|
|
22 |
$bg_colhex_f2 = $wert[bgcolor2]; // Hintergrundfarbe für Mouseover
|
|
|
23 |
$txt_colhex = $wert[textcolor]; // Textfarbe
|
|
|
24 |
$txt_colhex_f2 = $wert[textcolor2]; // Textfarbe für Mouseover
|
|
|
25 |
$txt_versh = $wert[txt_horizontal]; // Textversch. zur Seite
|
|
|
26 |
$txt_versv = $wert[txt_vertikal]; // Textversch. in die Höhe
|
|
|
27 |
$txt_zugr = $wert[zugr_txt]; // Ob zulanger Text zugelassen ist
|
|
|
28 |
$bt_ubla = $wert[bt_laenge]; // Ob Button Verlängerung erlaubt ist
|
|
|
29 |
$txt_la = imageTTFBBox($pixelhoehe,$angle,$fontfile,$inhalt); // Wie lang der Text ist
|
|
|
30 |
|
|
|
31 |
$txt = $txt_la[2]+$txt_versh;
|
|
|
32 |
$txt = $txt+$txt_versh*2;
|
|
|
33 |
$mitte_end = $txt;
|
|
|
34 |
if ($bt_ja){
|
|
|
35 |
$breite1 = $size[0];
|
|
|
36 |
$size = GetImageSize ($imgname);
|
|
|
37 |
$rechnet = (($size[1]-$pixelhoehe)/2+$pixelhoehe);
|
|
|
38 |
$im = @ImageCreateFromPNG ($imgname);
|
|
|
39 |
}else{
|
|
|
40 |
$breite1 = $bt_ho;
|
|
|
41 |
$im = @ImageCreate ($bt_ho, $bt_la)
|
|
|
42 |
or die ("Kann keinen neuen GD-Bild-Stream erzeugen");
|
|
|
43 |
$rechnet = (($bt_la-$pixelhoehe)/2+$pixelhoehe);
|
|
|
44 |
}
|
|
|
45 |
$breite2 = $txt_versh;
|
|
|
46 |
$breite = $breite1-2*$breite2;
|
|
|
47 |
if ($bt_ubla==1){
|
|
|
48 |
if (!$bt_ja){
|
|
|
49 |
$img = imagecreate($txt, $bt_la);
|
|
|
50 |
}else{
|
|
|
51 |
if ($breite<=$txt_la[2]){
|
|
|
52 |
$img = imagecreate($txt, $size[1]);
|
|
|
53 |
$background_color = ImageColorAllocate ($img, 255, 255, 255);
|
|
|
54 |
ImageCopy ($img, $im, 0, 0, 0, 0, ($size[0]/2), $size[1]);
|
|
|
55 |
for ($mitte = $size[0]/2; $mitte<=($mitte_end - $txt_versh); $mitte++){
|
|
|
56 |
ImageCopy ($img, $im, $mitte, 0, ($size[0]/2), 0, 1, $size[1]);
|
|
|
57 |
}
|
|
|
58 |
ImageCopy ($img, $im, ceil($txt-$size[0]/2), 0, ceil($size[0]/2), 0, ceil($size[0]/2), $size[1]);
|
|
|
59 |
}else{
|
|
|
60 |
$img = $im;
|
|
|
61 |
}
|
|
|
62 |
}
|
|
|
63 |
}else{
|
|
|
64 |
$img = $im;
|
|
|
65 |
}
|
|
|
66 |
$red = hexdec(substr($bg_colhex, 0, 2));
|
|
|
67 |
$green = hexdec(substr($bg_colhex, 2, 2));
|
|
|
68 |
$blue = hexdec(substr($bg_colhex, 4, 2));
|
|
|
69 |
$background_color = ImageColorAllocate ($img, $red, $green, $blue);
|
|
|
70 |
$red2 = hexdec(substr($txt_colhex, 0, 2));
|
|
|
71 |
$green2 = hexdec(substr($txt_colhex, 2, 2));
|
|
|
72 |
$blue2 = hexdec(substr($txt_colhex, 4, 2));
|
|
|
73 |
$txt_color = ImageColorAllocate ($img, $red2, $green2, $blue2);
|
|
|
74 |
if (!$txt_versv==0){
|
|
|
75 |
ImageTTFText ($img, $pixelhoehe, $angle, $txt_versh, $txt_versv, $txt_color, $fontfile, $inhalt);
|
|
|
76 |
}else{
|
|
|
77 |
ImageTTFText ($img, $pixelhoehe, $angle, $txt_versh, $rechnet, $txt_color, $fontfile, $inhalt);
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
if ($txt_zugr==1){
|
|
|
81 |
if ($breite<=$txt_la[2]){
|
|
|
82 |
}else{
|
|
|
83 |
ImagePNG ($img, $bt_name);
|
|
|
84 |
imagedestroy ($img);
|
|
|
85 |
}
|
|
|
86 |
}else{
|
|
|
87 |
ImagePNG ($img, $bt_name);
|
|
|
88 |
imagedestroy($img);
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
//*** Mouse Over Button ***//
|
|
|
92 |
if ($bt_ja_f2) {
|
|
|
93 |
$breite1 = $size[0];
|
|
|
94 |
$size = GetImageSize ($imgname_f2);
|
|
|
95 |
$rechnet = (($size[1]-$pixelhoehe)/2+$pixelhoehe);
|
|
|
96 |
$im = @ImageCreateFromPNG ($imgname_f2);
|
|
|
97 |
}else{
|
|
|
98 |
$breite1 = $bt_ho;
|
|
|
99 |
$im = @ImageCreate ($bt_ho, $bt_la)
|
|
|
100 |
or die ("Kann keinen neuen GD-Bild-Stream erzeugen");
|
|
|
101 |
$rechnet = (($bt_la-$pixelhoehe)/2+$pixelhoehe);
|
|
|
102 |
}
|
|
|
103 |
$breite2 = $txt_versh;
|
|
|
104 |
$breite = $breite1-2*$breite2;
|
|
|
105 |
if ($bt_ubla==1){
|
|
|
106 |
if (!$bt_ja_f2){
|
|
|
107 |
$img = imagecreate($txt, $bt_la);
|
|
|
108 |
}else{
|
|
|
109 |
if ($breite<=$txt_la[2]){
|
|
|
110 |
$img = imagecreate($txt, $size[1]);
|
|
|
111 |
$background_color = ImageColorAllocate ($img, 255, 255, 255);
|
|
|
112 |
ImageCopy ($img, $im, 0, 0, 0, 0, ($size[0]/2), $size[1]);
|
|
|
113 |
for ($mitte = $size[0]/2; $mitte<=($mitte_end - $txt_versh); $mitte++){
|
|
|
114 |
ImageCopy ($img, $im, $mitte, 0, ($size[0]/2), 0, 1, $size[1]);
|
|
|
115 |
}
|
|
|
116 |
ImageCopy ($img, $im, ceil($txt-$size[0]/2), 0, ceil($size[0]/2), 0, ceil($size[0]/2), $size[1]);
|
|
|
117 |
}else{
|
|
|
118 |
$img = $im;
|
|
|
119 |
}
|
|
|
120 |
}
|
|
|
121 |
}else{
|
|
|
122 |
$img = $im;
|
|
|
123 |
}
|
|
|
124 |
|
|
|
125 |
$red = hexdec(substr($bg_colhex_f2, 0, 2));
|
|
|
126 |
$green = hexdec(substr($bg_colhex_f2, 2, 2));
|
|
|
127 |
$blue = hexdec(substr($bg_colhex_f2, 4, 2));
|
|
|
128 |
$background_color_f2 = ImageColorAllocate ($img, $red, $green, $blue);
|
|
|
129 |
$red2 = hexdec(substr($txt_colhex_f2, 0, 2));
|
|
|
130 |
$green2 = hexdec(substr($txt_colhex_f2, 2, 2));
|
|
|
131 |
$blue2 = hexdec(substr($txt_colhex_f2, 4, 2));
|
|
|
132 |
$txt_color = ImageColorAllocate ($img, $red2, $green2, $blue2);
|
|
|
133 |
if (!$txt_versv == 0){
|
|
|
134 |
ImageTTFText ($img, $pixelhoehe, $angle, $txt_versh, $txt_versv, $txt_color, $fontfile, $inhalt);
|
|
|
135 |
}else{
|
|
|
136 |
ImageTTFText ($img, $pixelhoehe, $angle, $txt_versh, $rechnet, $txt_color, $fontfile, $inhalt);
|
|
|
137 |
}
|
|
|
138 |
if ($txt_zugr==1){
|
|
|
139 |
if ($breite<=$txt_la[2]){
|
|
|
140 |
}else{
|
|
|
141 |
ImagePNG ($img, $bt_name_f2);
|
|
|
142 |
imagedestroy ($img);
|
|
|
143 |
}
|
|
|
144 |
}else{
|
|
|
145 |
ImagePNG ($img, $bt_name_f2);
|
|
|
146 |
imagedestroy ($img);
|
|
|
147 |
}
|
|
|
148 |
|
|
|
149 |
//*** Ausgabe der Fehlermeldung ***//
|
|
|
150 |
if ($breite<=$txt_la[2]){?>
|
|
|
151 |
<table width="495" border="0">
|
|
|
152 |
<tr>
|
|
|
153 |
<td nowrap width="13%" valign="top">Der Text: </td>
|
|
|
154 |
<td nowrap width="29%" valign="top"><?echo $inhalt;?></td>
|
|
|
155 |
<td width="57%" align="left">ist mit
|
|
|
156 |
<?echo $txt_la[2];?>
|
|
|
157 |
px für diesen Button mit
|
|
|
158 |
<?echo $breite;?>
|
|
|
159 |
px incl. der Textverschiebung zu lang!
|
|
|
160 |
</td>
|
|
|
161 |
</tr>
|
|
|
162 |
</table><?
|
|
|
163 |
}
|
|
|
164 |
}
|
|
|
165 |
?>
|