예제 #1
0
파일: util.php 프로젝트: Xackery/EQEmuEOC
function purge_characters()
{
    $characters = $_POST['id'];
    foreach ($characters as $character => $id) {
        delete_player($id);
    }
}
예제 #2
0
파일: player.php 프로젝트: Xackery/EQEmuEOC
            $results = search_players_by_id();
        } else {
            $results = search_players_by_name();
        }
        $body->set("results", $results);
        break;
    case 3:
        // Update Player
        check_admin_authorization();
        update_player();
        header("Location: index.php?editor=player&playerid={$playerid}");
        exit;
    case 4:
        // Delete Player
        check_admin_authorization();
        delete_player($playerid);
        if (isset($_GET['acctid'])) {
            header("Location: index.php?editor=account&acctid={$acctid}");
        } else {
            header("Location: index.php?editor=player");
        }
        exit;
}
function get_players($page_number, $results_per_page, $sort_by)
{
    global $mysql;
    $limit = ($page_number - 1) * $results_per_page . "," . $results_per_page;
    $query = "SELECT id, account_id, name, level, class FROM character_data ORDER BY {$sort_by} LIMIT {$limit}";
    $results = $mysql->query_mult_assoc($query);
    return $results;
}
예제 #3
0
                // If a valid hotslogs profile is found
                insert_player($valid_player);
                // Insert the player
                add_action('admin_notices', 'player_added_notice');
                // Show success message
            } else {
                // If scraper returns false
                add_action('admin_notices', 'error_notice_btag');
                // Show error notice take no other action
            }
        } else {
            add_action('admin_notices', 'error_notice_btag');
            // Show error notice take no other action
        }
    } elseif (isset($_POST['delete'])) {
        delete_player($_POST['name']);
        add_action('admin_notices', 'player_deleted_notice');
    }
}
function check_input($tag, $reg)
{
    // BattleTag format : NAME#1234
    $tag = explode('#', $tag);
    // Split the battle tag
    if (sizeof($tag) == 2 && ($reg == 1 || 2)) {
        // Check we have 2 parts to the tag and a valid region
        $tag[0] = sanitize_text_field($tag[0]);
        // Clean the name
        $tag[1] = intval($tag[1]);
        // Clean the ID number
        return $tag;