Ejemplo n.º 1
0
if ($q->num_rows == 0) {
    $q->free();
    ?>
<center>
	<img src="//<?php 
    echo $locale_domain;
    ?>
/inc/img/no-character.gif" />
	<p>Character not found! The character may have been removed or hidden.</p>
</center>
<?php 
    require_once __DIR__ . '/../inc/footer.php';
    die;
}
$character_info = $q->fetch_assoc();
$character_account_id = GetCharacterAccountId($character_info['id'], CURRENT_LOCALE);
$character_info['guildname'] = '';
$q2 = $__char_db->query("\nSELECT\n\tg.name\nFROM\n\tcharacters c\nLEFT JOIN\n\tguild_members gm\n\tON\n\t\tgm.character_id = c.id\nLEFT JOIN\n\tguilds g\n\tON\n\t\tg.id = gm.guild_id\nWHERE\n\tc.internal_id = " . $character_info['internal_id']);
if ($q2->num_rows == 1) {
    // Try to fetch guildname
    $row2 = $q2->fetch_row();
    if ($row2[0] !== null) {
        $character_info['guildname'] = $row2[0];
    }
}
$q2->free();
// Check character status
$friend_status = $_loggedin ? $character_account_id == $_loginaccount->GetID() ? 'FOREVER_ALONE' : GetFriendStatus($_loginaccount->GetID(), $character_account_id) : 'NO_FRIENDS';
$status = GetCharacterStatus($character_info['id'], CURRENT_LOCALE);
if ($status == 1 && (!$_loggedin || $_loggedin && $friend_status != 'FRIENDS' && $friend_status != 'FOREVER_ALONE' && $_loginaccount->GetAccountRank() < RANK_MODERATOR)) {
    ?>
Ejemplo n.º 2
0
?>
			<form class="form-horizontal" method="post">
<script type="text/javascript">
function DeleteCharacter(id) {
	if (confirm("Are you sure you want to delete this character?")) {
		document.location.href = '?deletecharacter=' + id;
	}
}
</script>

<?php 
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    if (isset($_GET['deletecharacter'])) {
        $id = intval($_GET['deletecharacter']);
        $name = GetCharacterName($id, CURRENT_LOCALE);
        $character_account_id = GetCharacterAccountId($id, CURRENT_LOCALE);
        echo $name;
        echo $character_account_id;
        $cerror = '';
        if ($_loginaccount->GetID() !== $character_account_id) {
            DisplayError(6);
            $cerror = 'nope';
        }
        echo $cerror;
        if ($id != NULL && ($cerror = NULL)) {
            Logging('characterdeletion', $name, $_loginaccount->GetID(), NULL);
            ?>
<p class="alert-info alert fademeout">Successfully requested deletion of <?php 
            echo $name;
            ?>
.<p>
Ejemplo n.º 3
0
function GetCharacterStatus($id, $locale, $account = NULL)
{
    global $__database;
    $accountLoaded = $account !== NULL;
    if (!$accountLoaded) {
        $account = Account::Load(intval(GetCharacterAccountId($id, $locale)));
    }
    $name = GetCharacterName($id, $locale);
    $value = $account->GetCharacterDisplayValue($name);
    if (!$accountLoaded) {
        // Clear data
        unset($account);
    }
    return $value;
}