Changeset 16352
- Timestamp:
- 05/09/08 10:33:24 (2 months ago)
- Files:
-
- branches/MidCOM_2_8/org.maemo.socialnews/config/manifest.inc (modified) (1 diff)
- branches/MidCOM_2_8/org.maemo.socialnews/documentation/CHANGES (modified) (1 diff)
- branches/MidCOM_2_8/org.maemo.socialnews/handler/latest.php (modified) (5 diffs)
- branches/MidCOM_2_8/org.maemo.socialnews/viewer.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/org.maemo.socialnews/config/manifest.inc
r16331 r16352 1 1 'name' => 'org.maemo.socialnews', 2 2 'purecode' => false, 3 'version' => '1.1. 3',3 'version' => '1.1.4', 4 4 'state' => 'stable', 5 5 'privileges' => array(), branches/MidCOM_2_8/org.maemo.socialnews/documentation/CHANGES
r14821 r16352 7 7 which might even break existing functionality. 8 8 - All items marked with "+" represent completely new features. 9 10 2008-05-09 xfade 11 + RSS feed for latest items 9 12 10 13 2007-08-29 bergie branches/MidCOM_2_8/org.maemo.socialnews/handler/latest.php
r15501 r16352 18 18 { 19 19 private $nodes = array(); 20 private $articles = array(); 20 21 21 22 /** … … 64 65 $_MIDCOM->componentloader->load_graceful('net.nemein.favourites'); 65 66 67 $data['node_title'] = $this->_config->get('socialnews_title'); 68 if (empty($data['node_title'])) 69 { 70 $data['node_title'] = $this->_topic->extra; 71 } 72 73 if ($handler_id == 'rss20_latest') 74 { 75 $_MIDCOM->load_library('de.bitfolge.feedcreator'); 76 $_MIDCOM->cache->content->content_type('text/xml; charset=UTF-8'); 77 $_MIDCOM->header('Content-type: text/xml; charset=UTF-8'); 78 $_MIDCOM->skip_page_style = true; 79 $data['feedcreator'] = new UniversalFeedCreator(); 80 $data['feedcreator']->title = $data['node_title']; 81 $data['feedcreator']->link = substr($_MIDCOM->get_host_prefix(), 0, -1) . $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 82 $data['feedcreator']->cssStyleSheet = false; 83 $data['feedcreator']->syndicationURL = "{$data['feedcreator']->link}rss.xml"; 84 } 85 66 86 return true; 67 87 } … … 80 100 $data['node_title'] = $this->_topic->extra; 81 101 } 82 midcom_show_style('index_latest_header');83 102 $qb = midcom_db_article::new_query_builder(); 84 103 $qb->add_constraint('topic.component', '=', 'net.nehmer.blog'); … … 87 106 $articles = $qb->execute(); 88 107 $date = ''; 108 109 if ($handler_id == 'rss20_latest') 110 111 { 112 $this->articles = $articles; 113 $this->_show_rss_items($handler_id, &$data); 114 return; 115 } 116 117 midcom_show_style('index_latest_header'); 89 118 foreach ($articles as $article) 90 119 { … … 111 140 midcom_show_style('index_latest_footer'); 112 141 } 142 143 /** 144 * Displays the feed 145 * 146 * @param mixed $handler_id The ID of the handler. 147 * @param mixed &$data The local request data. 148 */ 149 function _show_rss_items($handler_id, &$data) 150 { 151 // Add each article now. 152 153 if ($this->articles) 154 { 155 foreach ($this->articles as $article) 156 { 157 $data['article'] =& $article; 158 159 //FIXME! We need to do this the proper way. 160 161 /*$data['score'] = $this->articles_scores[$article->guid]; 162 $data['score_initial'] = $this->articles_scores_initial[$article->guid]; 163 164 if (isset($this->articles_attention[$article->guid])) 165 { 166 $data['attention'] = $this->articles_attention[$article->guid]; 167 }*/ 168 169 $data['score'] = 0; 170 171 midcom_show_style('feed-item'); 172 } 173 } 174 echo $data['feedcreator']->createFeed('RSS2.0'); 175 } 176 113 177 } 114 178 ?> branches/MidCOM_2_8/org.maemo.socialnews/viewer.php
r15990 r16352 88 88 'fixed_args' => Array('my_items.xml'), 89 89 ); 90 // Handle /latest.xml 91 $this->_request_switch['rss20_latest'] = array 92 ( 93 'handler' => Array('org_maemo_socialnews_handler_latest', 'latest'), 94 'fixed_args' => Array('latest.xml'), 95 ); 90 96 91 97 // The Archive
