# ------------------------- # # Sub Body Bottom # ボディ下部 # ------------------------- # sub bodybottom { print "</td>\n"; print "</tr>\n"; print "<tr>\n"; print "<td>\n"; print "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"$barcolor\">\n"; print "<tr>\n"; print "<td valign=\"bottom\"><img src=\"$img$lbimg\" width=\"$ris\" height=\"$ris\"></td>\n"; print "<td><div align=\"center\">"; print "<a href=\"$backurl\" target=\"$backtarget\">[$backword]</a>\n" if $printback == 1; # print " <font color=#cd5c5c>▼<a href=\"$cgiurl?mode=owner&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:help>全体情報</a>▼\n" if $actionflag == 1; # print " <font color=#cd5c5c>▼<a href=\"$cgiurl?mode=owner1&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:help>個人情報</a>▼\n" if $actionflag == 1; print " <font color=#cd5c5c>▼全体情報<a href=\"$cgiurl?mode=owners&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:help>さくら</a><a href=\"$cgiurl?mode=ownerk&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:help>かえで</a>▼\n" if $actionflag == 1; print " <font color=#cd5c5c>▼個人情報<a href=\"$cgiurl?mode=owner1s&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:help>さくら</a><a href=\"$cgiurl?mode=owner1k&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:help>かえで</a>▼\n" if $actionflag == 1; if ($FORM{'mode'} eq "owner" || $FORM{'mode'} eq "owner1") { print " <font color=#cd5c5c>▼<a href=\"$cgiurl?mode=back&name=$FORM{'name'}&pass=$FORM{'pass'}\"div style=cursor:w-resize>戻る</a>▼\n"; } elsif ($FORM{'mode'} ne "end") { print " <font color=#cd5c5c>■<a href=\"$cgiurl?mode=end\"div style=cursor:s-resize>終了</a>■\n"; } print "</div></td>"; print "<td valign=\"bottom\"><div align=\"right\"><img src=\"$img$rbimg\" width=\"$ris\" height=\"$ris\"></div></td>\n"; print "</tr>\n"; print "</table>\n"; print "</td>"; print "</tr>\n"; print "</form>\n"; print "</table>\n"; print "</div>\n"; } |
# ------------------------- # # Main Program # メイン処理 # ------------------------- # &decode; &openinpetdata; &titlecheck; if ($FORM{'mode'} eq "end") { &error("$endmsg"); } elsif ($FORM{'mode'} eq "newpet") { &newpet; } elsif ($FORM{'mode'} eq "nopet") { &nopet; } #elsif ($FORM{'mode'} eq "owner") { &ownerlist; } #elsif ($FORM{'mode'} eq "owner1") { &ownerdisp; } elsif ($FORM{'mode'} eq "owners") { &ownerlists; } elsif ($FORM{'mode'} eq "owner1s") { &ownerdisps; } elsif ($FORM{'mode'} eq "ownerk") { &ownerlistk; } elsif ($FORM{'mode'} eq "owner1k") { &ownerdispk; } elsif ($FORM{'mode'} eq "entername") { &petform; } elsif ($FORM{'mode'} eq "back") { &petform; } elsif (!$FORM{'mode'}) { &entername; } else { &action; } exit; |
# ------------------------- # # Sub Open In User Data # ユーザーデータの読みこみ # ------------------------- # sub openinuserdata { if ($lockkey == 1) { &lock; } open(IN,"$userdata") || &error("Can't open $userdata"); @lines = <IN>; close(IN); &unlock; foreach $line (@lines) { ($name,$pass,$gdate,$love,$firstvisit,$klove,$dummy03,$dummy04,$dummy05,$dummy06,$dummy07,$dummy08,$dummy09,$dummy10) = split(/<>/,$line); if ($_[0] eq 'checkname') { if ($FORM{'name'} eq $name) { $flag = 1; # データの中にユーザーを確認 if ($FORM{'pass'} ne $pass) { &error("パスワードが間違っています"); } last; } } if ($_[0] eq 'action') { if ($FORM{'name'} eq $name) { $gdate = time; push(@new,"$FORM{'name'}<>$FORM{'pass'}<>$gdate<>$newlove<>$newfirstvisit<>$newklove<>$newdummy03<>$newdummy04<>$newdummy05<>$newdummy06<>$newdummy07<>$newdummy08<>$newdummy09<>$newdummy10<>\n"); } else { if ($gdate >= $goodbye) { push(@new,$line); } } } # if ($_[0] eq 'ownerlist') { if ($_[0] eq 'ownerlists' || $_[0] eq 'ownerlistk') { if ($_[0] eq 'ownerlistk') { $love = $klove; } if ($love >= $loved) { @lovelist[$lovenum] = "$love<>$name"; $lovenum++; if ($FORM{'name'} eq $name) { $ownername = $name; $ownerrank = '好感を持っている人'; $ownerlove = $love; } if ($bestlove < $love) { $bestowner = "$name"; $bestlove = $love; } } elsif ($love >= $loved_k) { @lovelist_k[$lovenum_k] = "$love<>$name"; $lovenum_k++; if ($FORM{'name'} eq $name) { $ownername = $name; $ownerrank = '気になる人'; $ownerlove = $love; } } elsif ($love >= $disliked) { @otherlist[$othernum] = "$love<>$name"; $othernum++; if ($FORM{'name'} eq $name) { $ownername = $name; $ownerrank = '好きでも嫌いでもない人'; $ownerlove = $love; } } else { @hatelist[$hatenum] = "$love<>$name"; $hatenum++; if ($FORM{'name'} eq $name) { $ownername = $name; $ownerrank = '苦手な人'; $ownerlove = $love; } } } } if ($_[0] eq 'action') { foreach $line (@new) { ($name,$pass) = split(/<>/,$line); $newflg = 0; foreach $line1 (@new1) { ($name1,$pass1) = split(/<>/,$line1); if ($name eq $name1) { $newflg = 1; } } if ($newflg == 0) { push(@new1,$line); } } @new = @new1; } # if ($_[0] eq 'ownerlist') { if ($_[0] eq 'ownerlists' || $_[0] eq 'ownerlistk') { &user_sort_r(@lovelist); @lovelist = @newtxt; &user_sort_r(@lovelist_k); @lovelist_k = @newtxt; &user_sort_r(@hatelist); @hatelist = @newtxt; &user_sort_r(@otherlist); @otherlist = @newtxt; @alllist = @lovelist; push(@alllist,@lovelist_k,@otherlist,@hatelist); $ownercnt = 1; foreach $allcnt (@alllist) { ($love,$name) = split(/<>/,$allcnt); if ($FORM{'name'} eq $name) { last; } $ownercnt++; } } } |
# ------------------------- # # Sub Owner List # 飼い主ランキング(さくらちゃん用) # ------------------------- # #sub ownerlist { sub ownerlists { &header; &title; $bestlove = $lovenum = $lovenum_k = $hatenum = $othernum = 0; # &openinuserdata('ownerlist'); &openinuserdata('ownerlists'); &bodytop('<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"><font color=#db7093><FONT Face="symbol" Color="red">ゥ</FONT>LOVEランキング<FONT Face="symbol" Color="red">ゥ</FONT></FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE>'); &tabletop; $allnum = $lovenum + $lovenum_k + $hatenum + $othernum; print "<BR><font color=db7093><center>■あなたは$allnum人中 $ownercnt番目に姫野兄妹に好かれてます■</center><br><BR>"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 好きな人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($bestlove < $loved) { print "<font color=db7093>いないよ♪<br>\n";} # else { print "<font color=db7093>$bestownerサン<FONT Face="symbol" Color="red">ゥ</FONT> <br>\n"; } else { if ($bestowner eq $ownername) { print "<FONT color=red><B>$bestowner</B></FONT>サン♪<br>\n"; } else { print "<font color=db7093>$bestownerサン♪<br>\n"; } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 好感を持っている人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($lovenum == 0) { print "<font color=db7093>いないよ♪<br>"; } # else { foreach $owner (@lovelist) { print "$ownerサン<br>\n"; } } else { foreach $owner (@lovelist) { ($love,$name) = split(/<>/,$owner); # print "<font color=db7093>$nameサン<br>\n"; if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "<font color=db7093>$nameサン<br>\n"; } } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 気になる人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($lovenum_k == 0) { print "<font color=db7093>いないよ♪<br>";} # else { foreach $owner (@lovelist_k) { print "$ownerサン<br>\n"; } } else { foreach $owner (@lovelist_k) { ($love,$name) = split(/<>/,$owner); # print "<font color=db7093>$nameサン<br>\n"; if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "<font color=db7093>$nameサン<br>\n"; } } } print "<br>\n"; # ↓嫌いな人とそれ以外の人を入れ替える print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼単なる店の 常連客な人々</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($othernum == 0) { print "<font color=db7093>いないよ♪<br>"; } # else { foreach $owner (@otherlist) { print "<font color=db7093>$ownerサン<br>\n"; } } else { foreach $owner (@otherlist) { ($love,$name) = split(/<>/,$owner); # print "<font color=db7093>$nameサン<br>\n"; if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "<font color=db7093>$nameサン<br>\n"; } } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 苦手な人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($hatenum == 0) { print "<font color=db7093>いないよ♪<br>";} # else { foreach $owner (@hatelist) { print "<font color=db7093>$ownerさん<br>\n"; } } else { foreach $owner (@hatelist) { ($love,$name) = split(/<>/,$owner); # print "<font color=db7093>$nameさん<br>\n"; if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "$nameサン<br>\n"; } } } &tablebottom; &bodybottom; &footer; } # ------------------------- # # Sub Owner List # 飼い主ランキング(かえでくん用) # ------------------------- # sub ownerlistk { &header; &title; $bestlove = $lovenum = $lovenum_k = $hatenum = $othernum = 0; &openinuserdata('ownerlistk'); &bodytop('<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"><font color=#db7093><FONT Face="symbol" Color="red">ゥ</FONT>LOVEランキング<FONT Face="symbol" Color="red">ゥ</FONT></FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE>'); &tabletop; $allnum = $lovenum + $lovenum_k + $hatenum + $othernum; print "<BR><font color=db7093><center>■あなたは$allnum人中 $ownercnt番目に姫野兄妹に好かれてます■</center><br><BR>"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 好きな人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($bestlove < $loved) { print "<font color=db7093>いないよ♪<br>\n";} else { if ($bestowner eq $ownername) { print "<FONT color=red><B>$bestowner</B></FONT>サン♪<br>\n"; } else { print "<font color=db7093>$bestownerサン♪<br>\n"; } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 好感を持っている人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($lovenum == 0) { print "<font color=db7093>いないよ♪<br>"; } else { foreach $owner (@lovelist) { ($love,$name) = split(/<>/,$owner); if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "<font color=db7093>$nameサン<br>\n"; } } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 気になる人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($lovenum_k == 0) { print "<font color=db7093>いないよ♪<br>";} else { foreach $owner (@lovelist_k) { ($love,$name) = split(/<>/,$owner); if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "<font color=db7093>$nameサン<br>\n"; } } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼単なる店の 常連客な人々</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($othernum == 0) { print "<font color=db7093>いないよ♪<br>"; } else { foreach $owner (@otherlist) { ($love,$name) = split(/<>/,$owner); if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "<font color=db7093>$nameサン<br>\n"; } } } print "<br>\n"; print '<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"width="360"><font size=1 color=#db7093>▼さくらが 苦手な人</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE><br>'; if ($hatenum == 0) { print "<font color=db7093>いないよ♪<br>";} else { foreach $owner (@hatelist) { ($love,$name) = split(/<>/,$owner); if ($name eq $ownername) { print "<FONT color=red><B>$name</B></FONT>サン<br>\n"; } else { print "$nameサン<br>\n"; } } } &tablebottom; &bodybottom; &footer; } # ------------------------- # # Sub Owner Disp # 飼い主個人情報(さくらちゃん用) # ------------------------- # #sub ownerdisp { sub ownerdisps { &header; &title; $bestlove = $lovenum = $lovenum_k = $hatenum = $othernum = 0; # &openinuserdata('ownerlist'); &openinuserdata('ownerlists'); &bodytop('<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"><font color=#db7093>▽個人情報▽</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE>'); &tabletop; if ($bestowner eq $ownername) { $ownerrank = '<font color=cc8097>一番好きな人'; } print "<font color=cc8097><center><BR>▼$ownernameサンの情報▼</center><br>"; print "<font color=cc8097>■あなたはさくらにとって<B>$ownerrank</B>です。<br><BR>"; print "<font color=cc8097>■獲得したLOVE度は<B>$ownerloveポイント</B>です。<br><BR>"; $allnum = $lovenum + $lovenum_k + $hatenum + $othernum; print "<font color=cc8097>■あなたは$allnum人中<B>$ownercnt番目</B>に姫野兄妹に好かれています。<BR><br>"; &tablebottom; &bodybottom; &footer; } # ------------------------- # # Sub Owner Disp # 飼い主個人情報(かえでくん用) # ------------------------- # sub ownerdispk { &header; &title; $bestlove = $lovenum = $lovenum_k = $hatenum = $othernum = 0; &openinuserdata('ownerlistk'); &bodytop('<TABLE cellspacing="1" bgcolor="#000000"><TBODY><TR><TD bgcolor="#ff2693"></TD><TD bgcolor="#ff6ab5"></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ffffff" align="center"><font color=#db7093>▽個人情報▽</FONT></TD><TD bgcolor="#ff9bcd"></TD><TD bgcolor="#ff6ab5"></TD> <TD bgcolor="#ff2693"></TD></TR></TBODY></TABLE>'); &tabletop; if ($bestowner eq $ownername) { $ownerrank = '<font color=cc8097>一番好きな人'; } print "<font color=cc8097><center><BR>▼$ownernameサンの情報▼</center><br>"; print "<font color=cc8097>■あなたはさくらにとって<B>$ownerrank</B>です。<br><BR>"; print "<font color=cc8097>■獲得したLOVE度は<B>$ownerloveポイント</B>です。<br><BR>"; $allnum = $lovenum + $lovenum_k + $hatenum + $othernum; print "<font color=cc8097>■あなたは$allnum人中<B>$ownercnt番目</B>に姫野兄妹に好かれています。<BR><br>"; &tablebottom; &bodybottom; &footer; } |