Counter: 354, today: 1, yesterday: 0



viewer.cgi

#!/usr/bin/perl

sub set_thisjpg{
    my @data = split(/&/,$ENV{QUERY_STRING});
    return $data[0];
}

sub settitle{
    my $thisjpg = $_[0];
    my $datetime="";
    open (ICHIRAN,"./ichiran.htm");
    while(<ICHIRAN>){
        if($_=~/<TITLE>([\S\s]+)<\/TITLE>/){
            $datetime=$1;
            last;
        }
    }
    close(ICHIRAN);
    return "$datetime $thisjpg";
}
sub print_html{
    my $left = "";
    my $right = "";
    my $ind = 0;
    my $thisnumber=0;

    my $thisjpg=&set_thisjpg();

    my @jpgs = glob ("*.JPG");
    my $jpgnum = @jpgs;

    my $title=&settitle("$thisjpg");

    for($ind =0 ; $ind <$jpgnum ; $ind++){
        if($jpgs[$ind] eq $thisjpg){
            last;
        }
    }
    $thisnumber=$ind;
    if ($thisnumber !=0){
        $ind=$thisnumber-1;
        $left="<a href=\"slideshow.cgi?$jpgs[$ind]\"><font size=\"5\">←</font></a>";
    }
    if ($thisnumber !=$jpgnum-1){
        $ind=$thisnumber+1;
        $right="<a href=\"slideshow.cgi?$jpgs[$ind]\"><font size=\"5\">→</font></a>";
    }


    print <<"EOL";
    Content-type: text/html
    <HTML>
        <HEAD>
            <meta http-equiv="Content-Type" content="text/html; charset=EUC-JP">
            <TITLE>$title</TITLE>
            <script type="text/javascript" src="zaseki_data/poptxt.js">
            </script>
        </HEAD>
    <BODY>


    <table>
        <tr>
            <td></td>
            <td><img src="$thisjpg"></td>
            <td></td>
        </tr>
        <tr>
            <td>$left</td>
            <td align="center"><a href="ichiran.htm"><font size="5">一覧へ</font></a></td>
            <td>$right</td>
        </tr>
    </table>
    </BODY>
    </HTML>
EOL

}

&print_html();

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-03-16 (火) 10:44:36 (3736d)