genau, da frag ich sie auch ab
ich frag ja auch CMS_HEAD und andere teile ab, alles da. nur mein CMS_IMG taucht irgends auf, obwohl das bild im eigentlichen artikel angezeigt wird.
ich poste mal den code
Code: Alles auswählen
<?
// selected category
$selcat = "CMS_VALUE[0]";
$maxlen = "CMS_VALUE[1]";
if (strlen($maxlen)<=0) $maxlen=100;
$box1titel="CMS_VALUE[8]";
$box2titel="CMS_VALUE[9]";
// template klasse includen
cInclude("classes", "class.template.php");
// template instanz
$tpl = new Template;
$tpl2 = new Template;
$tpl->reset();
$tpl2->reset();
$tpl->set('d','HTMLHEAD1',"CMS_HTMLHEAD[1]");
$tpl->set('d','HTMLHEAD2',"CMS_HTMLHEAD[2]");
$tpl->next();
if ((strlen($box1titel)==0) && (strlen($box2titel)==0))
$tpl->generate("templates/vds-top-full.html", false, false);
else
$tpl->generate("templates/vds-top.html", false, false);
/*******************************************************/
if($selcat!="0" && $selcat!="") {
$query = "SELECT ARTLANG.idart, ARTLANG.idartlang FROM ".$cfg["tab"]["cat_art"]." AS CATART, ".
$cfg["tab"]["art_lang"]." AS ARTLANG ".
"WHERE CATART.idcat = '$selcat' AND ARTLANG.idart = CATART.idart AND ARTLANG.idlang = '$lang' AND ".
"ARTLANG.online = '1' AND CATART.is_start='0' ORDER BY ARTLANG.artsort DESC";
$db->query($query);
unset($articleID);
unset($linkID);
// get id's of sub articles
while ($db->next_record()) {
$articleID[] = $db->f("idartlang");
$linkID[] = $db->f("idart");
} // end while
}
// loop through subarticles
$tpl->reset();
if (is_array($articleID)) {
foreach ($articleID as $key => $value) {
// select all CMS variables of the article
$sql = "SELECT * FROM ".$cfg["tab"]["content"]." WHERE idartlang = '$value'";
$db->query($sql);
//get content data
while ($db->next_record()) {
$dbtext = urldecode($db->f("value"));
$type = $db->f("idtype");
$id = $db->f("typeid");
//parse content data
echo "hier: ".$type.":".$typeid.":".$dbtext."<br>";
switch($type) {
//CMS_HTMLHEAD
case 1: if ($id==1) $title=$dbtext;
if ($id==2) $subtitle=$dbtext;
break;
//CMS_HTML
case 2: if($id==1) $text=strip_tags($dbtext);
break;
//CMS_IMG
case 6: if($id==1)$img=$dbtext;
break;
//CMS_HEAD
case 9: break;
}
if ( strlen($text) > $maxlen) {
$text = substr($text, 0, $maxlen);
$text = substr($text,0,strrpos($text," "))." ...";
}
// link
$link = $sess->url("front_content.php?client=$client&lang=$lang&idcat=$selcat&idart=$linkID[$key]&m=$m&s=$s");
unset($type); unset($id); unset($dbtext);
} //end while
//check for thumbnailpath
if (strlen($img)==0) $img="images/thumbblank.jpg";
echo "IMG: ".$img."<br>";
$basepath=$cfgClient[$client]["path"]["frontend"];
$path=$basepath.substr($img,0,strrpos($img,'/')+1);
if (!file_exists($path."/thumbs")) {
if (!mkdir($path."/thumbs")) {
echo "Error on create thumbs directory<br>";
}
}
//check for thumbnail
$file=substr($img,strrpos($img,'/')+1);
$file=substr($file,0,strlen($file)-4);
$fileend=substr($img,strrpos($img,'.')+1);
$thumb=$path."thumbs/".$file."_k.".$fileend;
if(!file_exists($thumb)) {
$file=$path.$file.".".$fileend;
system("/usr/bin/convert -scale 100x100 ".$file." ".$thumb);
}
$thumb=substr($thumb,strlen($basepath));
//Ausgabe der Produkte
$tpl->set('d','IMAGE',$thumb);
$tpl->set('d','TITLE',$title);
$tpl->set('d','SUBTITLE',$subtitle);
$tpl->set('d','TEXT',$text);
$tpl->set('d','LINK',$link);
$tpl->next();
unset($text); unset($title); unset($subtitle); unset($file); unset($path);
unset($thumb);
} // end foreach
} //end if(array)
$tpl->generate('templates/vds-bildlist-item.html',false,false);
/***************************************************/
$tpl->reset();
if ((strlen($box1titel)!=0) || (strlen($box2titel)!=0)) {
if(strlen($box1titel)!=0) {
$tpl->set('d','TITEL',$box1titel);
$tpl->set('d','INHALT',"CMS_HTML[2]");
$tpl->next();
}
if(strlen($box2titel)!=0) {
$tpl->set('d','TITEL',$box2titel);
$tpl->set('d','INHALT',"CMS_HTML[3]");
$tpl->next();
}
$tpl->generate("templates/vds-bottom.html", false, false);
} else
$tpl->generate("templates/vds-bottom-full.html", false, false);
?>