"TYPO3 4.0.1: typo3_src-4.0.1/typo3/sysext/cms/tslib/media/scripts/makeMenu_datedirectory.inc Source File", "datetime" => "Sat Dec 2 19:22:30 2006", "date" => "2 Dec 2006", "doxygenversion" => "1.4.6", "projectname" => "TYPO3 4.0.1", "projectnumber" => "4.0.1" ); get_header($doxygen_vars); ?>
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com) 00006 * All rights reserved 00007 * 00008 * This script is part of the TYPO3 project. The TYPO3 project is 00009 * free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * The GNU General Public License can be found at 00015 * http://www.gnu.org/copyleft/gpl.html. 00016 * A copy is found in the textfile GPL.txt and important notices to the license 00017 * from the author is found in LICENSE.txt distributed with these scripts. 00018 * 00019 * 00020 * This script is distributed in the hope that it will be useful, 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 * GNU General Public License for more details. 00024 * 00025 * This copyright notice MUST APPEAR in all copies of the script! 00026 ***************************************************************/ 00040 if (!is_object($this)) die ('Error: No parent object present.'); 00041 00042 00043 00044 00045 00046 $day = $conf['day']; 00047 $name = $conf['name']; 00048 $menuItemsArray = array(); 00049 00050 if ($day==-1) $day=date('w'); 00051 if ($day==date('w')) { 00052 $son=mktime(0,0,0,date('m'),date('d'),date('Y')); 00053 } else { 00054 for ($i=1;;$i++) { 00055 $son=mktime(0,0,0,date('m'),date('d')-$i,date('Y')); 00056 if ($day==date('w',$son)) break; 00057 if ($i>100) break; // Security that it's not an eternal loop. 00058 } 00059 } 00060 00061 $date = date('Y-m-d', $son); 00062 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'title LIKE '.$GLOBALS['TYPO3_DB']->fullQuoteStr($name.$date, 'pages')); // get the uid of the page 00063 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); 00064 00065 $value=$row['uid']; 00066 00067 if ($value=='') { 00068 $value=$GLOBALS['TSFE']->page['uid']; 00069 } 00070 $items=t3lib_div::intExplode(',',$value); 00071 while(list(,$id)=each($items)) { 00072 $res = $GLOBALS['TSFE']->cObj->exec_getQuery('pages',Array('pidInList'=>$id,'orderBy'=>$altSortField)); 00073 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00074 $menuItemsArray[]=$row; 00075 } 00076 } 00077 00078 ?>