Beispiel #1
0
        ?>
" <?php 
        echo !$hidden ? 'checked' : '';
        ?>
 />
<?php 
    }
    // Some quick count queries
    $qcount = $__char_db->query("\nSELECT\n\t(SELECT COUNT(DISTINCT a.questid) FROM (SELECT questid FROM quests_done WHERE character_id = " . $internal_id . " UNION ALL SELECT questid FROM quests_done_party WHERE character_id = " . $internal_id . ") a) as `quests_done`,\n\t(SELECT COUNT(DISTINCT a.questid) FROM (SELECT questid FROM quests_running WHERE character_id = " . $internal_id . " UNION ALL SELECT questid FROM quests_running_party WHERE character_id = " . $internal_id . ") a) as `quests_left`,\n\t(SELECT COUNT(*) FROM skills WHERE character_id = " . $internal_id . ") as `skills`\n");
    $statistics = $qcount->fetch_assoc();
    $qcount->free();
    $avatarurl = 'http://' . $locale_domain . '/ignavatar/' . $character_info['name'] . '?size=big&flip';
    $expbar = array();
    $expbar['current'] = $character_info['exp'];
    $expbar['max'] = GetNextLevelEXP($character_info['level'], $character_info['exp']);
    $expbar['percentage'] = GetExpPercentage($character_info['level'], $character_info['exp']);
    $expbar['percentage'] = round($expbar['percentage'] * 100) / 100;
    ?>
<div class="row">
	<div class="span12">
	<?php 
    if ($character_info['account_id'] !== '2') {
        ?>
		<a href="//<?php 
        echo $account->GetUsername();
        ?>
.<?php 
        echo $domain;
        ?>
/" class="btn btn-mini pull-right" style="margin-bottom: 10px">Return to <?php 
        echo $account->GetNickName();
Beispiel #2
0
if ($request_type == 'visibility') {
    if (!$_loggedin) {
        JSONDie('Not loggedin');
    }
    RetrieveInputGET('name', 'what', 'shown');
    $internalid = IsOwnCharacter($P['name'], CURRENT_LOCALE);
    if ($internalid === false) {
        JSONDie('No.');
    }
    $q = $_char_db->query("\nINSERT INTO\n\tcharacter_options\nVALUES\n\t(\n\t\t" . $internalid . ",\n\t\t'display_" . $_char_db->real_escape_string($P['what']) . "',\n\t\t" . ($P['shown'] == 'false' ? 0 : 1) . "\n\t)\nON DUPLICATE KEY UPDATE\n\t`option_value` = VALUES(`option_value`)");
    if ($_char_db->affected_rows != 0) {
        JSONAnswer(array('result' => 'okay'));
    } else {
        JSONAnswer(array('result' => 'failure'));
    }
} elseif ($request_type == 'statistics') {
    RetrieveInputGET('name');
    $q = $_char_db->query("\nSELECT \n\tchr.name,\n\tw.world_name,\n\tchr.channel_id AS channel,\n\tchr.level,\n\tchr.job,\n\tchr.fame,\n\tchr.str,\n\tchr.dex,\n\tchr.int,\n\tchr.luk,\n\tchr.exp,\n\tchr.map,\n\tchr.honourlevel AS honorlevel,\n\tchr.honourexp AS honorexp,\n\tmesos,\n\tTIMESTAMPDIFF(SECOND, last_update, NOW()) AS `seconds_since`\nFROM\n\t`characters` chr\nLEFT JOIN \n\tworld_data w\n\tON\n\t\tw.world_id = chr.world_id\nWHERE \n\tchr.name = '" . $_char_db->real_escape_string($P['name']) . "'");
    if ($q->num_rows == 0) {
        JSONDie('Character not found', 404);
    }
    $row = $q->fetch_assoc();
    $percenta = GetExpPercentage($row['level'], $row['exp']);
    $percentb = round($percenta * 100) / 100;
    $job = GetJobname($row['job']);
    $map = GetMapname($row['map'], CURRENT_LOCALE);
    $extra = array('percentage' => $percentb, 'job_name' => $job, 'map_name' => $map);
    $answer = $row + $extra;
    $q->free();
    JSONAnswer(array('result' => $answer));
}