X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/f8d2d0db50d7c90d76772cacd1439d44396800ed..4efd69487fe607a41bd11143b8dac10e5365aac9:/lib/noticia.php diff --git a/lib/noticia.php b/lib/noticia.php index 1f9a665..182edab 100644 --- a/lib/noticia.php +++ b/lib/noticia.php @@ -2,16 +2,16 @@ // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: // +--------------------------------------------------------------------+ // | Ministerio de Economía | -// | Intranet | +// | Intranet | // +--------------------------------------------------------------------+ -// | This file is part of Intranet. | +// | This file is part of Intranet. | // | | -// | Intranet is free software; you can redistribute it and/or modify | +// | Intranet is free software; you can redistribute it and/or modify | // | it under the terms of the GNU General Public License as published | // | by the Free Software Foundation; either version 2 of the License, | // | or (at your option) any later version. | // | | -// | Intranet is distributed in the hope that it will be useful, but | +// | Intranet is distributed in the hope that it will be useful, but | // | WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | // | General Public License for more details. | @@ -20,16 +20,15 @@ // | along with Hooks; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | // +--------------------------------------------------------------------+ -// | Creado: Thu Jul 3 14:49:15 2003 | -// | Autor: Gonzalo Merayo | +// | Creado: Thu Jul 3 14:49:15 2003 | +// | Autor: Gonzalo Merayo | // +--------------------------------------------------------------------+ // // $Id: xmi2code.tpl.php 1 2003-06-23 18:29:20Z gmeray $ // -require_once 'mecondavdb.php'; require_once 'Date.php'; - +require_once 'intranetdb.php'; // +X2C Class 161 :noticia /** @@ -54,10 +53,10 @@ class noticia { function noticia($noticia) // ~X2C { $this->noticia = $noticia; - $db = MEconDAVDB::Connect(); + $db = IntranetDB::Connect(); $query = "SELECT A.headline, A.title, A.abstract, A.article, A.publication_date, S.description, S.section_id - FROM Articles A, Sections S + FROM MEconDAV.Articles A, MEconDAV.Sections S WHERE Article_id = $noticia AND A.section_id = S.section_id"; $result = $db->query($query); @@ -157,8 +156,15 @@ class noticia { function getLinks() // ~X2C { $db = MEconDAVDB::Connect(); - $sql = "SELECT link_id FROM Relations WHERE article_id = ".$this->noticia; - return $db->getCol($sql); + $sql = "SELECT R.link_id, A.headline + FROM MEconDAV.Relations R, MEconDAV.Articles A + WHERE R.link_id = A.article_id + AND R.article_id = ".$this->noticia; + $result =& $db->query($sql); + $links = array(); + while($row =& $result->fetchRow()) + $links[] = array('numero'=>$row[0], 'texto'=>$row[1]); + return $links; } // -X2C @@ -170,10 +176,10 @@ class noticia { function getArchivos() // ~X2C { $db = MEconDAVDB::Connect(); - $sql = "SELECT file_for_article_id, caption FROM FilesForArticle WHERE article_id = ".$this->noticia; + $sql = "SELECT file_for_article_id, caption FROM MEconDAV.FilesForArticle WHERE article_id = ".$this->noticia; $result =& $db->query($sql); $archivos = array(); - while($row =& $result->getRow()) + while($row =& $result->fetchRow()) $archivos[] = array('numero'=>$row[0], 'texto'=>$row[1]); return $archivos; }