Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

创建评分系统 #1190

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
117 changes: 117 additions & 0 deletions background/score.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?php
/*
* 你可能会认为你读得懂以下的代码。但是你不会懂的,相信我吧。
* 要是你尝试玩弄这段代码的话,你将会在无尽的通宵中不断地咒骂自己为什么会认为自己聪明到可以优化这段代码。
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

。。。

* 现在请关闭这个文件去玩点别的吧!


* ░░░░░░░░░░░░░░░░░░░░░░░░▄░░
* ░░░░░░░░░▐█░░░░░░░░░░░▄▀▒▌░
* ░░░░░░░░▐▀▒█░░░░░░░░▄▀▒▒▒▐
* ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
* ░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
* ░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌
* ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒
* ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
* ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄
* ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒
* ▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒
* 单身狗就这样默默地看着你,一句话也不说
*/




























Comment on lines +21 to +48
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

$name = $_GET["cname"];
$score = $_GET["score"];
if($score != "good" && $score != "bad"){
echo "[\"code=1\",\"return=error\",\"errormsg=Illegal entry\"]";
exit;
}
else{
if($score == "good){
if(!file_exists($CounterFile)){

$counter = 0;

$cf = fopen($CounterFile,"w");

fputs($cf,'0');

fclose($cf);

}

else{

$cf = fopen($CounterFile,"r");

$counter = trim(fgets($cf,$max_len));

fclose($cf);

}

$counter++;

$cf = fopen($CounterFile,"w");//覆盖写新数据

fputs($cf,$counter);

fclose($cf);
} else{
if(!file_exists($CounterFile)){

$counter = 0;

$cf = fopen($CounterFile,"w");

fputs($cf,'0');

fclose($cf);

}

else{

$cf = fopen($CounterFile,"r");

$counter = trim(fgets($cf,$max_len));

fclose($cf);

}

$counter = counter - 1;

$cf = fopen($CounterFile,"w");

fputs($cf,$counter);

fclose($cf);
}
echo "现在的评分是:".$counter;