$proyectos[$f][$rrr['ID______CON']] = $cont->getHTML(true);
                             $c++;
                             if ($c >= 4) {
                                 $c = 0;
                                 $f++;
                             }
                         }
                     }
                 }
             }
             if (empty($proyectos)) {
                 $cat = $row['ID______CAT'];
                 if ($subCursor2 = $sql->readDB("CONTENIDO", "ESTADO__CON='A' AND CATEGORICON='{$cat}'", "ORDEN___CON")) {
                     while ($rrr = $subCursor2->fetch_assoc()) {
                         $cont = new Contenido($rrr['ID______CON']);
                         $proyectos[$f][$rrr['ID______CON']] = $cont->getHTML(true);
                         $c++;
                         if ($c >= 4) {
                             $c = 0;
                             $f++;
                         }
                     }
                 }
             }
         }
     }
 }
 if (isset($proyectos[0])) {
     $tpl->COLS = "3";
     if (count($proyectos[0]) < 4) {
         $tpl->COLS = (string) floor(12 / count($proyectos[0]));
<?php

include_once "common.php";
include_once "HTML/Template/Flexy.php";
include_once "classes/Contenido.php";
$tpl = new stdClass();
$cursor = $sql->readDB("CONTENIDO,CATEGORIA", "ESTADO__CON='A' AND ID______CAT=CATEGORICON");
if ($cursor->num_rows > 0) {
    while ($row = $cursor->fetch_assoc()) {
        $group = $row['ID______CAT'];
        $key = $row['ID______CON'];
        $cont = new Contenido($row['ID______CON']);
        $tpl->CONTENIDO[$group][$key] = $cont->getHTML();
    }
}
$tpl->CONFIGURACION = array();
$cursor = $sql->readDB("CONFIGURACION");
if ($cursor->num_rows > 0) {
    while ($row = $cursor->fetch_assoc()) {
        $key = url_slug($row['NOMBRE__CFG']);
        $tpl->CONFIGURACION[$key] = $row['VALOR___CFG'];
    }
}
$options = array('compileDir' => $install . '/tmp/', 'templateDir' => $install . '/template/');
$output = new HTML_Template_Flexy($options);
$output->compile('index.html');
$output->outputObject($tpl);
/*
function($string){
    return strip_tags($string);
}