[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/modules/ -> mod_rssfeed.php (source)

   1  <?php
   2  /**
   3  * @version $Id: mod_rssfeed.php 4079 2006-06-20 17:41:01Z stingrey $
   4  * @package Joomla
   5  * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
   6  * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // no direct access
  15  defined( '_VALID_MOS' ) or die( 'Restricted access' );
  16  
  17  if (!defined( '_JOS_RSSFEED_MODULE' )) {
  18      /** ensure that functions are declared only once */
  19      define( '_JOS_RSSFEED_MODULE', 1 );    
  20      
  21  	function output_rssfeed( $link, $img_default, $img_file, $img_alt, $img_name  ) {    
  22          $img = mosAdminMenus::ImageCheck( $img_default, '/images/M_images/', $img_file, '/images/M_images/', $img_alt, $img_name );
  23          ?>
  24          <div align="center">
  25              <a href="<?php echo sefRelToAbs( $link ); ?>">
  26                  <?php echo $img ?></a>
  27          </div>
  28          <?php
  29      }
  30  }
  31  
  32  global $mosConfig_live_site, $mosConfig_absolute_path, $cur_template;
  33  
  34  $text                 = $params->get( 'text',             '');
  35  $moduleclass_sfx     = $params->get( 'moduleclass_sfx',     '' );
  36  $rss091              = $params->get( 'rss091',             1 );
  37  $rss10              = $params->get( 'rss10',             1 );
  38  $rss20              = $params->get( 'rss20',             1 );
  39  $atom03                = $params->get( 'atom',             1 );
  40  $opml                  = $params->get( 'opml',             1 );
  41  $rss091_image        = $params->get( 'rss091_image',     '' );
  42  $rss10_image        = $params->get( 'rss10_image',         '' );
  43  $rss20_image        = $params->get( 'rss20_image',         '' );
  44  $atom_image            = $params->get( 'atom_image',         '' );
  45  $opml_image            = $params->get( 'opml_image',         '' );
  46  
  47  $cur_template         = $mainframe->getTemplate();
  48  $t_path             = $mosConfig_live_site .'/templates/'. $cur_template .'/images/';
  49  $d_path                = $mosConfig_live_site .'/images/M_images/';
  50  
  51  // needed to reduce query
  52  if ( isset( $GLOBALS['syndicateParams'] ) ) {
  53  // load value stored in GLOBALS
  54      $syndicateParams = $GLOBALS['syndicateParams'];
  55  } else {
  56  // query to oull syndication component params
  57      $query = "SELECT a.*"
  58      . "\n FROM #__components AS a"
  59      . "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )"
  60      . "\n AND a.option = 'com_syndicate'"
  61      ;
  62      $database->setQuery( $query );
  63      $database->loadObject( $row );
  64      
  65      // get params definitions
  66      $syndicateParams = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' );
  67  }
  68  
  69  // check for disabling/enabling of selected feed types
  70  if ( !$syndicateParams->get( 'rss091', 1 ) ) {
  71      $rss091 = 0;
  72  }
  73  if ( !$syndicateParams->get( 'rss10', 1 ) ) {
  74      $rss10 = 0;
  75  }
  76  if ( !$syndicateParams->get( 'rss20', 1 ) ) {
  77      $rss20 = 0;
  78  }
  79  if ( !$syndicateParams->get( 'atom03', 1 ) ) {
  80      $atom03 = 0;
  81  }
  82  if ( !$syndicateParams->get( 'opml', 1 ) ) {
  83      $opml = 0;
  84  }
  85  ?>
  86  <div class="syndicate<?php echo $moduleclass_sfx;?>">
  87      <?php
  88      // text
  89      if ( $text ) {
  90          ?>
  91          <div align="center" class="syndicate_text<?php echo $moduleclass_sfx;?>">
  92              <?php echo $text;?>
  93          </div>
  94          <?php
  95      }
  96  
  97      // rss091 link
  98      if ( $rss091 ) {
  99          $link = 'index.php?option=com_rss&amp;feed=RSS0.91&amp;no_html=1';
 100          output_rssfeed( $link, 'rss091.gif', $rss091_image, 'RSS 0.91', 'RSS091' );
 101      }
 102  
 103      // rss10 link
 104      if ( $rss10 ) {
 105          $link = 'index.php?option=com_rss&amp;feed=RSS1.0&amp;no_html=1';
 106          output_rssfeed( $link, 'rss10.gif', $rss10_image, 'RSS 1.0', 'RSS10' );
 107      }
 108      
 109      // rss20 link
 110      if ( $rss20 ) {
 111          $link = 'index.php?option=com_rss&amp;feed=RSS2.0&amp;no_html=1';
 112          output_rssfeed( $link, 'rss20.gif', $rss20_image, 'RSS 2.0', 'RSS20' );
 113      }
 114  
 115      // atom link
 116      if ( $atom03 ) {
 117          $link = 'index.php?option=com_rss&amp;feed=ATOM0.3&amp;no_html=1';
 118          output_rssfeed( $link, 'atom03.gif', $atom_image, 'ATOM 0.3', 'ATOM03' );
 119      }
 120      
 121      // opml link
 122      if ( $opml ) {
 123          $link = 'index.php?option=com_rss&amp;feed=OPML&amp;no_html=1';
 124          output_rssfeed( $link, 'opml.png', $opml_image, 'OPML', 'OPML'  );
 125      }
 126      ?>
 127  </div>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics