fix error and move version to 0.01

This commit is contained in:
2026-05-05 10:35:05 +02:00
parent 8c62335eb3
commit 5cfd377b53
2 changed files with 27 additions and 30 deletions

View File

@@ -2,7 +2,7 @@
/**
* Plugin Name: Go Form Plugin
* Description: Form plugin for Go players
* Version: 1.3
* Version: 0.01
* Author: Nikola Petrov
*/
@@ -48,6 +48,28 @@ function go_form_uninstall() {
register_uninstall_hook(__FILE__, 'go_form_uninstall');
// ========== Helpers ==========
function go_form_get_rank_dropdown($selected = 0) {
$ranks = [
0 => '30k', 1 => '29k', 2 => '28k', 3 => '27k', 4 => '26k',
5 => '25k', 6 => '24k', 7 => '23k', 8 => '22k', 9 => '21k',
10 => '20k', 11 => '19k', 12 => '18k', 13 => '17k', 14 => '16k',
15 => '15k', 16 => '14k', 17 => '13k', 18 => '12k', 19 => '11k',
20 => '10k', 21 => '9k', 22 => '8k', 23 => '7k', 24 => '6k',
25 => '5k', 26 => '4k', 27 => '3k', 28 => '2k', 29 => '1k',
30 => '1d', 31 => '2d', 32 => '3d', 33 => '4d', 34 => '5d',
35 => '6d', 36 => '7d', 37 => '8d', 38 => '9d', 39 => '1p', 40=> '2p',
41 => '3p', 42=> '4p', 43 => '5p', 44=> '6p', 45 => '7p', 46 => '8p', 47 => '9p'
];
$html = '<select name="rank" id="rank">\n';
foreach ($ranks as $value => $label) {
$selected_attr = selected($value, $selected, false);
$html .= " <option value='{$value}'{$selected_attr}>{$label}</option>\n";
}
$html .= "</select>";
echo $html;
}
function go_form_get_forms() {
global $wpdb;
return $wpdb->get_results("SELECT * FROM {$wpdb->prefix}go_form_forms ORDER BY name ASC");

View File

@@ -1,28 +1,3 @@
<?php
// ========== Helpers ==========
function go_form_get_rank_dropdown($selected = 0) {
$ranks = [
0 => '30k', 1 => '29k', 2 => '28k', 3 => '27k', 4 => '26k',
5 => '25k', 6 => '24k', 7 => '23k', 8 => '22k', 9 => '21k',
10 => '20k', 11 => '19k', 12 => '18k', 13 => '17k', 14 => '16k',
15 => '15k', 16 => '14k', 17 => '13k', 18 => '12k', 19 => '11k',
20 => '10k', 21 => '9k', 22 => '8k', 23 => '7k', 24 => '6k',
25 => '5k', 26 => '4k', 27 => '3k', 28 => '2k', 29 => '1k',
30 => '1d', 31 => '2d', 32 => '3d', 33 => '4d', 34 => '5d',
35 => '6d', 36 => '7d', 37 => '8d', 38 => '9d', 39 => '1p', 40=> '2p',
41 => '3p', 42=> '4p', 43 => '5p', 44=> '6p', 45 => '7p', 46 => '8p', 47 => '9p'
];
$html = '<select name="rank" id="rank">\n';
foreach ($ranks as $value => $label) {
$selected_attr = selected($value, $selected, false);
$html .= " <option value='{$value}'{$selected_attr}>{$label}</option>\n";
}
$html .= "</select>";
echo $html;
}
?>
<style>
#egd-popup-overlay {
display: none;
@@ -118,7 +93,7 @@ document.addEventListener('DOMContentLoaded', function() {
alert('Please enter at least 2 characters in first or last name');
return;
}
document.getElementById('egd-results-content').innerHTML = 'Searching...';
document.getElementById('egd-popup-overlay').style.display = 'flex';
@@ -140,7 +115,7 @@ document.addEventListener('DOMContentLoaded', function() {
document.getElementById('egd-results-content').innerHTML = 'Search failed. Try again.';
document.getElementById('egd-popup-overlay').style.display = 'flex';
});
}
}
function displayResults(players) {
const contentDiv = document.getElementById('egd-results-content');
@@ -153,7 +128,7 @@ document.addEventListener('DOMContentLoaded', function() {
contentDiv.appendChild(item);
});
document.getElementById('egd-popup-overlay').style.display = 'flex';
}
}
function selectPlayer(player) {
document.getElementById('first_name').value = player.Name || player.Real_Name || '';
@@ -167,7 +142,7 @@ document.addEventListener('DOMContentLoaded', function() {
function closePopup() {
document.getElementById('egd-popup-overlay').style.display = 'none';
}
}
searchButton.addEventListener('click', fetchPlayers);
closeButton.addEventListener('click', closePopup);