0); function RssFeed($id = null) { $this->DBObj($id); $this->tblIndividual = $this->db->tblMember; } function getList4Individual_old() { $sql = " SELECT * FROM {$this->tableNameDB} as Rss JOIN {$this->tblIndividual}2Rss as Individual2Rss ON Individual2Rss.id_rss = Rss.id AND Individual2Rss.id_parent = ".$this->db->quote($this->memberData['id'], 'integer')." WHERE Rss.active = 'y' AND Rss.is_default='y' ORDER BY Individual2Rss.sorter "; $res = $this->db->queryAll($sql); $this->_sqlError($res); return $res; } function getList4Individual($id_individual) { $id_individual = intval($id_individual); $sql = " SELECT Rss.id, Rss.id_individual, Rss.title, Rss.url, Rss.active FROM {$this->db->tblRss} as Rss LEFT JOIN {$this->db->tblMember2Rss} as Member2Rss ON Member2Rss.id_parent = {$id_individual} AND Member2Rss.id_rss = Rss.id WHERE (Rss.id_individual = 0 AND Rss.active = 'y' AND (Member2Rss.active = 'y' OR Member2Rss.active IS NULL) ) OR (Rss.id_individual = {$id_individual} AND (Member2Rss.active = 'y' OR Member2Rss.active IS NULL) ) ORDER BY Member2Rss.sorter "; $list = $this->db->queryAll($sql); return $list; } function getFeedData() { $this->initFromDB(); require_once('Zend/Loader.php'); if ($this->getData('url') === null) { return array('error'=>'This RSS feed is unavailable.'); } try { Zend_Loader::loadClass('Zend_Feed_Rss'); $slashdotRss = new Zend_Feed_Rss($this->getData('url')); } catch (Exception $e) { return array('error'=>'This RSS feed is unavailable.'); } $channel = array( 'id' => $this->id, 'title' => $slashdotRss->title(), 'link' => $slashdotRss->link(), 'description' => $slashdotRss->description(), 'items' => array() ); foreach ($slashdotRss as $item) { $channel['items'][] = array( 'title' => $item->title(), 'link' => $item->link(), 'description' => $item->description() ); } return $channel; } function _getWhere4Grid($opt = array()) { $where = DBObj::_getWhere4Grid($opt); $where .= " AND {$this->tableName}.id_individual = 0 "; return $where; } function insert($data = null, $files = null) { if (!is_null($data)) { $this->initFromArray($data, $files); } $this->_initTable(); $data = $this->_data; unset($data['id']); $fields = $this->getSimpleFieldList(); if (isset($fields['sorter'])) { $data['sorter'] = $this->getSorter(" 1 AND id_individual = 0 "); } $this->id = $this->table->insert($data); $this->handleFiles(); return $this->id; } }