/** * Gets one item and definition from the database * * @param integer $id Glossary ID * @return array */ public function getGlossaryItem($id) { $item = array(); $query = sprintf("\n SELECT\n id, item, definition\n FROM\n %sfaqglossary\n WHERE\n id = %d AND lang = '%s'", SQLPREFIX, (int) $id, $this->language); $result = $result = $this->db->query($query); while ($row = $this->db->fetchObject($result)) { $item = array('id' => $row->id, 'item' => stripslashes($row->item), 'definition' => stripslashes($row->definition)); } return $item; }
/** * Fetches a news entry identified by its ID * * @param integer $id ID of news * @param boolean $admin Is admin * * @return array */ function getNewsEntry($id, $admin = false) { $news = array(); $query = sprintf("SELECT\n *\n FROM\n %sfaqnews\n WHERE\n id = %d\n AND\n lang = '%s'", SQLPREFIX, $id, $this->language); $result = $this->db->query($query); if ($this->db->numRows($result) > 0) { if ($row = $this->db->fetchObject($result)) { $content = $row->artikel; $active = 'y' == $row->active; $allowComments = 'y' == $row->comment; $expired = date('YmdHis') > $row->date_end; if (!$admin) { if (!$active) { $content = $this->pmf_lang['err_inactiveNews']; } if ($expired) { $content = $this->pmf_lang['err_expiredNews']; } } $news = array('id' => $row->id, 'lang' => $row->lang, 'date' => PMF_Date::createIsoDate($row->datum), 'header' => $row->header, 'content' => $content, 'authorName' => $row->author_name, 'authorEmail' => $row->author_email, 'dateStart' => $row->date_start, 'dateEnd' => $row->date_end, 'active' => $active, 'allowComments' => $allowComments, 'link' => $row->link, 'linkTitle' => $row->linktitel, 'target' => $row->target); } } return $news; }