$cfg_puccache_time ) { $row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid' "); $adbody = ''; if($row['timeset']==0) { $adbody = $row['normbody']; } else { $ntime = time(); if($ntime > $row['endtime'] || $ntime < $row['starttime']) { $adbody = $row['expbody']; } else { $adbody = $row['normbody']; } } $adbody = str_replace('"', '\"',$adbody); $adbody = str_replace("\r", "\\r",$adbody); $adbody = str_replace("\n", "\\n",$adbody); $adbody = "\r\n"; $fp = fopen($cacheFile, 'w'); fwrite($fp, $adbody); fclose($fp); } include $cacheFile;