[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 3 if (!defined('e107_INIT')) { exit; } 4 5 6 7 require_once(e_PLUGIN."content/handlers/content_class.php"); 8 $aa = new content; 9 10 //##### create feed for admin, return array $eplug_rss_feed -------------------------------- 11 $feed = get_rss(); 12 foreach($feed as $k=>$v){ 13 $eplug_rss_feed[] = $v; 14 } 15 16 function get_rss(){ 17 global $aa; 18 19 require_once(e_PLUGIN."content/handlers/content_class.php"); 20 $aa = new content; 21 $rss = array(); 22 $array = $aa -> getCategoryTree('', '', FALSE); 23 foreach($array as $k=>$v){ 24 $name = ''; 25 for($i=0;$i<count($array[$k]);$i++){ 26 $name .= $array[$k][$i+1]." > "; 27 $i++; 28 } 29 $name = substr($name,0,-3); 30 $feed['name'] = $name; 31 $feed['url'] = 'content'; //the identifier for the rss feed url 32 $feed['topic_id'] = $k; //the topic_id, empty on default (to select a certain category) 33 $feed['path'] = 'content'; //this is the plugin path location 34 $feed['text'] = 'this is the rss feed for content category : '.$name; 35 $feed['class'] = '0'; 36 $feed['limit'] = '9'; 37 $rss[] = $feed; 38 } 39 return $rss; 40 } 41 //##### ------------------------------------------------------------------------------------ 42 43 44 //##### create rss data, return as array $eplug_rss_data ----------------------------------- 45 $mainparent = $aa -> getMainParent($this->topicid); 46 $content_pref = $aa -> getContentPref($mainparent); 47 $array = $aa -> getCategoryTree("", $mainparent, TRUE); 48 $datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") "; 49 $qry = " content_refer !='sa' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '".$this->topicid."' ORDER BY content_datestamp DESC LIMIT 0,".$this -> limit; 50 51 $rss = array(); 52 $sqlrss = new db; 53 if($items = $sqlrss -> db_Select('pcontent', "*", $qry )){ 54 $i=0; 55 while($rowrss = $sqlrss -> db_Fetch()){ 56 //$author = array($author_id, $author_name, $author_email, $content_author); 57 $author = $aa -> getAuthor($rowrss['content_author']); 58 $rss[$i]['author'] = $author[1]; 59 $rss[$i]['author_email'] = $author[2]; 60 $rss[$i]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."content/content.php?content.".$rowrss['content_id']; 61 $rss[$i]['linkid'] = $rowrss['content_id']; 62 $rss[$i]['title'] = $rowrss['content_heading']; 63 $rss[$i]['description'] = $rowrss['content_subheading']; 64 $rss[$i]['category_name'] = $array[$rowrss['content_parent']][count($array[$rowrss['content_parent']])-1]; 65 $rss[$i]['category_link'] = $e107->base_path.$PLUGINS_DIRECTORY."content/content.php?cat.".$rowrss['content_parent']; 66 $rss[$i]['datestamp'] = $rowrss['content_datestamp']; 67 $rss[$i]['enc_url'] = ""; 68 $rss[$i]['enc_leng'] = ""; 69 $rss[$i]['enc_type'] = ""; 70 $i++; 71 } 72 } 73 $eplug_rss_data[] = $rss; 74 //##### ------------------------------------------------------------------------------------ 75 76 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |