@define('YD_WEBLOG_CACHE_FNAME', $cache_file); // Include the standard modules YDInclude('YDDatabase.php'); YDInclude('YDDatabaseMetaData.php'); YDInclude('YDTemplate.php'); // Include other libraries YDInclude(dirname(__FILE__) . '/YDWeblogAPI.php'); YDInclude(dirname(__FILE__) . '/YDWeblogRequest.php'); YDInclude(YD_DIR_HOME . '/3rdparty/smarty/libs/plugins/modifier.truncate.php'); // Check for blocked IP addresses $blocked_ips = YDFormatStringWithListValues(YDConfig::get('blocked_ips', '')); // Check if the current IP address is blocked or not if ($blocked_ips != '') { $blocked_ips = explode(', ', $blocked_ips); foreach ($blocked_ips as $ip) { if (YDStringUtil::match($_SERVER['REMOTE_ADDR'], $ip)) { die('IP address ' . $_SERVER['REMOTE_ADDR'] . ' is blocked.'); } } } // Cache output if needed if (YDConfig::get('use_cache', false)) { if (sizeof($_POST) == 0) { if (is_file(YD_WEBLOG_CACHE_FNAME)) { $data = file_get_contents(YD_WEBLOG_CACHE_FNAME); @(include dirname(__FILE__) . '/cache_filter.php'); $elapsed = $GLOBALS['timer']->getElapsed(); $req = new YDWeblogRequest(); die($data . YD_CRLF . '<!-- #cached: ' . $elapsed . ' ms -->'); } }