Skip to content

Commit

Permalink
Fixed GuildGUI in-game functon and minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyut0n committed Nov 16, 2019
1 parent 444c854 commit f28e651
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
1 change: 1 addition & 0 deletions guildgui.php
Expand Up @@ -94,6 +94,7 @@
$char['MemberCount'] = count($guild->get_members());
}
}
sort($mychars); // Rebuild array index

$content->assign('characters', $mychars)
->assign('has_chars', (bool)$mychars)
Expand Down
6 changes: 4 additions & 2 deletions html/guildman.html
Expand Up @@ -41,8 +41,10 @@ <h3>{ui_208}</h3>
</div>
{ENDLOOP:characters}

{IFNOT:INGAME}
<br><br>
<button id="logout-button"><span class="ui-icon ui-icon-arrowreturnthick-1-s"></span> {ui_17}</button>
{ENDIFNOT:INGAME}

</div>

Expand Down Expand Up @@ -197,7 +199,7 @@ <h3>{ui_208}</h3>
$("#guild-privcheck-dialog").dialog( {
modal: true, width: "auto", height: "auto",
buttons: {
"{ui_221}": function() { $(this).dialog("close"); }
"{ui_18}": function() { $(this).dialog("close"); }
}
} );
$("#guild-privcheck-input").autocomplete( {
Expand Down Expand Up @@ -248,7 +250,7 @@ <h3>{ui_208}</h3>
var dialog = $("#guild-charter-dialog");
// Find char and guild info
for( var i = 0; i < MyCharacters.length; i++ ) {
if( MyCharacters[i].GuildID === this.dataset.guild ) break;
if( MyCharacters[i].GuildID == this.dataset.guild ) break;
}
var mychar = MyCharacters[i];
// Update dialog
Expand Down
12 changes: 10 additions & 2 deletions html/main_ingame.html
Expand Up @@ -4,10 +4,18 @@
<meta charset="utf-8">
<link rel="stylesheet" href="css/jquery-ui.min.css">
<link rel="stylesheet" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="css/tabulator.css">
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/spin.js/2.3.2/spin.min.js"></script>
<script src="https://unpkg.com/tabulator-tables@4.4.1/dist/js/tabulator.min.js"></script>
<script src="js/controller.js"></script>
<style>
.content-page {
padding-top: 20px !important;
min-width: 700px !important;
}
</style>
</head>
<body>

Expand Down
8 changes: 3 additions & 5 deletions includes/action.handler.php
Expand Up @@ -117,16 +117,14 @@
if( ! isSet($_GET['Token']) || strlen($_GET['Token']) !== 64 ) die($errormsg);

$token = $cdb->esc($_GET['Token']);

$details = $server->get_token_details($token) or die($errormsg);

$_SESSION['SteamAuth'] = array( 'steam_id' => $details['SteamID'] );
Livemap::set_steam_id($details['SteamID']);
$_SESSION['InGame'] = TRUE;
$_SESSION['CharID'] = intval($details['CharID']);

$redirect = "index.php?livemap_id=$livemap_id&s=guildman";
header("Location: $redirect");
die;
Livemap::$redirect = "index.php?livemap_id=$livemap_id&s=guildman";
Livemap::success_redirect();

break;

Expand Down
2 changes: 1 addition & 1 deletion includes/guildgui.handler.php
Expand Up @@ -38,7 +38,7 @@
if( ! isSet($_POST['charter'], $_POST['public']) ) Livemap::error_redirect();

// Process action in database
$code = $guild->update_charter($_POST['charter'], (bool)$_POST['public']));
$code = $guild->update_charter($_POST['charter'], (bool)$_POST['public']);
($code === 1) && Livemap::success_redirect(Livemap::get_ui_string(242));
Livemap::error_redirect(Livemap::get_ui_string(241+$code));

Expand Down

0 comments on commit f28e651

Please sign in to comment.