| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/umedia3/inc/ |
Upload File : |
<?
function pcache_s($ccode,$cmin=0,$chrs=0,$forcerecache=false,$setsubdir="") {
//return;
global $_GET;
global $REQUEST_URI;
if ($cmin==0) {
$cmin=getval("global","pcache_defmin");
}
if ($chrs==0) {
$chrs=getval("global","pcache_defhrs");
}
global $REQUEST_METHOD;
$REQUEST_METHOD2=strtolower($REQUEST_METHOD);
//echo "$REQUEST_METHOD2";
if ($REQUEST_METHOD2=="post") {
echo "<!-- pcache_s() disabled due to post_method -->";
return; // disable cache on post_method
}
if (loginchk_lib("return")==true) {
echo "<!-- pcache_s() disabled due loginchk_lib()=true -->";
return; // disable cache on post_method
}
if ($ccode=="autourl") {
$ccode=$REQUEST_URI."-".implode('+',$_GET);
$ccode=str_replace('?','-',$ccode);
$ccode=str_replace('/','-',$ccode);
$ccode=str_replace('=','_',$ccode);
$ccode=str_replace('&','_',$ccode);
$ccode=str_replace('__','_',$ccode);
$ccode=str_replace('__','_',$ccode);
$ccode=str_replace('__','_',$ccode);
$ccode=str_replace('__','_',$ccode);
$ccode=str_replace('--','-',$ccode);
$ccode=str_replace('--','-',$ccode);
$ccode=str_replace('--','-',$ccode);
$ccode=str_replace('--','-',$ccode);
$ccode=str_replace('__','_',$ccode);
$ccode=str_replace('--','-',$ccode);
}
global $dcrs_pcache;
global $dcrs_pcache_s_runned;
global $dcrs_pcache_s_ccode;
global $dcrs_pcache_s_subdir;
$dcrs_pcache=trim($dcrs_pcache);
$setsubdir=trim($setsubdir);
$setsubdir=str_replace('/','',$setsubdir);
if ($dcrs_pcache=="") {
die ("Pcache error \$dcrs_pcache not defined; halting");
}
if ($ccode=="") {
die ("Pcache error \$ccode not entered; halting");
}
$ccode=str_replace('/','',$ccode);
if (!file_exists("$dcrs_pcache")) {
@mkdir ("$dcrs_pcache", 0777);
}
if ($setsubdir!="") {
if (!file_exists("$dcrs_pcache/$setsubdir")) {
@mkdir ("$dcrs_pcache/$setsubdir", 0777);
}
$ccode="$setsubdir/$ccode";
}
$cachefile = "$dcrs_pcache/$ccode.html";
$cachetime = ($cmin * 60)+($chrs*60*60);
// Serve from the cache if it is younger than $cachetime
/*
if (file_exists($cachefile)) {
echo "CACHE FILE EXISTS [$cachefile];";
}
*/
if (
$forcerecache==false &&
file_exists($cachefile) &&
(time() - $cachetime < filemtime($cachefile))
) {
echo "<!-- Cached copy, generated ".date('H:i', filemtime($cachefile))." for '$ccode' <BR> \n-->";
echo "<!-- timeleft to re-cache is " .number_format(( filemtime($cachefile) +$cachetime) -time() ). " seconds<BR> -->";
include($cachefile);
//echo "<!-- Cache ended for '$ccode' -->\n";
exit;
} else {
//echo "start capture for new cache<BR>\n";
//echo "file to save cache is: $cachefile\n";
}
$dcrs_pcache_s_runned="yes";
$dcrs_pcache_s_ccode=$ccode;
$dcrs_pcache_s_subdir=$setsubdir;
ob_start(); // Start the output buffer
}
?>