[ Index ]
 

Code source de Typo3 4.1.3

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/typo3/sysext/cms/tslib/media/scripts/ -> makeMenu_datedirectory.inc (source)

   1  <?php
   2  /***************************************************************
   3  *  Copyright notice
   4  *
   5  *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
   6  *  All rights reserved
   7  *
   8  *  This script is part of the TYPO3 project. The TYPO3 project is
   9  *  free software; you can redistribute it and/or modify
  10  *  it under the terms of the GNU General Public License as published by
  11  *  the Free Software Foundation; either version 2 of the License, or
  12  *  (at your option) any later version.
  13  *
  14  *  The GNU General Public License can be found at
  15  *  http://www.gnu.org/copyleft/gpl.html.
  16  *  A copy is found in the textfile GPL.txt and important notices to the license
  17  *  from the author is found in LICENSE.txt distributed with these scripts.
  18  *
  19  *
  20  *  This script is distributed in the hope that it will be useful,
  21  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  22  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23  *  GNU General Public License for more details.
  24  *
  25  *  This copyright notice MUST APPEAR in all copies of the script!
  26  ***************************************************************/
  27  /**
  28   * Date directory
  29   * Can be used with the HMENU cObject, special property set to "userdefined".
  30   *
  31   * $Id: makeMenu_datedirectory.inc 593 2005-04-01 14:37:15Z typo3 $
  32   * Revised for TYPO3 3.6 June/2003 by Kasper Skaarhoj
  33   *
  34   * @author    Olaf.Schuemann@erz.be.ch
  35   * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=358&cHash=5400c1c06a
  36   * @see makeMenu_keywords_updated.inc
  37   */
  38  
  39  
  40  if (!is_object($this)) die ('Error: No parent object present.');
  41  
  42  
  43  
  44  
  45  
  46  $day = $conf['day'];
  47  $name =    $conf['name'];
  48  $menuItemsArray = array();
  49  
  50  if ($day==-1) $day=date('w');
  51  if ($day==date('w')) {
  52      $son=mktime(0,0,0,date('m'),date('d'),date('Y'));
  53  } else {
  54      for ($i=1;;$i++) {
  55          $son=mktime(0,0,0,date('m'),date('d')-$i,date('Y'));
  56          if ($day==date('w',$son)) break;
  57          if ($i>100) break;    // Security that it's not an eternal loop.
  58      }
  59  }
  60  
  61  $date = date('Y-m-d', $son);
  62  $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'title LIKE '.$GLOBALS['TYPO3_DB']->fullQuoteStr($name.$date, 'pages'));  // get the uid of the page
  63  $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
  64  
  65  $value=$row['uid'];
  66  
  67  if ($value=='') {
  68      $value=$GLOBALS['TSFE']->page['uid'];
  69  }
  70  $items=t3lib_div::intExplode(',',$value);
  71  while(list(,$id)=each($items))        {
  72      $res = $GLOBALS['TSFE']->cObj->exec_getQuery('pages',Array('pidInList'=>$id,'orderBy'=>$altSortField));
  73      while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))        {
  74          $menuItemsArray[]=$row;
  75      }
  76  }
  77  
  78  ?>


Généré le : Sun Nov 25 17:13:16 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics