$cfg_puccache_time ) { $pv = new PartView(); $row = $pv->dsql->GetOne(" SELECT * FROM `#@__mytag` WHERE aid='$aid' "); if(!is_array($row)) { $myvalues = ""; } else { $tagbody = ''; if($row['timeset']==0) { $tagbody = $row['normbody']; } else { $ntime = time(); if($ntime>$row['endtime'] || $ntime < $row['starttime']) { $tagbody = $row['expbody']; } else { $tagbody = $row['normbody']; } } $pv->SetTemplet($tagbody, 'string'); $myvalues = $pv->GetResult(); $myvalues = str_replace('"','\"',$myvalues); $myvalues = str_replace("\r","\\r",$myvalues); $myvalues = str_replace("\n","\\n",$myvalues); $myvalues = "\r\n"; file_put_contents($cacheFile, $myvalues); /* 使用 file_put_contents替换下列代码提高执行效率 $fp = fopen($cacheFile, 'w'); fwrite($fp, $myvalues); fclose($fp); */ } } include $cacheFile;