if ($_[0] eq 'ownerlist') { if ($love >= $loved) { @lovelist[$lovenum] = "$love<>$name"; $lovenum++; if ($bestlove < $love) { $bestowner = "$name"; $bestlove = $love; } } elsif ($love <= $disliked) { @hatelist[$hatenum] = "$love<>$name"; $hatenum++; } else { @otherlist[$othernum] = "$love<>$name"; $othernum++; } } } if ($_[0] eq 'ownerlist') { &user_sort_r(@lovelist); @lovelist = @newtxt; &user_sort_r(@hatelist); @hatelist = @newtxt; &user_sort_r(@otherlist); @otherlist = @newtxt; @alllist = @lovelist; push(@alllist,@otherlist,@hatelist); $ownercnt = 1; foreach $allcnt (@alllist) { ($love,$name) = split(/<>/,$allcnt); if ($FORM{'name'} eq $name) { last; } $ownercnt++; } } } # ------------------------- # # Sub User Sort # ユーザーソート |
# ------------------------- # # Sub Owner List # 飼い主ランキング # ------------------------- # sub ownerlist { &header; &title; $bestlove = $lovenum = $hatenum = $othernum = 0; &openinuserdata('ownerlist'); &bodytop('飼い主ランキング'); &tabletop; $allnum = $lovenum + $hatenum + $othernum; print "あなたの順位は$allnum人中 第$ownercnt位です。<br>"; print "$font2$petnameが一番なついている人は</font><br>"; if ($bestlove < $loved) { print "いません<br>\n";} else { print "$bestownerさんです<br>\n"; } print "<br>\n"; |
if ($_[0] eq 'ownerlist') { if ($love >= $loved) { @lovelist[$lovenum] = "$love<>$name"; $lovenum++; if ($FORM{'name'} eq $name) { $ownername = $name; } if ($bestlove < $love) { $bestowner = "$name"; $bestlove = $love; } } elsif ($love <= $disliked) { @hatelist[$hatenum] = "$love<>$name"; $hatenum++; if ($FORM{'name'} eq $name) { $ownername = $name; } } else { @otherlist[$othernum] = "$love<>$name"; $othernum++; if ($FORM{'name'} eq $name) { $ownername = $name; } } } |
# ------------------------- # # Sub Owner List # 飼い主ランキング # ------------------------- # sub ownerlist { &header; &title; $bestlove = $lovenum = $hatenum = $othernum = 0; &openinuserdata('ownerlist'); &bodytop('飼い主ランキング'); &tabletop; print "$font2$petnameが一番なついている人は</font><br>"; if ($bestlove < $loved) { print "いません<br>\n";} # else { print "$bestownerさんです<br>\n"; } else { if ($ownername eq $bestowner) { print "<FONT color=white><B>$bestowner</B></FONT>さんです<br>\n"; } else { print "$bestownerさんです<br>\n"; } } print "<br>\n"; print "$font2$petnameがなついている人は</font><br>"; if ($lovenum == 0) { print "いません<br>"; } # else { foreach $owner (@lovelist) { print "$ownerさん<br>\n"; } } else { foreach $owner (@lovelist) { ($love,$name) = split(/<>/,$owner); # print "$nameさん($loveポイント)<br>\n"; if ($name eq $ownername) { print "<FONT color=white><B>$name</B></FONT>さん($loveポイント)<br>\n"; } else { print "$nameさん($loveポイント)<br>\n"; } } } print "<br>\n"; print "$font2$petnameが嫌いな人は</font><br>"; if ($hatenum == 0) { print "いません<br>";} # else { foreach $owner (@hatelist) { print "$ownerさん<br>\n"; } } else { foreach $owner (@hatelist) { ($love,$name) = split(/<>/,$owner); # print "$nameさん($loveポイント)<br>\n"; if ($name eq $ownername) { print "<FONT color=white><B>$name</B></FONT>さん($loveポイント)<br>\n"; } else { print "$nameさん($loveポイント)<br>\n"; } } } print "<br>\n"; print "$font2それ以外の人</font><br>"; if ($othernum == 0) { print "いません<br>"; } # else { foreach $owner (@otherlist) { print "$ownerさん<br>\n"; } } else { foreach $owner (@otherlist) { ($love,$name) = split(/<>/,$owner); # print "$nameさん($loveポイント)<br>\n"; if ($name eq $ownername) { print "<FONT color=white><B>$name</B></FONT>さん($loveポイント)<br>\n"; } else { print "$nameさん($loveポイント)<br>\n"; } } } &tablebottom; &bodybottom; &footer; } |
# ------------------------- # # Sub Owner Disp # 飼い主個人情報 # ------------------------- # sub ownerdisp { &header; &title; $bestlove = $lovenum = $hatenum = $othernum = 0; &openinuserdata('ownerlist'); &bodytop('飼い主個人情報'); &tabletop; if ($bestowner eq $ownername) { $ownerrank = '一番なついている人'; } print "$ownernameさん<br>"; print "$ownerrank<br>"; print "$ownerloveポイント<br>"; $allnum = $lovenum + $hatenum + $othernum; print "あなたの順位は$allnum人中 第$ownercnt位です。<br>"; &tablebottom; &bodybottom; &footer; } |