X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/f8d2d0db50d7c90d76772cacd1439d44396800ed..597cf91746ea3180c081454db3588780da4e57fc:/lib/noticia.php?ds=inline diff --git a/lib/noticia.php b/lib/noticia.php index 1f9a665..fc41b80 100644 --- a/lib/noticia.php +++ b/lib/noticia.php @@ -157,8 +157,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 Relations R, 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 @@ -173,7 +180,7 @@ class noticia { $sql = "SELECT file_for_article_id, caption FROM 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; }