loadTemplatefile("tpl_index.html", true, true); $prod = new catalogue($dsn ,$liensStruct); $tree = Tree::setup( 'Memory_DBnested', $dsn, // the DSN $treecatOptions); $tree->setup(); $this_cat_descendance = $tree->getNode($_GET[cat_id]); foreach ($this_cat_descendance as $categorie){ $error = ''; $cat_nom = array(); if($prod->count_prod($categorie[id])) { $list = $prod->search_prod($categorie[id]); foreach($list as $key=>$val) { $pho = $prod->get_pho($val[lien_id]); if($pho) { $image = ''; } else { $image = ''; } $tplData = array( 'titre'=>$val[titre],'description'=>nl2br($val[description]),'url'=>$val[url],'image'=>$image ); $tpl->setCurrentBlock("liste") ; $tpl->setVariable($tplData) ; $tpl->parseCurrentBlock("liste") ; } $parents_cat = $tree->getPathAsString($categorie[id],' >> '); $parents_cat = preg_replace("'^.*? >>'si",'',$parents_cat ); $tplCatData =array('titre_cat'=>$parents_cat); $tpl->setCurrentBlock("categorie") ; $tpl->setVariable($tplCatData) ; $tpl->parseCurrentBlock("categorie") ; } } $tpl->show(); flush(); ?>