Project

General

Profile

Bug #38838 ยป a.diff

Alexander Opitz, 2012-07-10 11:05

View differences:

sysext/cms/tslib/class.tslib_fe.php
$selectFields = array();
// saves the WHERE parts of the SQL query
$whereConditions = array();
foreach (array('starttime', 'endtime') as $field) {
// there is no need to load TCA because we need only enable columns!
if (isset($GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'][$field])) {
$timeFields[$field] = $GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'][$field];
$selectFields[$field] = 'MIN(' . $timeFields[$field] . ') AS ' . $field;
$selectFields[$field]
= 'MIN('
. 'if( ' . $timeFields[$field] . ' = 0, NULL , ' . $timeFields[$field] . ' )'
. ') AS ' . $field;
$whereConditions[$field] = $timeFields[$field] . '>' . $now;
}
}
// if starttime or endtime are defined, evaluate them
if (count($timeFields)) {
// find the timestamp, when the current page's content changes the next time
$row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
    (1-1/1)