Code: Alles auswählen
<?PHP
$breite = 129;
$hoehe = 19;
$text = "Neuwagen";
$bilddatei ="bild.png";
$schriftart="ARIAL.TTF
$schriftgroesse="9";
$image2 = imagecreatefrompng($bilddatei);
$image = imagecreate ($breite,$hoehe);
$farbe_body=imagecolorallocate($image,0,0,0);
imagettftext($image2, $schriftgroesse, 0, 15, 13, $image, $schriftart, $text);
header ("Content-type: image/png");
imagepng($image2);
ImageDestroy($image2);
?>
Jetzt habe ich das Programm in meine Service-Navigation implementiert:
Das Output ist hierbei wichtig!!!!!
Code: Alles auswählen
// selected category INPUT
$selected = "CMS_VALUE[0]";
echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">
<tr valign=\"top\">
<td>Kategorie wählen:</td>
<td>
<select name=\"CMS_VAR[0]\">";
if($selected!="0" && $selected!=""){
echo"<option value=\"0\">--- kein ---</option>";
}else{
echo"<option selected=\"selected\" value=\"0\">--- kein ---</option>";
}
// fetch all categorys
$query = "SELECT A.idcat, A.level, C.name FROM ".$cfg["tab"]["cat_tree"]." AS A, ".
$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat=B.idcat ".
"AND B.idcat=C.idcat AND C.idlang='$lang' AND B.idclient='$client' ".
"AND C.visible=1 ORDER BY A.idtree";
// execute query
$db->query($query);
// loop result and build the options
while ($db->next_record()) {
// indent spacer
$spaces = "|";
// how many levels
$levels = $db->f("level");
for ($i = 0; $i < $levels; $i ++) {
// add 2 spaces for every level
$spaces = $spaces . "--";
} // end for
$spaces .= ">";
if ($selected == $db->f("idcat")) {
// selected category
echo "<option selected=\"selected\" value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} else {
// category
echo "<option value=\"". $db->f("idcat") ."\">". $spaces . $db->f("name") ."</option>";
} // end if
} // end while
echo " </select>";
echo " </td>
</tr>
</table>";
Code: Alles auswählen
<?php
// OUTPUT
include_once($cfg["path"]["contenido"].$cfg["path"]["includes"]."functions.con.php");
$catStart = "CMS_VALUE[0]";
if ($catStart != "")
{
$catIds = conDeeperCategoriesArray($catStart);
if ( is_array($catIds) )
{
foreach($catIds as $key=>$val)
{
// Ersten Eintrag ueberspringen, weil das der Menupunkt selbst ist
// und nicht angezeigt werden soll.
if ($key != 0)
{
$sql = "SELECT CAT.idcat AS idcat, name FROM ". $cfg["tab"]["cat"]." AS CAT, ". $cfg["tab"]["cat_lang"]." AS CATLANG
WHERE CAT.idcat = ".$val."
AND CAT.idcat = CATLANG.idcat
AND CATLANG.idlang = '$lang'
AND CATLANG.visible = '1'";
$db->query($sql);
while ( $db->next_record() )
{
$id_art = mysql_query("SELECT idart FROM ".$cfg["tab"]["cat_art"]." WHERE idcat='".$db->f("idcat")."' AND is_start='1'");
$row_art = mysql_fetch_array($id_art);
$idart = $row_art["idart"];
$external = mysql_query("SELECT external_redirect FROM ".$cfg["tab"]["art_lang"]." WHERE idart = '$idart'");
$row_external = mysql_fetch_array($external);
$external_redirect = $row_external["external_redirect"];
if ($external_redirect==0)
{
$target="target=_self";
}
elseif ($external_redirect==1)
{
$target="target=_blank";
}
$test=$db->f("name");
$breite = 129;
$hoehe = 19;
$text = $test;
echo $text;
$bilddatei ="http://weinheim.site-master.de/script/cms/bild.png";
$schriftart="/www/htdocs/weinheim/script/cms/VAGRNDLT.TTF";
$schriftgroesse="9";
$image2 = imagecreatefrompng($bilddatei);
$image = imagecreate ($breite,$hoehe);
$farbe_body=imagecolorallocate($image,0,0,0);
imagettftext($image2, $schriftgroesse, 0, 15, 13, $image, $schriftart, $text);
header ("Content-type: image/png");
//imagepng($image2);
//ImageDestroy($image2);
echo '<div class="navhltxt"><br><img src="images/nav_punkt.gif" width="7" height="19" align="absmiddle" hspace="5" vspace="1"><a href="front_content.php?idcat='.$db->f("idcat").'&idart='.$idart.'"'.$target.'>"'.imagepng($image2).'</a></div>';
} // end while
} // if
} // end foreach
} // end if (is_array)
}
echo '<div class="navtxt"><img src="images/2x2_grau.gif" width="133" height="1" vspace="15"></div>';
?>
es kommen nur
"Line‰PNG IHDR