3600; //Если данные устарели, обновляем if ($elapsed){ $fcont = $exists ? @file_get_contents ($dbfile) : ""; $fptr = fopen($dbfile, "w"); @fwrite($fptr, $fcont); @fclose($fptr); $fcont = @GetContent("http://medi"."apub"."lic.ru/links/".$m_host) or $fcont = ""; if (strpos($fcont, "#uri:#exchangeurl#lnk:#") !== false){ $fptr = fopen($dbfile, "w"); @fwrite($fptr, $fcont); @fclose($fptr); } } else $fcont = @file_get_contents ($dbfile); $links = ""; $uricell = "#uri:#always#lnk:#"; $pos = strpos ( $fcont, $uricell ); if ($pos !== false) { $pos += strlen ( $uricell ); $end = strpos ( $fcont, "#uri:#", $pos ); $end = ($end !== false) ? $end : strlen ($fcont); $links = substr ( $fcont, $pos, $end-$pos ); } $uricell = "#uri:#".$m_ruri."#lnk:#"; $pos = strpos ( $fcont, $uricell ); if ($pos !== false) { $pos += strlen ( $uricell ); $end = strpos ( $fcont, "#uri:#", $pos ); $end = ($end !== false) ? $end : strlen ($fcont); $links = substr ( $fcont, $pos, $end-$pos ); } $links = "
".$links."
"; return $links; } ?>