ich habe mal meine bescheidenen PHP-Kentnisse zusammengekratzt und das Modul erwas erweitert.
1.
Es kann jetzt eingestellt werden ob die Artikel per Zufallsreihenfolge ausgegeben werden. Außerdem kann die Anzahl der ausgegebenen Artikel eingestellt werden. Ihr legt z.B. 10 Artikel an, aktiviert die Zufallsausgabe und stellt den Wert auf "5", so werden aus den angelegten 10 Artikeln beliebig 5 ausgewählt und in zufälliger Reihenfolge dargestellt.
2.
Der Text wird nun nicht mehr mitten im Wort abgeschnitten.
3.
Die Bezeichnung im Backend ist auf deutsch.
Hier der Code (Eingabe):
Code: Alles auswählen
# Initialization
$bDebug = false;
unset ($aSettings);
$aSettings = array();
$aSettings["ArticleCount"] = "CMS_VALUE[1]";
$aSettings["TeaserLength"] = "CMS_VALUE[2]";
$aSettings["SampleCat"] = "CMS_VALUE[3]";
$aSettings["SampleArt"] = "CMS_VALUE[4]";
$aSettings["HeadlineIdentifier"] = "CMS_VALUE[5]";
$aSettings["TextIdentifier"] = "CMS_VALUE[6]";
$aSettings["ImageIdentifier"] = "CMS_VALUE[7]";
$aSettings["ImageWidth"] = "CMS_VALUE[8]";
$aSettings["ImageHeight"] = "CMS_VALUE[9]";
$aSettings["MaxAus"] = "CMS_VALUE[10]";
$aSettings["Zufall"] = "CMS_VALUE[11]";
# Functions
function fncBuildCategorySelect($sName, $sValue, $sLevel = 0, $sOnChange = '') {
global $cfg, $client, $lang, $idcat;
$db = new DB_Contenido;
$db2 = new DB_Contenido;
$html = '';
$html .= '<select name="'.$sName.'" onchange="'.$sOnChange.'">';
$html .= ' <option value="">'.i18n("Please choose").'</option>';
if ($sLevel > 0) {
$addString = "AND c.level<$sLevel";
}
$sql = "SELECT a.idcat AS idcat, b.name AS name, c.level FROM
".$cfg["tab"]["cat"]." AS a, ".$cfg["tab"]["cat_lang"]." AS b,
".$cfg["tab"]["cat_tree"]." AS c WHERE a.idclient = '".$client."'
AND b.idlang = '".$lang."' AND b.idcat = a.idcat AND c.idcat = a.idcat $addString
ORDER BY c.idtree";
$db->query($sql);
$categories = array ();
while ($db->next_record()) {
$categories[$db->f("idcat")]["name"] = $db->f("name");
$sql = "SELECT level FROM ".$cfg["tab"]["cat_tree"]." WHERE idcat = '".$db->f("idcat")."'";
$db2->query($sql);
if ($db2->next_record()) {
$categories[$db->f("idcat")]["level"] = $db2->f("level");
}
$sql2 = "SELECT a.title AS title, b.idcatart AS idcatart FROM
".$cfg["tab"]["art_lang"]." AS a, ".$cfg["tab"]["cat_art"]." AS b
WHERE b.idcat = '".$db->f("idcat")."' AND a.idart = b.idart AND
a.idlang = '".$lang."'";
$db2->query($sql);
while ($db2->next_record()) {
$categories[$db->f("idcat")]["articles"][$db2->f("idcatart")] = $db2->f("title");
}
}
foreach ($categories as $tmpidcat => $props) {
$spaces = " ";
for ($i = 0; $i < $props["level"]; $i ++) {
$spaces .= " ";
}
$tmp_val = $tmpidcat;
if ($sValue != $tmp_val) {
$html .= '<option value="'.$tmp_val.'" style="background-color:#EFEFEF">'.$spaces.">".$props["name"].'</option>';
} else {
$html .= '<option value="'.$tmp_val.'" style="background-color:#EFEFEF" selected="selected">'.$spaces.">".$props["name"].'</option>';
}
}
$html .= '</select>';
unset ($db2);
unset ($sql);
unset ($categories);
unset ($tmp_val);
unset ($tmpidcat);
unset ($spaces);
return $html;
}
function fncBuildArticleSelect($sName, $sIDCat, $sValue, $sOnChange = '') {
global $cfg, $lang;
$db2 = new DB_Contenido;
$html = '';
$html .= '<select name="'.$sName.'" onchange="'.$sOnChange.'">'.chr(10);
$html .= ' <option value="" selected>'.i18n("Please choose").'</option>'.chr(10);
if (is_numeric($sIDCat) && $sIDCat > 0) {
$sql = "SELECT
a.title AS title,
b.idcatart AS idcatart
FROM
".$cfg["tab"]["art_lang"]." AS a,
".$cfg["tab"]["cat_art"]." AS b
WHERE
a.online = '1' AND
b.idcat = '".$sIDCat."' AND
a.idart = b.idart AND
a.idlang = '".$lang."'";
$db2->query($sql);
while ($db2->next_record()) {
$lIDCatArt = $db2->f('idcatart');
$sTitle = $db2->f('title');
if ($sValue != $lIDCatArt) {
$html .= '<option value="'.$lIDCatArt.'"> '.$sTitle.'</option>'.chr(10);
} else {
$html .= '<option selected="selected" value="'.$lIDCatArt.'"> '.$sTitle.'</option>'.chr(10);
}
}
}
$html .= '</select>'.chr(10);
unset ($db2);
unset ($lIDCatArt);
unset ($sTitle);
return $html;
}
function fncBuildTypeSelect($sName, $lIDCatArt, $sValue, $sTypeRange = '', $sOnChange = '') {
global $cfg, $lang;
$db2 = new DB_Contenido;
$html = '';
$html .= '<select name="'.$sName.'" onchange="'.$sOnChange.'">'.chr(10);
$html .= ' <option value="" selected>'.i18n("Please choose").'</option>'.chr(10);
if (is_numeric($lIDCatArt) && $lIDCatArt > 0) {
$sql = "SELECT
a.typeid AS typeid,
a.value AS value,
a.idtype AS idtype,
d.type AS type,
d.description AS description
FROM
".$cfg["tab"]["content"]." AS a,
".$cfg["tab"]["art_lang"]." AS b,
".$cfg["tab"]["cat_art"]." AS c,
".$cfg["tab"]["type"]." AS d
WHERE
a.idtype = d.idtype AND
a.idartlang = b.idartlang AND
b.idart = c.idart AND
b.idlang = '".$lang."' AND ";
if ($sTypeRange != "") {
$sql .= "a.idtype IN (".$sTypeRange.") AND ";
}
$sql .= " c.idcatart = '".$lIDCatArt."'
ORDER BY a.idtype, a.typeid";
$db2->query($sql);
while ($db2->next_record()) {
$sTypeIdentifier = "tblData.idtype = '".$db2->f('idtype')."' AND tblData.typeid = '".$db2->f('typeid')."'";
$sContent = $db2->f('type')."[".$db2->f('typeid')."]: ".substr(strip_tags(urldecode($db2->f("value"))), 0, 50);
$sDescription = i18n($db2->f("description"));
if ($sValue != $sTypeIdentifier) {
$html .= '<option value="'.$sTypeIdentifier.'"> '.$sContent.'</option>'.chr(10);
} else {
$html .= '<option selected="selected" value="'.$sTypeIdentifier.'"> '.$sContent.'</option>'.chr(10);
}
}
}
$html .= '</select>'.chr(10);
unset ($db2);
unset ($sTypeIdentifier);
unset ($sContent);
unset ($sDescription);
return $html;
}
# Checking values
if (!is_numeric($aSettings["ArticleCount"]) || $aSettings["ArticleCount"] <= 0) {
$aSettings["ArticleCount"] = 1;
}
if (!is_numeric($aSettings["TeaserLength"]) || $aSettings["TeaserLength"] <= 0) {
$aSettings["TeaserLength"] = 50;
}
if (!is_numeric($aSettings["SampleCat"]) || $aSettings["SampleCat"] < 0) {
$aSettings["SampleCat"] = 0;
}
if (!is_numeric($aSettings["SampleArt"]) || $aSettings["SampleArt"] < 0) {
$aSettings["SampleArt"] = 0;
}
if (strlen($aSettings["HeadlineIdentifier"]) > 50) {
$aSettings["HeadlineIdentifier"] = "";
}
if (strlen($aSettings["TextIdentifier"]) > 50) {
$aSettings["TextIdentifier"] = "";
}
if (strlen($aSettings["ImageIdentifier"]) > 50) {
$aSettings["ImageIdentifier"] = "";
}
if (!is_numeric($aSettings["ImageWidth"]) || $aSettings["ImageWidth"] <= 10) {
$aSettings["ImageWidth"] = 170;
}
if (!is_numeric($aSettings["ImageHeight"]) || $aSettings["ImageHeight"] <= 10) {
$aSettings["ImageHeight"] = 50;
}
echo ' <table cellspacing="0" cellpadding="2" border="0" width="100%">', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Anzahl gesamt (Artikel):").'</td>', chr(10);
echo ' <td><input type="text" name="CMS_VAR[1]" value="'.$aSettings["ArticleCount"].'" size="5"> <input type="image" src="images/submit.gif"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td>'.mi18n("Teaser Länge (maximal):").'</td>', chr(10);
echo ' <td><input type="text" name="CMS_VAR[2]" value="'.$aSettings["TeaserLength"].'" size="5"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td colspan="2" class="textw_medium" style="background-color: #a9aec2; border: 1px solid #747488;">'.mi18n("Zufallsausgabe:").'</td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488;">'.mi18n("Aktiviert:").'</td>', chr(10);
if ($aSettings["Zufall"]!=""){$checked=" checked";}
echo ' <td class="text" style="border-right: 1px solid #747488;"><input type="checkbox" name="CMS_VAR[11]" value="JA"'.$checked.'></td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488;border-bottom: 1px solid #747488;">'.mi18n("Maximale Ausgabe (Artikel):").'</td>', chr(10);
echo ' <td class="text" style="border-right: 1px solid #747488; border-bottom: 1px solid #747488;"><input type="text" name="CMS_VAR[10]" value="'.$aSettings["MaxAus"].'" size="5"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' </table>', chr(10);
echo ' <br />', chr(10);
echo ' <table cellspacing="0" cellpadding="2" border="0" width="100%">', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td colspan="2" class="textw_medium" style="background-color: #a9aec2; border: 1px solid #747488;">'.mi18n("Element Identifikation:").'</td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td colspan="2" class="text" style="border-left: 1px solid #747488; border-right: 1px solid #747488;">'.mi18n("Beispiel Kategorie:").'<br />'.fncBuildCategorySelect("CMS_VAR[3]", $aSettings["SampleCat"], 0, "if (document.forms[0].elements['CMS_VAR[3]'].value != 'CMS_VALUE[3]') { document.forms[0].elements['CMS_VAR[4]'].disabled = true; document.forms[0].elements['CMS_VAR[5]'].disabled = true; document.forms[0].elements['CMS_VAR[6]'].disabled = true; document.forms[0].elements['CMS_VAR[7]'].disabled = true; } else { document.forms[0].elements['CMS_VAR[4]'].disabled = false; document.forms[0].elements['CMS_VAR[5]'].disabled = false; document.forms[0].elements['CMS_VAR[6]'].disabled = false; document.forms[0].elements['CMS_VAR[7]'].disabled = false;}").' <input type="image" src="images/submit.gif"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td colspan="2" class="text" style="border-left: 1px solid #747488; border-right: 1px solid #747488;">'.mi18n("Beispiel Artikel:").'<br />'.fncBuildArticleSelect("CMS_VAR[4]", $aSettings["SampleCat"], $aSettings["SampleArt"], "if (document.forms[0].elements['CMS_VAR[4]'].value != 'CMS_VALUE[4]') { document.forms[0].elements['CMS_VAR[5]'].disabled = true; document.forms[0].elements['CMS_VAR[6]'].disabled = true; document.forms[0].elements['CMS_VAR[7]'].disabled = true; } else { document.forms[0].elements['CMS_VAR[5]'].disabled = false; document.forms[0].elements['CMS_VAR[6]'].disabled = false; document.forms[0].elements['CMS_VAR[7]'].disabled = false;}").' <input type="image" src="images/submit.gif"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488;">'.mi18n("Element Überschrift:").'</td>', chr(10);
echo ' <td class="text" style="border-right: 1px solid #747488;">'.fncBuildTypeSelect("CMS_VAR[5]", $aSettings["SampleArt"], $aSettings["HeadlineIdentifier"], "'1','2','3','9','17'").'</td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488;">'.mi18n("Element Text:").'</td>', chr(10);
echo ' <td class="text" style="border-right: 1px solid #747488;">'.fncBuildTypeSelect("CMS_VAR[6]", $aSettings["SampleArt"], $aSettings["TextIdentifier"], "'1','2','3','9','17'").'</td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488; border-bottom: 1px solid #747488;">'.mi18n("Element Bild:").'</td>', chr(10);
echo ' <td class="text" style="border-right: 1px solid #747488; border-bottom: 1px solid #747488;">'.fncBuildTypeSelect("CMS_VAR[7]", $aSettings["SampleArt"], $aSettings["ImageIdentifier"], "'4'").' ', chr(10);
echo ' '.mi18n("Breite:").' <input type="text" name="CMS_VAR[8]" value="'.$aSettings["ImageWidth"].'" size="5"> ', chr(10);
echo ' '.mi18n("Höhe:").' <input type="text" name="CMS_VAR[9]" value="'.$aSettings["ImageHeight"].'" size="5"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' </table>', chr(10);
for ($i = 0; $i < $aSettings["ArticleCount"]; $i++) {
$lCatIdentifier = 20 + ($i * 2);
$lArtIdentifier = 21 + ($i * 2);
echo ' <br />', chr(10);
echo ' <table cellspacing="0" cellpadding="2" border="0" width="100%>', chr(10);
echo ' <tr valign="top">', chr(10);
echo ' <td class="textw_medium" style="background-color: #a9aec2; border: 1px solid #747488;">'.sprintf(mi18n("Artikel %d:"), $i + 1).'</td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488; border-right: 1px solid #747488;">'.mi18n("Kategorie auswählen:")."</td>", chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
if ($bDebug) {
echo "<td><pre>Count: ".$aSettings["ArticleCount"].", Cat: CMS_VALUE[$lCatIdentifier], CatArt: CMS_VALUE[$lArtIdentifier], Client: ".$client.", Lang: ".$lang."<br />Webpath: ".$cfgClient[$client]['path']['htmlpath']."</pre></td>", chr(10);
}
echo ' <td class="text" style="border-left: 1px solid #747488; border-right: 1px solid #747488;">'.fncBuildCategorySelect("CMS_VAR[$lCatIdentifier]", "CMS_VALUE[$lCatIdentifier]", 0, "if (document.forms[0].elements['CMS_VAR[$lCatIdentifier]'].value != 'CMS_VALUE[$lCatIdentifier]') { document.forms[0].elements['CMS_VAR[$lArtIdentifier]'].disabled = true; } else { document.forms[0].elements['CMS_VAR[$lArtIdentifier]'].disabled = false; }").' <input type="image" src="images/submit.gif"></td>', chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488; border-right: 1px solid #747488;">'.mi18n("Artikel auswählen:")."</td>", chr(10);
echo ' </tr>', chr(10);
echo ' <tr valign="top">',chr(10);
echo ' <td class="text" style="border-left: 1px solid #747488; border-right: 1px solid #747488; border-bottom: 1px solid #747488;">'.fncBuildArticleSelect("CMS_VAR[$lArtIdentifier]", "CMS_VALUE[$lCatIdentifier]", "CMS_VALUE[$lArtIdentifier]").'</td>', chr(10);
echo ' </tr>', chr(10);
echo ' </table>', chr(10);
}
Code: Alles auswählen
<?php
# Initialization
$bDebug = false;
unset ($aSettings);
unset ($aData);
$aSettings = array();
$aData = array();
$aSettings["ArticleCount"] = "CMS_VALUE[1]";
$aSettings["TeaserLength"] = "CMS_VALUE[2]";
$aSettings["HeadlineIdentifier"] = "CMS_VALUE[5]";
$aSettings["TextIdentifier"] = "CMS_VALUE[6]";
$aSettings["ImageIdentifier"] = "CMS_VALUE[7]";
$aSettings["ImageWidth"] = "CMS_VALUE[8]";
$aSettings["ImageHeight"] = "CMS_VALUE[9]";
$aSettings["MaxAus"] = "CMS_VALUE[10]";
$aSettings["Zufall"] = "CMS_VALUE[11]";
# Checking values
if (!is_numeric($aSettings["ArticleCount"]) || $aSettings["ArticleCount"] <= 0) {
$aSettings["ArticleCount"] = 0;
}
if (!is_numeric($aSettings["TeaserLength"]) || $aSettings["TeaserLength"] <= 0) {
$aSettings["TeaserLength"] = 250;
}
if (!is_numeric($aSettings["ImageWidth"]) || $aSettings["ImageWidth"] <= 10) {
$aSettings["ImageWidth"] = 170;
}
if (!is_numeric($aSettings["ImageHeight"]) || $aSettings["ImageHeight"] <= 10) {
$aSettings["ImageHeight"] = 50;
}
if (!is_object($db2)) {
$db2 = new DB_Contenido;
}
if (!is_object($db3)) {
$db3 = new DB_Contenido;
}
if ($aSettings["ArticleCount"] > 0 && ($aSettings["HeadlineIdentifier"] != "" ||
$aSettings["TextIdentifier"] != "" || $aSettings["ImageIdentifier"] != "")) {
for ($i = 0; $i < $aSettings["ArticleCount"]; $i++) {
$lArtIdentifier = 21 + ($i * 2);
$aData["Item".($i + 1)] = array();
$aData["Item".($i + 1)]["IDCatArt"] = "CMS_VALUE[$lArtIdentifier]";
$aData["Item".($i + 1)]["Headline"] = " ";
$aData["Item".($i + 1)]["Text"] = " ";
$aData["Item".($i + 1)]["Image"] = array();
$aData["Item".($i + 1)]["Image"]["ServerPath"] = "";
$aData["Item".($i + 1)]["Image"]["WebPath"] = "";
if ($aData["Item".($i + 1)]["IDCatArt"] != "") {
$sql = "SELECT tblData.value AS value, tblData.idtype AS idtype, tblData.typeid AS typeid FROM ";
$sql .= $cfg["tab"]["cat_art"]." AS tblCatArt, ";
$sql .= $cfg["tab"]["art_lang"]." AS tblArtLang, ";
$sql .= $cfg["tab"]["content"]." AS tblData ";
$sql .= "WHERE tblData.idartlang = tblArtLang.idartlang AND ";
$sql .= "tblArtLang.idlang = '".$lang."' AND ";
$sql .= "tblArtLang.idart = tblCatArt.idart AND ";
$sql .= "tblCatArt.idcatart = '".$aData["Item".($i + 1)]["IDCatArt"]."' AND (";
$sql_items = "";
if ($aSettings["HeadlineIdentifier"] != "") {
$sql_items = "(".$aSettings["HeadlineIdentifier"].")";
}
if ($aSettings["TextIdentifier"] != "") {
if ($sql_items != "") {
$sql_items .= " OR (".$aSettings["TextIdentifier"].")";
} else {
$sql_items = "(".$aSettings["TextIdentifier"].")";
}
}
if ($aSettings["ImageIdentifier"] != "") {
if ($sql_items != "") {
$sql_items .= " OR (".$aSettings["ImageIdentifier"].")";
} else {
$sql_items = "(".$aSettings["ImageIdentifier"].")";
}
}
$sql .= $sql_items.")";
if ($bDebug) {
echo "<pre>".$sql."</pre>", chr(10);
}
// execute query
$db2->query($sql);
while ($db2->next_record()) {
$sTypeIdentifier = "tblData.idtype = '".$db2->f('idtype')."' AND tblData.typeid = '".$db2->f('typeid')."'";
if ($sTypeIdentifier == $aSettings["HeadlineIdentifier"]) {
$aData["Item".($i + 1)]["Headline"] = strip_tags(urldecode($db2->f('value')));
} else if ($sTypeIdentifier == $aSettings["TextIdentifier"]) {
$sTmpValue = strip_tags(urldecode($db2->f('value')));
if (strlen($sTmpValue) > $aSettings["TeaserLength"]) {
// $sTmpValue = substr($sTmpValue, 0, $aSettings["TeaserLength"])."...";
$sTmpValue = capiStrTrimAfterWord($sTmpValue, $aSettings["TeaserLength"])." ...";
}
$aData["Item".($i + 1)]["Text"] = $sTmpValue;
} else if ($sTypeIdentifier == $aSettings["ImageIdentifier"]) {
$sql = "SELECT dirname, filename FROM ".$cfg["tab"]["upl"]." ";
$sql .= "WHERE idupl = '".$db2->f('value')."'";
// execute query
$db3->query($sql);
if ($db3->next_record()) {
$aData["Item".($i + 1)]["Image"]["ServerPath"] = $cfgClient[$client]["upl"]["path"].$db3->f('dirname').$db3->f('filename');
$aData["Item".($i + 1)]["Image"]["WebPath"] = $cfgClient[$client]["upl"]["htmlpath"].$db3->f('dirname').$db3->f('filename');
}
}
}
}
}
unset ($db2);
unset ($sql);
unset ($sql_items);
unset ($sIDCatArt);
unset ($sTmpValue);
#Zufall
$random = range(1, $aSettings["ArticleCount"]);
shuffle($random);
if ($aSettings["Zufall"]){
for ($i = 0; $i < $aSettings["MaxAus"]; $i++) {
$href = $sess->url("front_content.php?idcatart=".$aData["Item".($i + 1)]["IDCatArt"]);
echo '<table cellspacing="0" cellpadding="2" border="0" width="100%" style="margin-bottom: 15px;">', chr(10);
echo '<tr class="tabelle2"><td colspan="2">'.$aData["Item".($random[$i])]["Headline"].'</td></tr>', chr(10);
echo '<tr>', chr(10);
if ($aData["Item".($random[$i])]["Image"]["ServerPath"] != "" && file_exists($aData["Item".($random[$i])]["Image"]["ServerPath"])) {
#Scale image
$image = capiImgScale($aData["Item".($random[$i])]["Image"]["ServerPath"], $aSettings["ImageWidth"], $aSettings["ImageHeight"], false, false, 10, false);
#Get dimensions of scaled image
list ($width, $height, $type, $attr) = getimagesize($image);
echo '<td valign="top"><img src="'.$image.'" width="'.$width.'" height="'.$height.'" /></td>', chr(10);
}
echo'<td valign="top">'.$aData["Item".($random[$i])]["Text"].'<br /><a href="'.$href.'">'.mi18n("More...").'</a></td></tr></table>', chr(10);
}
}else{
for ($i = 0; $i < $aSettings["ArticleCount"]; $i++) {
$href = $sess->url("front_content.php?idcatart=".$aData["Item".($i + 1)]["IDCatArt"]);
echo '<table cellspacing="0" cellpadding="2" border="0" width="100%" style="padding-bottom: 5px;">', chr(10);
echo '<tr class="tabelle2"><td colspan="2">'.$aData["Item".($i + 1)]["Headline"].'</td></tr>', chr(10);
echo '<tr>', chr(10);
if ($aData["Item".($i + 1)]["Image"]["ServerPath"] != "" && file_exists($aData["Item".($i + 1)]["Image"]["ServerPath"])) {
#Scale image
$image = capiImgScale($aData["Item".($i + 1)]["Image"]["ServerPath"], $aSettings["ImageWidth"], $aSettings["ImageHeight"], false, false, 10, false);
#Get dimensions of scaled image
list ($width, $height, $type, $attr) = getimagesize($image);
echo '<td valign="top"><img src="'.$image.'" width="'.$width.'" height="'.$height.'" /></td>', chr(10);
}
echo'<td valign="top">'.$aData["Item".($i + 1)]["Text"].'<br /><a href="'.$href.'">'.mi18n("More...").'</a></td></tr></table>', chr(10);
}
}
}
?>
Bitte schaut mal drüber, da wie gesagt meine PHP-Künste nicht weit reichen.
Ciao,
Tom