forked from DarkstarProject/XiWeb
-
Notifications
You must be signed in to change notification settings - Fork 2
/
myCharacters.php
67 lines (51 loc) · 2.16 KB
/
myCharacters.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
//Check if the config.php file has already been created.
//If so, include it, otherwise display an error message
if (file_exists('config.php')) {
include_once('config.php');
} else {
$_SESSION['errors']['general'] = $lang['error']['config'];
}
//If the system is installed, proceed
//'INSTALLED' is defined in the config.php file
//If the system is not installed, navigate to the install page
if (defined('INSTALLED')) {
//includes.php
include_once('./lang/'.$language.'.inc.php');
include_once('includes/includes.php');
include_once('includes/functions.php');
} else {
// If the config file exists, but the system is not installed, throw an error and redirect to the install directory
$_SESSION['errors']['install'] = $lang['error']['install']['not_installed'];
header("Location: install/index.php");
}
$myCharacters = getMyCharacters();
if(!empty($_GET['index'])){
$selectedCharacter = $myCharacters[$_GET['index']];
} else {
if(!empty($myCharacters)){
$selectedCharacter = $myCharacters[0];
}
}
if(!empty($myCharacters)){
$selectedCharacterSkills = getCharacterSkills($selectedCharacter['charid']);
$selectedCharacterSpells = getCharacterSpells($selectedCharacter['charid']);
$selectedCharacterEquipment = getCharacterEquipment($selectedCharacter['charid']);
$selectedCharacterCurrencies = getCharacterCurrencies($selectedCharacter['charid']);
}
global $jobAbbreviations, $jobNames, $nations, $faces, $races;
function showCharacterJobs($selectedCharacter){
global $jobAbbreviations;
if($selectedCharacter['sjob'] == 0){
return $selectedCharacter['mlvl'].' '.strtoupper($jobAbbreviations[$selectedCharacter['mjob']]);
} else {
return $selectedCharacter['mlvl'].' '.strtoupper($jobAbbreviations[$selectedCharacter['mjob']]).' / '.$selectedCharacter['slvl'].' '.strtoupper($jobAbbreviations[$selectedCharacter['sjob']]);
}
}
//These php files generate the html content to display
include_once('themes/'.$theme.'/views/header.php');
include_once('themes/'.$theme.'/views/navbar.php');
include_once('themes/'.$theme.'/views/myCharacters.php');
include_once('themes/'.$theme.'/views/footer.php');
echo $output;
?>