Index: typo3/sysext/indexed_search/pi/indexed_search.tmpl =================================================================== --- typo3/sysext/indexed_search/pi/indexed_search.tmpl (revision 257) +++ typo3/sysext/indexed_search/pi/indexed_search.tmpl (working copy) @@ -78,6 +78,17 @@ + + + ###FORM_DATERANGE### + + + + + + ###FORM_FROMSECTION### Index: typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php =================================================================== --- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (revision 257) +++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy) @@ -165,7 +165,7 @@ */ var $indexerObj; var $templateCode; // Will hold the content of $conf['templateFile'] - var $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results'; + var $hiddenFieldList = 'ext, type, defOp, media, order, group, lang, desc, results, dateRange'; /** @@ -298,6 +298,14 @@ '20' => '20', '50' => '50', '100' => '100', + ), + 'dateRange' => array( + '' => $this->pi_getLL('opt_dateRange_no_limit'), + '86400' => $this->pi_getLL('opt_dateRange_last_day'), + '259200' => $this->pi_getLL('opt_dateRange_last_3days'), + '604800' => $this->pi_getLL('opt_dateRange_last_week'), + '2592000' => $this->pi_getLL('opt_dateRange_last_month'), + '7776000' => $this->pi_getLL('opt_dateRange_last_quarter'), ) ); @@ -1005,6 +1013,23 @@ } /** + * Returns an AND statement for date range selection + * + * @return string AND statement for date range selection + */ + protected function dateRangeWhere() { + $dateRange = trim((string)$this->piVars['dateRange']); + + if (empty($dateRange) || !is_numeric($dateRange) || $dateRange <= 0) { + $out = ''; + } else { + $out = 'AND IP.item_mtime>=' . (time() - intval($dateRange)); + } + + return $out; + } + + /** * Returns AND statement for selection of langauge * * @return string AND statement for selection of langauge @@ -1158,6 +1183,7 @@ $page_join, $wordSel.' IP.phash IN ('.$list.') '. + $this->dateRangeWhere(). ' ' . $this->mediaTypeWhere().' '. $this->languageWhere(). $freeIndexUidClause.' @@ -1187,6 +1213,7 @@ 'ISEC.*, IP.*', 'index_phash IP,index_section ISEC'.$page_join, 'IP.phash IN ('.$list.') '. + $this->dateRangeWhere(). ' ' . $this->mediaTypeWhere().' '. $this->languageWhere(). $freeIndexUidClause.' @@ -1322,7 +1349,7 @@ $html = $this->cObj->getSubpart($this->templateCode, '###SEARCH_FORM###'); // Multilangual text - $substituteArray = array('legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid'); + $substituteArray = array('legend', 'searchFor', 'extResume', 'atATime', 'orderBy', 'fromSection', 'searchIn', 'match', 'style', 'freeIndexUid', 'dateRange'); foreach ($substituteArray as $marker) { $markerArray['###FORM_'.t3lib_div::strtoupper($marker).'###'] = $this->pi_getLL('form_'.$marker,'',1); } @@ -1442,6 +1469,12 @@ $markerArray['###EXT_RESUME_CHECKED###'] = $this->piVars['extResume'] ? ' checked="checked"' : ''; } + if (!is_array($optValues['dateRange']) || $this->conf['blind.']['dateRange']) { + $html = $this->cObj->substituteSubpart($html, '###SELECT_DATERANGE###', ''); + } else { + unset($hiddenFieldArr['dateRange']); + $markerArray['###SELECTBOX_DATERANGE_VALUES###'] = $this->renderSelectBoxValues($this->piVars['dateRange'], $optValues['dateRange']); + } } else { // Extended search $html = $this->cObj->substituteSubpart($html, '###SEARCH_FORM_EXTENDED###', ''); } Index: typo3/sysext/indexed_search/pi/locallang.xml =================================================================== --- typo3/sysext/indexed_search/pi/locallang.xml (revision 257) +++ typo3/sysext/indexed_search/pi/locallang.xml (working copy) @@ -44,6 +44,12 @@ + + + + + + @@ -54,6 +60,7 @@ +