探せばどこかに 在りそうで無い様な、無さそうで在るような?? ジブリキャラ人気投票 \n"; echo "
"; for ($i=0;$i<$BEST;$i++) { echo ""; echo ""; echo "\n"; }; echo "
".($i+1)."番目に好き(".($BEST-$i)."pts.)登場作品名:
キャラ名:
"; break; case "editted": $charlist_added = false; $fails = 0; for ($i=0;$i<$BEST;$i++) { $YOURBEST[$i]["CHAR"] = trim(stripslashes($YOURBEST[$i]["CHAR"])); $YOURBEST[$i]["SERIES"] = trim(stripslashes($YOURBEST[$i]["SERIES"])); // echo $i.":".$YOURBEST[$i]["CHAR"].":".$YOURBEST[$i]["SERIES"]."
\n"; if (($YOURBEST[$i]["SERIES"]=="該当無し" or $YOURBEST[$i]["SERIES"]=="") and ($YOURBEST[$i]["CHAR"]!="" and $YOURBEST[$i]["CHAR"]!="該当無し")) { if ($CHAR_CHECK[$YOURBEST[$i]["CHAR"]]!="") { $YOURBEST[$i]["SERIES"] = $SERIES_NAME[$CHAR_NAME[$CHAR_CHECK[$YOURBEST[$i]["CHAR"]]]["SERIES"]]["NAME"]; } else { $ERROR_MES[$fails]= $i."番目:キャラ名を入力した場合は登場作品名も必ず指定してください。

"; $fails++; }; }; // echo '$YOURBEST[$i]["CHAR"]='.$YOURBEST[$i]["CHAR"].' $YOURBEST[$i]["SERIES"]='.$YOURBEST[$i]["SERIES"]."を今から確認
\n"; $_FOUND_=false; for ($j=0;$j<$numof_charlist;$j++) { $CHAR = explode("{|}",trim($charlist[$j])); // echo '$CHAR[0]='.$CHAR[0].' $CHAR[1]='.$CHAR[1]."
\n"; if ($CHAR[0]==$YOURBEST[$i]["CHAR"] and $CHAR[1]==$YOURBEST[$i]["SERIES"]) { $_FOUND_=true; // echo "Hit!
"; $char_found[$i]=$j+1; }; }; // if ($CHAR_CHECK[$YOURBEST[$i]["CHAR"]]!="" and $SERIES_CHECK[$YOURBEST[$i]["SERIES"]]!="") { if ($_FOUND_==false) { // $char_found[$i]=$CHAR_CHECK[$YOURBEST[$i]["CHAR"]]; // } else { $charlist[$numof_charlist]=$YOURBEST[$i]["CHAR"]."{|}".$YOURBEST[$i]["SERIES"]."{|}".($numof_charlist+1)."\n"; $char_found[$i]=$LAST_CHAR_ID+1; $numof_charlist++; $LAST_CHAR_ID++; $charlist_added = true; echo "キャラリストに「".$YOURBEST[$i]["CHAR"]."(".$YOURBEST[$i]["SERIES"].")」を追加しました。
"; }; }; if ($fails!=0) { for ($i=0;$i<$fails;$i++) { echo $ERROR_MES[$i]; }; die("戻ってやり直してください。

"); }; // ここから if ($found==-1) { $datalist[$numof_datalist]= $yourname."="; for ($i=0;$i<$BEST;$i++) { $datalist[$numof_datalist] .= $char_found[$i]."{|}"; }; $datalist[$numof_datalist] =substr($datalist[$numof_datalist],0,strlen($datalist[$numof_datalist])-3)."\n"; } else { $datalist[$found]= $yourname."="; for ($i=0;$i<$BEST;$i++) { $datalist[$found] .= $char_found[$i]."{|}"; }; $datalist[$found] =substr($datalist[$found],0,strlen($datalist[$found])-3)."\n"; }; $numof = count($datalist); $historyadded = true; while ($historyadded) { $fp3 = fopen($datalist_filename,"w"); $locked3 = flock($fp3,2); if ($locked3==true) { for ($i=0;$i<$numof;$i++) { fwrite($fp3,$datalist[$i]); }; $historyadded=false; // 書き込み終了。 fclose($fp3); }; }; if ($charlist_added==true) { $numof = count($charlist); $historyadded = true; while ($historyadded) { $fp3 = fopen($charlist_filename,"w"); $locked3 = flock($fp3,2); if ($locked3==true) { for ($i=0;$i<$numof;$i++) { fwrite($fp3,$charlist[$i]); }; $historyadded=false; // 書き込み終了。 fclose($fp3); }; }; }; echo $yourname."さんのデータを記録しました。

"; break; }; // switch editmode }; // 集計 clearstatcache(); $datalist_filename = "./CHAR_BEST.log"; $charlist_filename = "./CHAR_LIST.log"; unset($datalist); unset($charlist); $datalist = file($datalist_filename); $charlist = file($charlist_filename); $numof_datalist = count($datalist); $numof_charlist = count($charlist); $numof_series =0; unset($SERIES_NAME); unset($SERIES_CHECK); $SERIES_NAME[0]["NAME"]=" 該当無し"; $SERIES_NAME[0]["COUNT"]=0; $SERIES_NAME[0]["MEMBER"]=0; $SERIES_NAME[0]["ID"]=0; unset($CHAR_NAME); unset($CHAR_CHECK); $CHAR_NAME=""; $CHAR_NAME[0]["NAME"]=" 該当無し"; $CHAR_NAME[0]["COUNT"]=0; $CHAR_NAME[0]["MEMBER"]=0; $CHAR_NAME[0]["SERIES"]=0; $CHAR_NAME[0]["ID"]=0; $yourname = stripslashes($yourname); // CHAR_NAME{|}SERIES_NAME{|}ID $SERIES_CHECK[" 該当無し"]=0; for ($i=0;$i<$numof_charlist;$i++) { $CHAR = explode("{|}",trim($charlist[$i])); if ($SERIES_CHECK[$CHAR[1]]=="") { $numof_series++; $SERIES_NAME[$numof_series]["NAME"]=$CHAR[1]; $SERIES_NAME[$numof_series]["COUNT"]=0; $SERIES_NAME[$numof_series]["ID"]=$numof_series; $SERIES_CHECK[$CHAR[1]]=$numof_series; /* echo '$SERIES_NAME[$numof_series]["NAME"]='.$SERIES_NAME[$numof_series]["NAME"]."
"; echo '$SERIES_NAME[$numof_series]["COUNT"]='.$SERIES_NAME[$numof_series]["COUNT"]."
"; echo '$SERIES_NAME[$numof_series]["ID"]='.$SERIES_NAME[$numof_series]["ID"]."
"; echo '$CHAR[1]='.$CHAR[1]."
"; echo '$SERIES_CHECK[$CHAR[1]]='.$SERIES_CHECK[$CHAR[1]]."

"; */ }; $CHAR_NAME[$i+1]["NAME"]=$CHAR[0]; $CHAR_NAME[$i+1]["COUNT"]=0; $CHAR_NAME[$i+1]["SERIES"]=$SERIES_CHECK[$CHAR[1]]; $CHAR_NAME[$i+1]["ID"]=$CHAR[2]; $CHAR_CHECK[$CHAR[0]]=$CHAR[2]; /* echo '$CHAR_NAME[$i+1]["NAME"]='.$CHAR_NAME[$i+1]["NAME"]."
"; echo '$CHAR_NAME[$i+1]["COUNT"]='.$CHAR_NAME[$i+1]["COUNT"]."
"; echo '$CHAR_NAME[$i+1]["SERIES"]='.$CHAR_NAME[$i+1]["SERIES"]."
"; echo '$CHAR_NAME[$i+1]["ID"]='.$CHAR_NAME[$i+1]["ID"]."
"; echo '$SERIES_NAME[$CHAR_NAME[$i+1]["SERIES"]]["NAME"]='.$SERIES_NAME[$CHAR_NAME[$i+1]["SERIES"]]["NAME"]."

"; */ }; $numof_series++; $no_valids=0; unset($SERIES_ID_POS); unset($CHAR_ID_POS); for ($i=0;$i<$numof_series;$i++) { $SERIES_ID_POS[$SERIES_NAME[$i]["ID"]] = $i; }; for ($i=0;$i<$numof_charlist+1;$i++) { $CHAR_ID_POS[$CHAR_NAME[$i]["ID"]] = $i; }; for ($i=0;$i<$numof_datalist;$i++) { $entry = explode("=",trim($datalist[$i])); $yourchoice = explode("{|}",$entry[1]); unset($choiced); $valid=true; $numof_choiced=0; for ($j=0;$j<$BEST;$j++) { if ($yourchoice[$j]!=null and $CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["NAME"]!="該当無し" and $choiced[$yourchoice[$j]]!="yes") { $numof_choiced++; $choiced[$yourchoice[$j]]="yes"; } else { if ($yourchoice[$j]!=null and $CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["NAME"]!="該当無し" and $choiced[$yourchoice[$j]]=="yes") { $valid=false; }; }; }; unset($choiced); unset($choiced_series); if ($valid==true) { for ($j=0;$j<$BEST;$j++) { if ($yourchoice[$j]!=null and $CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["NAME"]!="該当無し" and $choiced[$yourchoice[$j]]!="yes") { $CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["COUNT"]+= ($BEST-$j); $SERIES_NAME[$SERIES_ID_POS[$CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["SERIES"]]]["COUNT"]+= ($BEST-$j); $CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["MEMBER"]+= 1; if ($choiced_series[$CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["SERIES"]]!="yes") { $SERIES_NAME[$SERIES_ID_POS[$CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["SERIES"]]]["MEMBER"]+= 1; $choiced_series[$CHAR_NAME[$CHAR_ID_POS[$yourchoice[$j]]]["SERIES"]]="yes"; }; $choiced[$yourchoice[$j]]="yes"; }; }; } else { $no_valids++; }; }; $CHAR_NAME[0]["COUNT"]=0; $SERIES_NAME[0]["COUNT"]=0; // 該当無しのカウントを0にリセット usort($SERIES_NAME,"comp_count"); usort($CHAR_NAME,"comp_count"); unset($SERIES_ID_POS); unset($CHAR_ID_POS); for ($i=0;$i<$numof_series;$i++) { $SERIES_ID_POS[$SERIES_NAME[$i]["ID"]] = $i; }; for ($i=0;$i<$numof_charlist+1;$i++) { $CHAR_ID_POS[$CHAR_NAME[$i]["ID"]] = $i; }; $color_toggler = array("#FFFFFF","#DDDDDD"); echo $numof_datalist."名の方のデータが記録されています。
"; if ($no_valids>0) { echo "残念ながら、".$no_valids."名分の無効票があります。これらはカウントされません。
"; }; if ($imode==false) { $lastmodified = date("Y年m月d日 H時i分s秒",filemtime($datalist_filename)); } else { $lastmodified = "
".date("Y/m/d",filemtime("dt.log"))."
".date("H:i:s",filemtime($datalist_filename)); }; echo "最終更新:".$lastmodified."

\n"; $ranking=1; $now_point=$CHAR_NAME[0]["COUNT"]; echo "キャラクタ人気ランキング(ポイント制)!!
"; echo ""; echo "\n"; for ($i=0;$i<$numof_charlist+1;$i++) { if ($now_point>$CHAR_NAME[$i]["COUNT"]) { $now_point=$CHAR_NAME[$i]["COUNT"]; $ranking=$i+1; $toggler=($toggler+1)%2; }; if ($now_point>0) { echo "\n"; }; }; echo "
順位キャラ名ポイント
".($ranking)."".$CHAR_NAME[$i]["NAME"]."(".$SERIES_NAME[$SERIES_ID_POS[$CHAR_NAME[$i]["SERIES"]]]["NAME"].")".$CHAR_NAME[$i]["COUNT"]."


"; $ranking=1; $now_point=$SERIES_NAME[0]["COUNT"]; $toggler=0; echo "人気キャラクタ所有作品ランキング(ポイント制)!!
"; echo ""; echo "\n"; for ($i=0;$i<$numof_series;$i++) { if ($now_point>$SERIES_NAME[$i]["COUNT"]) { $now_point=$SERIES_NAME[$i]["COUNT"]; $ranking=$i+1; $toggler=($toggler+1)%2; }; if ($now_point>0) { echo "\n"; }; }; echo "
順位シリーズ名ポイント
".($ranking)."".$SERIES_NAME[$i]["NAME"]."".$SERIES_NAME[$i]["COUNT"]."


"; usort($SERIES_NAME,"comp_member"); usort($CHAR_NAME,"comp_member"); unset($SERIES_ID_POS); unset($CHAR_ID_POS); for ($i=0;$i<$numof_series;$i++) { $SERIES_ID_POS[$SERIES_NAME[$i]["ID"]] = $i; }; for ($i=0;$i<$numof_charlist+1;$i++) { $CHAR_ID_POS[$CHAR_NAME[$i]["ID"]] = $i; }; $ranking=1; $now_point=$CHAR_NAME[0]["COUNT"]; echo "キャラクタ人気ランキング(人数制)!!
"; echo ""; echo "\n"; for ($i=0;$i<$numof_charlist+1;$i++) { if ($now_point>$CHAR_NAME[$i]["MEMBER"]) { $now_point=$CHAR_NAME[$i]["MEMBER"]; $ranking=$i+1; $toggler=($toggler+1)%2; }; if ($now_point>0) { echo "\n"; }; }; echo "
順位キャラ名選んだ人数
".($ranking)."".$CHAR_NAME[$i]["NAME"]."(".$SERIES_NAME[$SERIES_ID_POS[$CHAR_NAME[$i]["SERIES"]]]["NAME"].")".$CHAR_NAME[$i]["MEMBER"]."


"; $ranking=1; $now_point=$SERIES_NAME[0]["COUNT"]; $toggler=0; echo "人気キャラクタ所有作品ランキング(人数制)!!
"; echo ""; echo "\n"; for ($i=0;$i<$numof_series;$i++) { if ($now_point>$SERIES_NAME[$i]["MEMBER"]) { $now_point=$SERIES_NAME[$i]["MEMBER"]; $ranking=$i+1; $toggler=($toggler+1)%2; }; if ($now_point>0) { echo "\n"; }; }; echo "
順位シリーズ名選んだ人数
".($ranking)."".$SERIES_NAME[$i]["NAME"]."".$SERIES_NAME[$i]["MEMBER"]."


"; echo "





\n"; if ($imode==true) { echo "X-Site
\n"; } else { echo "X-Site
\n"; }; echo "SHIMSOFT presents.
\n If you have any question, please contact to me.\n
\n \n \n";