From 7e556ff7a54ef94e6b7f13ba73a6b1cbfdaf6be0 Mon Sep 17 00:00:00 2001 From: Seph Date: Thu, 2 May 2024 21:29:31 +0200 Subject: [PATCH] =?UTF-8?q?SKS=20=C3=84nderungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tailwind/custom/file-header.css | 2 +- theme/inc/config-routing.php | 3 +- theme/lang/deu.json | 40 ++++++++++++++++++- theme/pages/sks.php | 26 +++++++++--- theme/request.php | 34 ++++++++++------ theme/template-parts/widgets/char_search.php | 10 ++--- theme/wowpress/Frontend/Widgets/BossKills.php | 2 +- 7 files changed, 91 insertions(+), 26 deletions(-) diff --git a/tailwind/custom/file-header.css b/tailwind/custom/file-header.css index 8375223..bbd2902 100644 --- a/tailwind/custom/file-header.css +++ b/tailwind/custom/file-header.css @@ -4,7 +4,7 @@ Theme URI: https://nebelkrieger.de Author: Yorndar Author URI: https://nebelkrieger.de Description: The next gen NK-Theme -Version: 0.1.1 +Version: 0.2.1 Tested up to: 6.2 Requires PHP: 8.0 License: GNU General Public License v2 or later diff --git a/theme/inc/config-routing.php b/theme/inc/config-routing.php index b3ea8a0..7f3a660 100644 --- a/theme/inc/config-routing.php +++ b/theme/inc/config-routing.php @@ -1,6 +1,7 @@ 'index.php?wowpress_page=raid&raid_id=$matches[1]'], ['request/?$' => 'index.php?wowpress_page=form_request'], ['sks/?$' => 'index.php?wowpress_page=sks'], - ['sks/([A-Za-z-]+)?$' => 'index.php?wowpress_page=sks&list_name=$matches[1]'], + ['sks/([A-Za-z-0-9 ]+)?$' => 'index.php?wowpress_page=sks&list_name=$matches[1]'], $wp_rewrite->rules ); }); diff --git a/theme/lang/deu.json b/theme/lang/deu.json index 384bcc9..5809eef 100644 --- a/theme/lang/deu.json +++ b/theme/lang/deu.json @@ -1,9 +1,47 @@ { "Warlock" : "Hexenmeister", "Destruction": "Zerstörung", + "Demonology": "Dämonologie", + "Affliction": "Gebrechen", + "Evoker" : "Rufer", + "Augmentation": "Verstärkung", "Devastation" : "Verheerung", + "Preservation": "Bewahrung", + + "Paladin": "Paladin", "Retribution": "Vergeltung", + "Holy": "Heilig", + "Protection": "Schutz", + "Monk" : "Mönch", - "Windwalker" : "Windläufer" + "Windwalker" : "Windläufer", + "Brewmaster": "Braumeister", + "Mistweaver": "Nebelwirker", + + "Warrior": "Krieger", + "Arms": "Waffen", + "Fury": "Furor", + "_Protection" : "Schutz", + + "Hunter": "Jäger", + "Beast Mastery": "Tierherrschaft", + "Marksmanship": "Treffsicherheit", + "Survival": "Überleben", + + "Rogue": "Schurke", + "Assassination": "Meucheln", + "Outlaw": "Gesetzlosigkeit", + "Subtlety": "Täuschung", + + "Priest": "Priester", + "Discipline": "Disziplin", + "_Holy": "Heilig", + "Shadow": "Schatten", + + "Shaman": "Schamane", + "Elemental": "Elementar", + "Enhancement": "Verstärkung", + "Restoration": "Wiederherstellung" + } \ No newline at end of file diff --git a/theme/pages/sks.php b/theme/pages/sks.php index 33f525b..465cf23 100644 --- a/theme/pages/sks.php +++ b/theme/pages/sks.php @@ -9,9 +9,9 @@ use WoWPress\Models\SKS; set_sidebar_status('top', false); $liste = $GLOBALS['wowpress']['liste']; -if(!empty($liste)){ - $liste = SKS::where('list_name',$liste)->first(); - if(empty($liste->list_name)){ +if (!empty($liste)) { + $liste = SKS::where('list_name', $liste)->first(); + if (empty($liste->list_name)) { $liste = SKS::first(); } } @@ -80,7 +80,7 @@ if (empty($liste->list_name)) { - + @@ -138,7 +138,7 @@ if (empty($liste->list_name)) { +if (current_user_can('wowpress_edit_raids')) : ?>
+ list_name)) : ?> + + +
ID) { - $sks->loot(); } } } break; - case 'fixSKS': - isAllowed('wowpress_edit_raids'); - if (isset($_POST['fixSKS_nonce']) && wp_verify_nonce($_POST['fixSKS_nonce'], 'fixSKS')) { - if (isset($_POST['sks_id']) && isset($_POST['rank'])) { - $sks = SKS::find($_POST['sks_id']); - if ($sks->ID) { - - $sks->rank = intval($_POST['rank']); - $sks->save(); - } + case 'rollSKS': + isAllowed('wowpress_edit_raids'); + if (isset($_POST['rollSKS_nonce']) && wp_verify_nonce($_POST['rollSKS_nonce'], 'rollSKS')) { + if (isset($_POST['list_name'])) { + $sks = SKS::where('list_name', $_POST['list_name'])->first(); + if (!empty($sks->ID)) { + $sks->roll(); } } - break; + } + break; + case 'fixSKS': + isAllowed('wowpress_edit_raids'); + if (isset($_POST['fixSKS_nonce']) && wp_verify_nonce($_POST['fixSKS_nonce'], 'fixSKS')) { + if (isset($_POST['sks_id']) && isset($_POST['rank'])) { + $sks = SKS::find($_POST['sks_id']); + if ($sks->ID) { + + $sks->rank = intval($_POST['rank']); + $sks->save(); + } + } + } + break; } header('Location: ' . $_SERVER['HTTP_REFERER']); diff --git a/theme/template-parts/widgets/char_search.php b/theme/template-parts/widgets/char_search.php index 594f964..803b6d5 100644 --- a/theme/template-parts/widgets/char_search.php +++ b/theme/template-parts/widgets/char_search.php @@ -25,20 +25,20 @@ function hasSearch($specs) $specs) : ?> hasSpec($specs)): ?> -
+
$search) : ?>
class="h-8 border border-red-500" title="Hoch"class="h-8 border border-red-500" title=": Hoch"class="h-8 opacity-70 border border-yellow-500" title="Mittel"class="h-8 opacity-70 border border-yellow-500" title=": Mittel"class="h-8 opacity-50 border border-green-500" title="Niedrig"class="h-8 opacity-50 border border-green-500" title=": Niedrig"class="h-8 opacity-10" title="Suche geschlossen"class="h-8 opacity-10" title=": Suche geschlossen" diff --git a/theme/wowpress/Frontend/Widgets/BossKills.php b/theme/wowpress/Frontend/Widgets/BossKills.php index bdd48be..599ffba 100644 --- a/theme/wowpress/Frontend/Widgets/BossKills.php +++ b/theme/wowpress/Frontend/Widgets/BossKills.php @@ -33,7 +33,7 @@ class BossKills extends Widget } - return (($done/100)*count($bosses))*1000; + return ($done/count($bosses))*100; } public function form($instance)