X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/19284c51bfd93be9cb66ff7c7246958e95956fa5..80e7fe0c5252de7db56416187636dac4e0f6fcdf:/sistema/local_lib/HTML_Titulares.php?ds=inline diff --git a/sistema/local_lib/HTML_Titulares.php b/sistema/local_lib/HTML_Titulares.php index 12542b1..1ab8314 100644 --- a/sistema/local_lib/HTML_Titulares.php +++ b/sistema/local_lib/HTML_Titulares.php @@ -66,23 +66,29 @@ class HTML_Titulares extends HTML_Table { function HTML_Titulares($grupo_secciones = null, $antiguedad = null) // ~X2C { parent::HTML_Table(array('width'=>'600', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0')); + $db2 = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME $db = MEconDAVDB::Connect(); $hoy = new Date(); $fecha_nuevo = $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 "; + WHERE Articles.article_publication_state_id = + ArticlePublicationStates.article_publication_state_id + AND ArticlePublicationStates.publication_state_id=5 "; if(!is_null($grupo_secciones)) { - $db2 = DB::Connect('mysql://intranet:intranet@bal747f/intranet');//FIXME $gs = new AI_GrupoSecciones($grupo_secciones); - $gs->cargar($db2); - if(count($gs->secciones) > 0) - $query .= 'AND Articles.section_id IN('.implode(',', $gs->secciones).') '; + $gs->cargar($db2); + if(count($gs->secciones) > 0) + $query .= ' AND Articles.section_id IN('.implode(',', $gs->secciones).') '; } + else{ + $censuradas = $db2->getCol('SELECT seccion FROM secciones_censuradas'); + $query .= ' AND Articles.section_id NOT IN('.implode(',', $censuradas).') '; + + } + if(!is_null($antiguedad)) { $hoy->subtractSeconds(60*60*24*$antiguedad); @@ -91,17 +97,25 @@ class HTML_Titulares extends HTML_Table { } $query .= "ORDER BY Articles.publication_date desc"; $result = $db->query($query); + $this->numero_noticias = $result->numRows();//FIXME no documentado if(DB::isError($result)) die($result->getMessage("query mal hecho")); - $ht1 = new HTML_Table(array('width'=>'300', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0')); - $ht2 = new HTML_Table(array('width'=>'300', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0')); + $ht1 = new HTML_Table(array('width'=>'280', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0')); + $ht2 = new HTML_Table(array('width'=>'280', 'border'=>'0', 'cellspacing'=>'0', 'cellpadding' => '0')); $impar = true; while($row = $result->fetchRow()) { $n = new noticia($row[0]); + if(!isset($this->primera_noticia)) $this->primera_noticia = $n; + if(!is_null($grupo_secciones)) $n->seccion = null; $not = new HTML_Noticia($n); $not->setLink("una_noticia.php?numero=$row[0]"); - $not->setVerMas("noticias?grupo=TODO"); + if(is_null($grupo_secciones)) + { + //$n->getIdSeccion(); + $not->setVerMas("noticias?grupo=". + AI_GrupoSecciones::getGrupo($n->getIdSeccion(), $db2)); + } if($row[1] == 'NUEVA') $not->setNuevo(true); if($impar) @@ -122,5 +136,16 @@ class HTML_Titulares extends HTML_Table { } // -X2C + // +X2C Operation 196 + /** + * @return void + * @access public + */ + function getCSS() // ~X2C + { + return "css/noticias.css"; + } + // -X2C + } // -X2C Class :HTML_Titulares ?>