-<body bgcolor="#FFFFFF" class="subtitulo" link="#003366" vlink="#660066" alink="#0066FF" topmargin="0">
<?
- require_once '../local_lib/copete.php';
- $c = new Copete('noticias');
- echo $c->toHTML();
-?>
-<table width='760' border='0'>
- <tr>
- <td width='160' valign='top'>
- <?
- require_once '../local_lib/intranetdb.php';
- require_once 'MECON/HTML/Arbol/ArbolDB.php';
- $db = IntranetDB::connect();
- $dbdata = array(
+ require_once '../local_lib/HTML_DietMarco.php';
+ require_once '../local_lib/intranetdb.php';
+ require_once 'MECON/HTML/Arbol/ArbolDB.php';
+ require_once '../local_lib/HTML_Titulares.php';
+
+ $m = new HTML_DietMarco('noticias');
+ $m->addTitle('Noticias');
+
+ $noticias = new HTML_Table(array('width' => '760', 'border' => '0'));
+ if(isset($_GET['grupo']))
+ {
+ $grupo = $_GET['grupo'];
+ $dias = null;
+ }
+ else
+ {
+ $grupo = null;
+ $dias = 7;
+ }
+ //Esto va a cambiar...
+ $db = IntranetDB::connect();
+ $dbdata = array(
'db' => $db,
'tabla' => 'grupo_secciones',
'id' => 'grupo',
+ 'id_activo' => $grupo,
'nombre' => 'nombre',
'id_padre' => 'grupo_padre',
'prepend_link' => 'noticias.php?grupo=');
- $arbol = new HTML_ArbolDB($dbdata, '/MECON/images/arbol_noticias.gif');
- echo $arbol->toHTML();
- ?>
- </td>
- <td width='600'>
- <?
- require_once '../../lib/noticia.php';
- require_once '../local_lib/HTML_Noticia.php';
- require_once '../../lib/mecondavdb.php';
- $db = MEconDAVDB::Connect();
- $hoy = new Date();
- $fecha_nuevo = $hoy->format('%Y-%m-%d');
- $hoy->subtractSeconds(60*60*24*7);//7 dias
- $fecha_limite = $hoy->format('%Y-%m-%d');
- $query = "SELECT Articles.article_id,
- IF(Articles.publication_date > '$fecha_nuevo', 'NUEVA', null)
- FROM Articles, ArticlePublicationStates
- WHERE Articles.article_publication_state_id =
- ArticlePublicationStates.article_publication_state_id
- AND ArticlePublicationStates.publication_state_id=5
- AND Articles.publication_date > '$fecha_limite'
- ORDER BY Articles.publication_date desc";
- $result = $db->query($query);
- if(DB::isError($result))
- die($result->getMessage("query mal hecho"));
- $ht = new HTML_Table(array('width'=>'600', 'border'=>'0', 'cellspacing'=>'0'));
- $not1 = $not2 = null;
- while($row = $result->fetchRow())
- {
-
- $n = new noticia($row[0]);
- $not = new HTML_Noticia($n);
- if($row[1] == 'NUEVA')
- $not->setNuevo(true);
- if(is_null($not1)) $not1 = $not;
- elseif(is_null($not2))
- {
- $not2 = $not;
- $ht->addRow(array($not1, $not2));
- }
- else
- {
- $not1 = $not;
- $not2 = null;
- }
- }
- if(is_null($not2)) $ht->addRow(array($not1));
- $ht->display();
- ?>
- </td>
- </tr>
-</table>
-</body>
+ $arbol = new HTML_ArbolDB($dbdata, 'NOTICIAS');
+
+ $titulares = new HTML_Titulares($grupo, $dias);
+ $noticias->addRow(array($arbol,$titulares));
+ $m->addStyleSheet($arbol->getCSS());
+ $m->addStyleSheet($titulares->getCSS());
+ $noticias->updateCellAttributes(0, 0, array('valign'=>'top', 'width'=>'160'));
+ $noticias->updateCellAttributes(0, 1, array('valign'=>'top', 'width'=>'600'));
+
+ $m->addBodyContent($noticias);
+ $m->display();
+?>