From b3eb7678d241126e8a5205060d8c3044675aa3e9 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 26 Feb 2026 09:27:45 +0000 Subject: [PATCH] Alpha V1.4c --- admin.php | 136 +++++++++++++++++++++-------------- handler.txt | 0 patch_admin_final.php | 155 ++++++++++++++++++++++++++++++++++++++++ patch_admin_v7.php | 162 ++++++++++++++++++++++++++++++++++++++++++ ui.txt | 0 5 files changed, 399 insertions(+), 54 deletions(-) create mode 100644 handler.txt create mode 100644 patch_admin_final.php create mode 100644 patch_admin_v7.php create mode 100644 ui.txt diff --git a/admin.php b/admin.php index 478f108..d1a22eb 100644 --- a/admin.php +++ b/admin.php @@ -173,13 +173,14 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST[' $orbital_dominance = isset($_POST['orbital_dominance']) ? implode(',', (array)$_POST['orbital_dominance']) : null; $terrestrial_dominance = isset($_POST['terrestrial_dominance']) ? implode(',', (array)$_POST['terrestrial_dominance']) : null; $is_empty_case = isset($_POST['is_empty_case']) ? 1 : 0; + $combine_mode = $_POST['combine_mode'] ?? 'OR'; if ($id > 0) { - $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ? WHERE id = ?"); - $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $id]); + $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ?, combine_mode = ? WHERE id = ?"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode, $id]); } else { - $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); - $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case]); + $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case, combine_mode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode]); } header("Location: admin.php?tab=statuses&success=1"); exit; @@ -942,65 +943,92 @@ if ($tab === 'users') {
-
-
NOMBRE DE FACTIONS :
-
- -
- - -
-
-
- -
- - -
-
-
- -
-
FILTRE DOMINANCE :
+
- -
- -
-
Toutes / Peu importe
-
- - - - + +
+
EN ORBITE
+ +
+ +
+ + +
+
+ +
+ +
+
Toutes / Peu importe
+
+ + + + +
- -
- -
-
Toutes / Peu importe
-
- - - - + +
+ + +
(Orbital) [?] (Sol)
+
+ + +
+
AU SOL
+ +
+ +
+ + +
+
+ +
+ +
+
Toutes / Peu importe
+
+ + + + +
-
+
@@ -1561,7 +1589,7 @@ function editStatus(data) { } function resetRuleForm() { document.getElementById('ruleForm').reset(); - document.getElementById('rule_id').value = 0; + document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR'; updateMSLabel('ms_orb'); updateMSLabel('ms_terr'); } diff --git a/handler.txt b/handler.txt new file mode 100644 index 0000000..e69de29 diff --git a/patch_admin_final.php b/patch_admin_final.php new file mode 100644 index 0000000..40b32e2 --- /dev/null +++ b/patch_admin_final.php @@ -0,0 +1,155 @@ + 0) { + $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ? WHERE id = ?"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $id]); + } else { + $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case]); + }'; + +$new_h = ' $is_empty_case = isset($_POST[\'is_empty_case\']) ? 1 : 0; + $combine_mode = $_POST[\'combine_mode\'] ?? \'OR\'; + + if ($id > 0) { + $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ?, combine_mode = ? WHERE id = ?"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode, $id]); + } else { + $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case, combine_mode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode]); + }'; + +if (strpos($content, $old_h) !== false) { + $content = str_replace($old_h, $new_h, $content); + echo "Handler updated.\n"; +} else { + echo "Handler NOT found (check whitespace/indentation).\n"; +} + +// 2. Update UI +$ui_block_start = '
'; +$ui_block_end = ''; + +$pos_start = strpos($content, $ui_block_start); +$pos_end = strpos($content, $ui_block_end, $pos_start); + +if ($pos_start !== false && $pos_end !== false) { + $new_ui = <<<'HTML' +
+
+ + +
+
EN ORBITE
+ +
+ +
+ + +
+
+ +
+ +
+
Toutes / Peu importe
+
+ + + + +
+
+
+
+ + +
+ + +
(Orbital) [?] (Sol)
+
+ + +
+
AU SOL
+ +
+ +
+ + +
+
+ +
+ +
+
Toutes / Peu importe
+
+ + + + +
+
+
+
+
+ +
+ + +
+
+ + +HTML; + $content = substr($content, 0, $pos_start) . $new_ui . substr($content, $pos_end); + echo "UI updated.\n"; +} else { + echo "UI NOT found.\n"; +} + +// 3. Update JS (resetRuleForm) +if (strpos($content, "document.getElementById('rule_combine').value = 'OR';") === false) { + $content = str_replace( + "document.getElementById('rule_id').value = 0;", + "document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';", + $content + ); + echo "JS updated.\n"; +} + +file_put_contents($file, $content); +echo "Done.\n"; +?> diff --git a/patch_admin_v7.php b/patch_admin_v7.php new file mode 100644 index 0000000..32236a2 --- /dev/null +++ b/patch_admin_v7.php @@ -0,0 +1,162 @@ + 0) { + $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ? WHERE id = ?"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $id]); + } else { + $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case]); + } +'; + +$new_handler = '$is_empty_case = isset($_POST[\'is_empty_case\']) ? 1 : 0; + $combine_mode = $_POST[\'combine_mode\'] ?? \'OR\'; + + if ($id > 0) { + $stmt = $db->prepare("UPDATE celestial_object_status_rules SET name = ?, status_id = ?, profile_id = ?, priority = ?, orbital_count_op = ?, orbital_count_val = ?, terrestrial_count_op = ?, terrestrial_count_val = ?, orbital_dominance = ?, terrestrial_dominance = ?, is_empty_case = ?, combine_mode = ? WHERE id = ?"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode, $id]); + } else { + $stmt = $db->prepare("INSERT INTO celestial_object_status_rules (name, status_id, profile_id, priority, orbital_count_op, orbital_count_val, terrestrial_count_op, terrestrial_count_val, orbital_dominance, terrestrial_dominance, is_empty_case, combine_mode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); + $stmt->execute([$name, $status_id, $profile_id, $priority, $orbital_count_op, $orbital_count_val, $terrestrial_count_op, $terrestrial_count_val, $orbital_dominance, $terrestrial_dominance, $is_empty_case, $combine_mode]); + } +'; + +if (strpos($content, $old_handler) !== false) { + $content = str_replace($old_handler, $new_handler, $content); + echo "Handler patched.\n"; +} else { + echo "Handler NOT found.\n"; +} + +// 2. Update UI (Configuration des règles) +$start_marker = '
'; +$end_marker = 'ENREGISTRER LA RÈGLE'; + +$pos_start = strpos($content, $start_marker); +$pos_end = strpos($content, $end_marker, $pos_start); + +if ($pos_start !== false && $pos_end !== false) { + // We want to replace everything from $start_marker up to just before "ENREGISTRER LA RÈGLE" button + // Actually the UI I prepared includes the background div. + + $new_ui = <<<'HTML' +
+
+ + +
+
EN ORBITE
+ +
+ +
+ + +
+
+ +
+ +
+
Toutes / Peu importe
+
+ + + + +
+
+
+
+ + +
+ + +
(Orbital) [?] (Sol)
+
+ + +
+
AU SOL
+ +
+ +
+ + +
+
+ +
+ +
+
Toutes / Peu importe
+
+ + + + +
+
+
+
+
+ +
+ + +
+
+HTML; + + // Find where the background div ends (it should be before the button) + // We can find the button and look backwards for the last
before it. + $pos_button = strpos($content, '
'); + + // Re-verify that we are replacing the right block + $content = substr($content, 0, $pos_start) . $new_ui . substr($content, $pos_button); + echo "UI patched.\n"; +} else { + echo "UI NOT found.\n"; +} + +// 3. Update JS (resetRuleForm) +if (strpos($content, "document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';") === false) { + $content = str_replace( + "document.getElementById('rule_id').value = 0;", + "document.getElementById('rule_id').value = 0; document.getElementById('rule_combine').value = 'OR';", + $content + ); + echo "JS patched.\n"; +} else { + echo "JS already patched or not found.\n"; +} + +file_put_contents($file, $content); +echo "Final save done.\n"; +?> \ No newline at end of file diff --git a/ui.txt b/ui.txt new file mode 100644 index 0000000..e69de29