XOOPS RMCommon Utilities  2.1.8.91RC
 All Classes Namespaces Files Functions Variables
rss.php
Go to the documentation of this file.
1 <?php
2 // $Id: rss.php 825 2011-12-09 00:06:11Z i.bitcero $
3 // --------------------------------------------------------------
4 // Red México Common Utilities
5 // A framework for Red México Modules
6 // Author: Eduardo Cortés <i.bitcero@gmail.com>
7 // Email: i.bitcero@gmail.com
8 // License: GPL 2.0
9 // --------------------------------------------------------------
10 
14 function show_rss_options(){
15  global $xoopsTpl, $xoopsConfig;
16 
17  include XOOPS_ROOT_PATH.'/header.php';
18  $xoopsTpl->assign('xoops_pagetitle', __('RSS Center','rmcommon'));
19 
20  $feeds = array();
21  $feeds = RMEvents::get()->run_event('rmcommon.get.feeds.list', $feeds);
22 
23  RMTemplate::get()->add_style('rss.css', 'rmcommon');
24  include RMTemplate::get()->get_template('rmc_rss_center.php', 'module', 'rmcommon');
25 
26  include XOOPS_ROOT_PATH.'/footer.php';
27 
28 }
29 
30 function show_rss_content(){
31  global $xoopsConfig;
32 
33  include_once $GLOBALS['xoops']->path('class/template.php');
34  $tpl = new XoopsTpl();
35  $module = rmc_server_var($_GET,'mod','');
36 
37  if($module==''){
38  redirect_header('backend.php', 1, __('Choose an option to see its feed','rmcommon'));
39  die();
40  }
41 
42  if (!file_exists(XOOPS_ROOT_PATH.'/modules/'.$module.'/rss.php')){
43  redirect_header('backend.php', 1, __('This module does not support rss feeds','rmcommon'));
44  die();
45  }
46 
47  $GLOBALS['xoopsLogger']->activated = false;
48  if (function_exists('mb_http_output')) {
49  mb_http_output('pass');
50  }
51  header('Content-Type:text/xml; charset=utf-8');
52 
53  include XOOPS_ROOT_PATH.'/modules/'.$module.'/rss.php';
54 
55  if (!isset($rss_channel['image'])){
57  $rss_channel['image']['url'] = $rmc_config['rssimage'];
58  $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.png');
59  $rss_channel['image']['width'] = ($dimention[0] > 144) ? 144 : $dimention[0];
60  $rss_channel['image']['height'] = ($dimention[1] > 400) ? 400 : $dimention[1];
61  }
62 
63  include RMTemplate::get()->get_template('rmc_rss.php', 'module', 'rmcommon');
64 
65 }
66 
67 $action = rmc_server_var($_GET, 'action', '');
68 
69 switch($action){
70  case 'showfeed':
72  break;
73  default:
75  break;
76 }