3 Commits
Author SHA1 Message Date
nikola f5b5af5372 Fix pairgoth export 2026-07-05 18:44:30 +02:00
nikola 1d5fed6e1f add email send 2026-06-26 14:11:49 +02:00
nikola d75997fbb5 Add side schrool 2026-06-07 14:40:30 +02:00
7 changed files with 114 additions and 1151 deletions
+25
View File
@@ -0,0 +1,25 @@
WordPress plugin for managing Go (Baduk/Weiqi) tournament registrations. Collects player data via frontend forms and exports entries to tournament management systems (Pairgoth, OpenGotha, McMahon, CSV).
**Relevant files:**
- `main.php` - Plugin entry point with WordPress hooks
- `go-form-plugin/go-form-plugin.php` - Core plugin logic (forms, entries, EGD integration, exports)
- `go-form-plugin/database-schema.sql` - MySQL schema for 4 tables (forms, entries, custom_fields, entry_custom_values)
- `go-form-plugin/export/csv.php` - CSV export handler
- `go-form-plugin/export/pairgoth.php` - Pairgoth JSON export handler
- `go-form-plugin/export/opengotha.php` - OpenGotha XML export handler
- `go-form-plugin/export/mcmahon.php` - McMahon XML export handler
- `go-form-plugin/export/mcmahon-help.php` - McMahon documentation/reference
- `go-form-plugin/templates/form-shortcode.php` - Frontend form template
- `go-form-plugin/templates/settings-page.php` - Admin dashboard template
- `go-form-plugin/templates/table.php` - Entries table display
- `README.md` - Full documentation
**Nuances:**
- Ranks stored as integers (0-47): 0-29=30k-1k, 30-38=1d-9d, 39-47=1p-9p
- Rating auto-calculated: `rating = (rank * 100) - 900`
- EGD integration: searches `https://europeangodatabase.eu/EGD/GetPlayerDataByData.php` and `GetPlayerDataByPIN.php`
- Uses WordPress nonces, `manage_options` capability, `$wpdb->prepare()` for security
- Foreign keys with CASCADE delete
## To LLM
Update this file if the changes you have done are worth updating here. The intent of this file is to give you a rough idea of the project, from where you can explore further, if needed.
+7
View File
@@ -0,0 +1,7 @@
in macMahon export -> under country copy clubs.
Edit in delete button in line
make update person per person
Remove update egd data
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -22,7 +22,7 @@ $count = count($entries);
foreach ($entries as $i => $e) {
$rank = $e->rank - 30;
$id = ($i + 1) * 2;
$out = "{\"id\":$id,\"name\":\"$e->first_name\",\"firstname\":\"$e->last_name\",\"rating\":$e->rating,\"rank\":$rank,\"country\":\"$e->country\",\"club\":\"$e->club\",\"final\":false,\"egf\":\"$e->egd_number\"}";
$out = "{\"id\":$id,\"name\":\"$e->last_name\",\"firstname\":\"$e->first_name\",\"rating\":$e->rating,\"rank\":$rank,\"country\":\"$e->country\",\"club\":\"$e->club\",\"final\":false,\"egf\":\"$e->egd_number\"}";
if ($i + 1 < $count) {
$out .= ",";
}
+12 -1
View File
@@ -229,11 +229,22 @@ function go_form_handle_submission()
}
}
// Send notification email
// $to = 'nikola@petrovv.com';
// $subject = 'New Go Tournament Registration';
// $message = "A new player has signed up:\n\n";
// $message .= "Form ID: {$form_id}\n";
// $message .= "Name: {$data['first_name']} {$data['last_name']}\n";
// wp_mail($to, $subject, $message);
wp_redirect($_SERVER['HTTP_REFERER']);
exit;
}
add_action('admin_post_go_form_handle_submission', 'go_form_handle_submission');
Pleadd_action('admin_post_nopriv_go_form_handle_submission', 'go_form_handle_submission');
add_action('admin_post_nopriv_go_form_handle_submission', 'go_form_handle_submission');
// ========== Shortcode ==========
function go_form_shortcode($atts)
+4 -5
View File
@@ -100,6 +100,10 @@
</select>
</div>
<div>
<label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number">
</div>
<div>
<label for="country">Country*:</label><input type="text" name="country" id="country" required>
</div>
@@ -108,10 +112,6 @@
<label for="club">Club:</label><input type="text" name="club" id="club">
</div>
<div>
<label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number">
</div>
<?php
// Display custom fields
$custom_fields = go_form_get_custom_fields($form_id);
@@ -197,7 +197,6 @@
endforeach;
?>
<p>* Required fields</p>
<input type="submit" name="go_form_submit" value="Submit">
</form>
+7 -2
View File
@@ -1,3 +1,4 @@
<div class="go-form-table-container" style="overflow-x: auto; -webkit-overflow-scrolling: touch;">
<table class="wp-list-table widefat striped">
<thead>
<tr>
@@ -34,7 +35,9 @@
<td> <?= esc_html($ranks[$e->rank]) ?> </td>
<td> <?= esc_html($e->country) ?> </td>
<td> <?= esc_html($e->club) ?> </td>
<td><a href="https://europeangodatabase.eu/EGD/Player_Card.php?&key=<?= esc_html($e->egd_number) ?>"><?= esc_html($e->egd_number) ?> </a> </td>
<td><a
href="<?= esc_url('https://europeangodatabase.eu/EGD/Player_Card.php?&key=' . $e->egd_number) ?>"><?= esc_html($e->egd_number) ?>
</a> </td>
<td> <?= esc_html($e->created_at) ?> </td>
<?php
// Display custom field values
@@ -56,7 +59,8 @@
<td> <?= esc_html($e->rating) ?> </td>
<td>
<a href="<?= add_query_arg(array('page' => 'go-form-settings', 'form_id' => $form_id ?? 0, 'edit_entry' => $e->id), admin_url('admin.php')) ?>" class="button button-small">Edit</a>
<a href="<?= add_query_arg(array('page' => 'go-form-settings', 'form_id' => $form_id ?? 0, 'edit_entry' => $e->id), admin_url('admin.php')) ?>"
class="button button-small">Edit</a>
<?php action_button('go_form_delete_entry', 'Delete', 'Delete this entry?', $e->id); ?>
</td>
@@ -67,3 +71,4 @@
</tbody>
</table>
</div>