Bug #26161 » Diff-REALMCTECHNIK-227.diff
typo3/sysext/cms/tslib/class.tslib_content.php Thu Sep 12 14:31:16 2013 +0200 → typo3/sysext/cms/tslib/class.tslib_content.php Tue Sep 17 13:05:30 2013 +0200 | ||
---|---|---|
// Init vars:
|
||
$allFields = 'uid,hidden,starttime,endtime,fe_group,extendToSubpages,doktype,php_tree_stop,mount_pid,mount_pid_ol,t3ver_state' .
|
||
$addSelectFields;
|
||
$expires = (int)$GLOBALS['SIM_ACCESS_TIME'] + (24 * 60 * 60); // Now + 24 hours.
|
||
$depth = intval($depth);
|
||
$begin = intval($begin);
|
||
$id = intval($id);
|
||
... | ... | |
$cacheEntry = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow(
|
||
'treelist',
|
||
'cache_treelist',
|
||
'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['EXEC_TIME'] .
|
||
'md5hash = \'' . $requestHash . '\' AND ( expires > ' . $GLOBALS['SIM_ACCESS_TIME'] .
|
||
' OR expires = 0 )'
|
||
);
|
||
if (is_array($cacheEntry)) {
|
||
if (is_array($cacheEntry) && !$GLOBALS['TSFE']->no_cache) {
|
||
// cache hit
|
||
return $cacheEntry['treelist'];
|
||
}
|
||
... | ... | |
continue;
|
||
}
|
||
}
|
||
// Get expires value from pages:
|
||
// Check each page for lower starttime or endtime then current expires.
|
||
// Use it as new expires. The expires will be the time when first page will change.
|
||
// ~ Daniel Siepmann <Daniel.Siepmann@wfp2.com>
|
||
$starttime = (int)$row['starttime'];
|
||
$endtime = (int)$row['endtime'];
|
||
if ($starttime !== 0 && $starttime < $expires && $starttime > (int)$GLOBALS['SIM_ACCESS_TIME']) {
|
||
$expires = $starttime;
|
||
}
|
||
if ($endtime !== 0 && $endtime < $expires && $endtime > (int)$GLOBALS['SIM_ACCESS_TIME']) {
|
||
$expires = $endtime;
|
||
}
|
||
unset( $starttime );
|
||
unset( $endtime );
|
||
// Add record:
|
||
if ($dontCheckEnableFields || $GLOBALS['TSFE']->checkPagerecordForIncludeSection($row)) {
|
||
// Add ID to list:
|
||
... | ... | |
}
|
||
}
|
||
if (!$GLOBALS['TSFE']->no_cache) {
|
||
$GLOBALS['TYPO3_DB']->exec_DELETEquery(
|
||
'cache_treelist',
|
||
'md5hash = "' . $requestHash . '"'
|
||
);
|
||
$GLOBALS['TYPO3_DB']->exec_INSERTquery(
|
||
'cache_treelist',
|
||
array(
|
||
'md5hash' => $requestHash,
|
||
'pid' => $id,
|
||
'treelist' => $theList,
|
||
'tstamp' => $GLOBALS['EXEC_TIME']
|
||
'tstamp' => $GLOBALS['EXEC_TIME'],
|
||
'expires' => $expires,
|
||
)
|
||
);
|
||
}
|
||
}
|
||
}
|
||
// Return list:
|
||
return $theList;
|
||
}
|