$tmp","w"); fputs($fp,$text); pclose($fp); $text=implode(file($tmp),""); @unlink($tmp); return $text; } $qs = explode("/", $QUERY_STRING); // ex:"_manga/_tezuka" -> $qs[0]="_manga", $qs[1]="_tezuka" $qq = explode("_", $qs[0]); // ex: -> $qq[1]="manga" $fd = fopen("$qq[1]/db.txt", "r"); if (!$fd) { echo "

fopen error

"; exit; } while (!feof($fd)) { $num = chop(fgets($fd,256)); $name = chop(fgets($fd,256)); $fname = chop(fgets($fd,256)); $cap = chop(fgets($fd,256)); $dir = chop(fgets($fd,256)); // dir name $dummy = fgets($fd,256); if($dir == $qs[1]) { break; } } fclose($fd); // echo "$name"; echo ""; // echo "
            

"; // $path = "img/$qq[1]/" . $fname; echo "
"; echo "$cap"; echo "

"; // $path = "$qs[0]/" . $dir . "/data/"; exec("cd $path;ls | sort",$fname); $num = count($fname); for($i=0; $i<$num; $i++) { $f = $path . $fname[$i]; $title=""; $attc=""; $fd = fopen($f,"r"); echo "
"; while (!feof($fd)) { $line=fgets($fd,1000); // read one line $array=explode("\t",$line); $tag=$array[0]; switch($tag) { case "date"; $date=sjis2euc($array[1]); break; case "title"; $title=sjis2euc($array[1]); echo "
$title

"; // echo "  $date"; break; case "attc_name"; $attc=chop($array[1]); $attcf = $qs[0] . "/" . $dir . "/images/" . $attc; $tmpf = "tmp/images/" . $attc; exec("cp $attcf $tmpf"); break; case "value"; echo sjis2euc("$array[1]"); echo "
"; break; case "uname"; if ($attc=="") { echo "

"; } else { echo "

"; } break; } // switch } // while echo "
"; } // for echo "

            
"; echo "

"; include "copyright.txt"; ?>