diff --git a/spells.php b/spells.php index fe21cb9..2a2f8df 100644 --- a/spells.php +++ b/spells.php @@ -94,148 +94,156 @@ if (user_logged_in() && is_admin($user_data)) { } // End loading spell list -// Preparing data -$configVoc = $config['vocations']; -$types = array_keys($spells); -$itemServer = 'http://'.$config['shop']['imageServer'].'/'; +if ($spells) { + // Preparing data + $configVoc = $config['vocations']; + $types = array_keys($spells); + $itemServer = 'http://'.$config['shop']['imageServer'].'/'; -// Filter spells by vocation -$getVoc = (isset($_GET['vocation'])) ? getValue($_GET['vocation']) : 'all'; -if ($getVoc !== 'all') { - $getVoc = (int)$getVoc; - foreach ($types as $type) - foreach ($spells[$type] as $name => $spell) - if (!empty($spell['vocations'])) - if (!in_array($getVoc, $spell['vocations'])) - unset($spells[$type][$name]); + // Filter spells by vocation + $getVoc = (isset($_GET['vocation'])) ? getValue($_GET['vocation']) : 'all'; + if ($getVoc !== 'all') { + $getVoc = (int)$getVoc; + foreach ($types as $type) + foreach ($spells[$type] as $name => $spell) + if (!empty($spell['vocations'])) + if (!in_array($getVoc, $spell['vocations'])) + unset($spells[$type][$name]); + } + + // Render HTML + ?> + +

Spells

+ +
+ + + +
+ +

Spell types:

+ + +

Instant Spells

+ Jump to top + + + + + + + + + + + + + + + + + + + +
NameWordsLevelManaVocations
', $names); + } + ?>
+ +

Magical Runes

+ Jump to top + + + + + + + + + + + + + + + + + + + +
NameLevelMagic LevelImageVocations
Rune image', $names); + } + ?>
+ +

Conjure Spells

+ Jump to top + + + + + + + + + + + + + + + + + + + + + + + + + +
NameWordsLevelManaSoulChargesImageVocations
Rune image', $names); + } + ?>
+ Jump to top + +

Spells

+

Spells have currently not been loaded into the website by the server admin.

+ - -

Spells

- -
- - - -
- -

Spell types:

- - -

Instant Spells

-Jump to top - - - - - - - - - - - - - - - - - - - -
NameWordsLevelManaVocations
', $names); - } - ?>
- -

Magical Runes

-Jump to top - - - - - - - - - - - - - - - - - - - -
NameLevelMagic LevelImageVocations
Rune image', $names); - } - ?>
- -

Conjure Spells

-Jump to top - - - - - - - - - - - - - - - - - - - - - - - - - -
NameWordsLevelManaSoulChargesImageVocations
Rune image', $names); - } - ?>
-Jump to top - $spells) { data_dump($spells, false, "Type: $type");