diff options
| author | ilotterytea <iltsu@alright.party> | 2025-05-11 16:56:52 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-05-11 16:56:52 +0500 |
| commit | c9cb2871abb095420744783158e4c2cc305825b4 (patch) | |
| tree | 229f552bdecb5d32da518f96f101d697a975eab3 | |
| parent | f2690a42235297c357bcd8abbf6e194db7b7bd57 (diff) | |
feat: option for minimal amount of votes for emote ratings
| -rw-r--r-- | public/emotes/index.php | 2 | ||||
| -rw-r--r-- | src/config.sample.php | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/public/emotes/index.php b/public/emotes/index.php index 811ada2..9a33d1d 100644 --- a/public/emotes/index.php +++ b/public/emotes/index.php @@ -401,7 +401,7 @@ if (CLIENT_REQUIRES_JSON) { <tr> <th>Rating</th> <?php - if ($emote->get_rating()["total"] < 10) { + if ($emote->get_rating()["total"] < RATING_EMOTE_MIN_VOTES) { echo '<td>Not rated (' . $emote->get_rating()["total"] . ')</td>'; } else { diff --git a/src/config.sample.php b/src/config.sample.php index 6998835..5e57ef6 100644 --- a/src/config.sample.php +++ b/src/config.sample.php @@ -16,6 +16,7 @@ define("RATING_NAMES", [ "-1" => "COAL", "1" => "GEM", ]); // Rating names. The schema is [ "id/rating_point" => "name" ]. +define("RATING_EMOTE_MIN_VOTES", 10); // Minimal amount of votes to display emote rating. // UPLOADS define("ANONYMOUS_UPLOAD", false); // Allow anonymous upload for emotes. @@ -59,9 +60,8 @@ define("TWITCH_SECRET_KEY", "BBBBBBBBB"); // Secret key of your Twitch applicati define("TWITCH_REDIRECT_URI", ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https" : "http") . "://$_SERVER[HTTP_HOST]/account/login/twitch.php"); // Redirect URI of your Twitch application. // HCAPTCHA -define("HCAPTCHA_ENABLE", true); // Enable hCaptcha. -define("HCAPTCHA_SECRETKEY", "ES_XXXXXX"); // hCaptcha's secret key. -define("HCAPTCHA_SITEKEY", "YYYYYYY"); // hCaptcha's site key. +define("CAPTCHA_ENABLE", true); // Enable built-in captcha. +define("CAPTCHA_WORDS", ["hello", "apple", "cat"]); // Captcha words. // FOR DEVELOPERS define("CLIENT_REQUIRES_JSON", isset($_SERVER["HTTP_ACCEPT"]) && $_SERVER["HTTP_ACCEPT"] == "application/json");
\ No newline at end of file |
