rtoss

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/File Releases @ 4  →  /File Releases @ 23
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/File Releases/bg.png
/File Releases/header.msg
@@ -3,11 +3,11 @@
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<link rel="alternate" type="application/xml" title="RSS 2.0 Feed" href="rss.php" />
<title>Firefox Musume Release builds</title>
<title>File Releases</title>
<style type="text/css">
html {
color: #ceeaf9;
background: #008ad0 url("../bg.png") repeat-x;
background: #008ad0;
font-family:sans-serif;
}
kbd,samp {font-family:sans-serif;}
@@ -15,13 +15,6 @@
div kbd {position:absolute; right:0.5em;}
.bold {font-weight:bold;}
</style>
<!--[if IE]>
<style type="text/css">
html {
background: #0080CB url("../bg.png") repeat-x;
}
</style>
<![endif]-->
<script type="text/javascript">
function hoverThis(obj) {obj.style.background="#0077CC";}
function unhoverThis(obj) {obj.style.background="transparent";}
/File Releases/index.php
@@ -50,8 +50,7 @@
exec("df|grep data",$df);
$df=preg_split("/\s+/",$df[0]);
 
echo "<div style='border-top:1px solid'> <samp>Total Size: ".properSize($totalsize,2)."</samp> <kbd>Free: <a href='../df.php'>".properSize($df[3]*1024,2)."</a></kbd></div>";
echo "<div><a href='../'>Nightly Builds</a></div>";
echo "<div style='border-top:1px solid'> <samp>Total Size: ".properSize($totalsize,2)."</samp></div>";
 
if(file_exists('./footer.msg')) include('./footer.msg');
 
/File Releases/rss.php
@@ -1,16 +1,21 @@
<?php
 
$dir='files/';
$datecache='./files.date';
$feedcache='./rss.xml';
 
function properSize($size,$maxcnt=0) {
$suffix=''; $suxAry=array("KB","MB","GB","TB");
$suffix=''; $suxAry=array('KB','MB','GB','TB');
$ccnt=$maxcnt?$maxcnt:count($suxAry);
for($cnt=0;$cnt<$ccnt;$cnt++)
if($size > 1024) {$size/=1024; $suffix=$suxAry[$cnt];}
return sprintf("%.1f",$size).$suffix;
return sprintf('%.1f',$size).$suffix;
}
 
function fullURL() {
$filename=preg_replace('/.*\/+/',"",$_SERVER['PHP_SELF']);
$path=preg_replace("/$filename$/","",$_SERVER['PHP_SELF']);
return "http://".$_SERVER["HTTP_HOST"].$path;
$filename=preg_replace('/.*\/+/','',$_SERVER['PHP_SELF']);
$path=preg_replace("/$filename$/",'',$_SERVER['PHP_SELF']);
return 'http://'.$_SERVER['HTTP_HOST'].$path;
}
 
function _c_sort($a,$b) {
@@ -20,41 +25,62 @@
else return 0;
}
 
function writeFile($file,$data) {
$rp = fopen($file, 'w');
flock($rp, LOCK_EX); // 鎖定檔案
@fputs($rp,$data);
flock($rp, LOCK_UN); // 解鎖
fclose($rp);
chmod($file,0666);
}
 
$url=fullURL();
 
require_once("./name.inc.php");
$filesdate=date('YmdHis', filemtime($dir));
$cachedate=@file_get_contents($datecache);
if($filesdate<=$cachedate && file_exists($feedcache)) {
header('Content-type: application/xml');
readfile($feedcache);
exit;
}
 
require_once('./name.inc.php');
$files=array();
 
clearstatcache();
if ($dh = opendir('./')) {
if ($dh = opendir('./'.$dir)) {
while (($file = readdir($dh)) !== false) {
$files[$file]=@filemtime($file);
$files[$file]=@filemtime($dir.$file);
}
closedir($dh);
}
uksort($files,"_c_sort");
header("Content-type: application/xml");
echo '<?xml version="1.0" encoding="utf-8"?>
uksort($files,'_c_sort');
$dat='<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="rss2.xsl" type="text/xsl" media="screen"?>
 
<rss version="2.0">
 
<channel>
<title>Firefox Musume Nightly Builds</title>
<title>yourname File Releases</title>
<link>'.$url.'</link>
<description>Firefox musume is a customized and optimized version of Mozilla Firefox.</description>
<description>Latest files of yourname</description>
<ttl>720</ttl>
';
foreach($files as $file => $props) {
foreach($ary as $name => $regexp) {
if(preg_match($regexp,$file,$opts)) {
echo "<item><title>".htmlspecialchars(str_replace("%s",isset($opts[1])?$opts[1]:'',$name))."</title><link>".htmlspecialchars($url.$file)."</link><description>".htmlspecialchars("$name".(isset($opts[1])?"($opts[1])":''))."</description><pubDate>".date("r",$props)."</pubDate></item>";
$dat.=" <item>\n <title>".htmlspecialchars(str_replace('%s',isset($opts[1])?$opts[1]:'',$name))."</title>\n <link>".htmlspecialchars($url.$dir.$file)."</link>\n <description>".htmlspecialchars(str_replace('%s',isset($opts[1])?$opts[1]:'',$name))."</description>\n <pubDate>".date('r',$props)."</pubDate>\n </item>\n";
break;
}
}
}
 
echo "</channel>
</rss>";
$dat.='</channel>
</rss>';
 
writeFile($feedcache,$dat);
writeFile($datecache,$filesdate);
 
header('Content-type: application/xml');
echo $dat;
?>
/File Releases/name.inc.php
@@ -1,10 +1,5 @@
<?php
$ary = array(
'Phoenix %s' => '/^phoenix-((\d+\.*)+)-bin-(\d{10})/',
'Firebird %s' => '/^fb-((\d+\.*)+)-bin-(\d{10})/',
'Firefox %s' => '/^fx-((\d+\.*)+)-bin-(\d{10})/',
'Firefox %s ICL' => '/^fx-((\d+\.*)+)-icl-bin-(\d{10})/',
'Firefox %s NoSSE' => '/^fx-((\d+\.*)+)-nosse-bin-(\d{10})/',
'Firefox %s Cairo' => '/^fx-((\d+\.*)+)-cairo-bin-(\d{10})/',
'Name ver %s' => '/^filename-((\d+\.*)+)-bin-(\d{10})/',
);
?>
/File Releases/welcome.msg
@@ -1,12 +1,2 @@
Firefox musume CE is a customized and optimized version of <a href="http://www.mozilla.com">Mozilla Firefox</a>.<br />
Nightly >builds are <a href="../">here</a>. My Firefox Tips are <a href="http://rt87.byethost14.com/firefox/tips/">here</a>. RSS Feed of this page is <a href="rss.php">here</a>.
<center><script type="text/javascript"><!--
google_ad_client = "pub-8016619041936615";
//firefox
google_ad_slot = "3430640486";
google_ad_width = 728;
google_ad_height = 90;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></center>
description.<br />
RSS Feed of this page is <a href="rss.php">here</a>.
/File Releases/footer.msg
@@ -1,3 +1,3 @@
<br /><div style="float:right">Created by Roy @ 2006</div><a href="../../">Return</a>
<br /><div style="float:right">Created by Roy @ 2006</div>
</body>
</html>