[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/modules/ -> mod_archive.php (source)

   1  <?php
   2  /**
   3  * @version $Id: mod_archive.php 5885 2006-11-29 23:26:33Z predator $
   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  $count     = intval( $params->def( 'count', 10 ) );
  18  $now     = _CURRENT_SERVER_TIME;
  19  
  20  $query = "SELECT MONTH( created ) AS created_month, created, id, sectionid, title, YEAR(created) AS created_year"
  21  . "\n FROM #__content"
  22  . "\n WHERE ( state = -1 AND checked_out = 0 AND sectionid > 0 )"
  23  . "\n GROUP BY created_year DESC, created_month DESC"
  24  ;
  25  $database->setQuery( $query, 0, $count );
  26  $rows = $database->loadObjectList();
  27  
  28  if( count( $rows ) ) {
  29  
  30  echo '<ul>';
  31  
  32  foreach ( $rows as $row ) {
  33          $created_month  = mosFormatDate ( $row->created, "%m" );
  34          $month_name     = mosFormatDate ( $row->created, "%B" );
  35          $created_year   = mosFormatDate ( $row->created, "%Y" );
  36          $link            = sefRelToAbs( 'index.php?option=com_content&amp;task=archivecategory&amp;year='. $created_year .'&amp;month='. $created_month .'&amp;module=1' );
  37          $text           = $month_name .', '. $created_year;
  38          ?>
  39          <li>
  40                  <a href="<?php echo $link; ?>">
  41                          <?php echo $text; ?></a>
  42          </li>
  43          <?php
  44  }
  45  echo '</ul>';
  46  }
  47  ?>


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