コード例 #1
0
ファイル: functions.php プロジェクト: andrewroth/winbolo
function doPlayerModify($userName, $email, $password, $password2, $gametype, $blurb, $showemail, $showblurb, $sig, $website, $icq, $aim, $yahoo, $msn, $occ, $showforward)
{
    $pid = getPid($userName);
    $email = stripslashes($email);
    $password = stripslashes($password);
    $password2 = stripslashes($password2);
    $gametype = stripslashes($gametype);
    $blurb = stripslashes($blurb);
    $showemail = stripslashes($showemail);
    $showblurb = stripslashes($showblurb);
    $sig = stripslashes($sig);
    $icq = stripslashes($icq);
    $aim = stripslashes($aim);
    $yahoo = stripslashes($yahoo);
    $msn = stripslashes($msn);
    $occ = stripslashes($occ);
    $showforard = stripslashes($showforward);
    # Do check of changing email address if forward is set and disallow it
    $pc = getPlayerClass($userName);
    if ($pc == null) {
        return "Error retrieving details";
    }
    if ($pc->getEmailForward() == "1" && $email != $pc->getEmail()) {
        return "You have requested to change your email address and have an email forward enabled. You must first disable your email forward before changing your email address then re-enable it afterwards.";
    }
    if ($showforward != "1") {
        $showforward = "0";
    }
    if (!ereg(".+\\@.+\\..+", $email) || !ereg("^[a-zA-Z0-9_@.-]+\$", $email)) {
        return "Email address is not valid: {$email}";
    }
    if ($pid == 0) {
        return "Unexpected Error";
    }
    if ($password != "") {
        if ($password != $password2) {
            return "Sorry, your passwords do not match";
        }
        $passwd = md5($password);
        $query = "update users set user_password = \"" . $passwd . "\" where user_id = " . $pid;
        mysql_query($query);
    }
    $sig = chop($sig);
    // Strip all trailing whitespace.
    $sig = addslashes($sig);
    $website = trim($website);
    if (substr(strtolower($website), 0, 7) != "http://") {
        $website = "http://" . $website;
    }
    if ($website == "http://") {
        $website = "";
    }
    $website = addslashes($website);
    // Check if the ICQ number only contains digits
    $icq = ereg("^[0-9]+\$", $icq) ? $icq : '';
    $aim = addslashes($aim);
    $yim = addslashes($yahoo);
    $msnm = addslashes($msn);
    $occ = addslashes($occ);
    $blurb = mysql_escape_string($blurb);
    if ($showemail == "1") {
        $sqlviewemail = "1";
    } else {
        $sqlviewemail = "0";
    }
    if ($showblurb == "1") {
        $sqlviewblurb = "1";
    } else {
        $sqlviewblurb = "0";
    }
    $sql = "update users set user_email = '{$email}', user_icq = '{$icq}', user_website = '{$website}', user_aim = '{$aim}', user_viewemail = '{$sqlviewemail}', user_yim='{$yim}', user_msnm='{$msnm}', user_game_type = '{$gametype}', user_viewblurb='{$sqlviewblurb}', user_blurb='{$blurb}', user_sig='{$sig}', user_occ='{$occ}', user_showforward = '{$showforward}' where user_id='{$pid}'";
    mysql_query($sql);
    return "OK";
}
コード例 #2
0
ファイル: playermodify.php プロジェクト: andrewroth/winbolo
<?php

$html_title = "WinBolo.net: Modify Player";
require "../php/header.php";
include "{$BASE_FILES}/inc_top.php";
if ($userdata['session_logged_in'] == false) {
    $error_message = "You must login before you can use this page.";
    include "{$BASE_FILES}/inc_error.php";
} else {
    $player = getPlayerClass($userdata['username']);
    include "{$BASE_FILES}/inc_playermodify.php";
}
include "{$BASE_FILES}/inc_bottom.php";
コード例 #3
0
ファイル: playerinfo.php プロジェクト: andrewroth/winbolo
<?php

$html_title = "WinBolo.net: Player Statistics";
require "../php/header.php";
include "{$BASE_FILES}/inc_top.php";
$name = $HTTP_GET_VARS['name'];
$name = str_replace("\\", "", $name);
$pid = getPid($name);
if ($pid == 0 || $name == "Administrator" || $name == "Anonymous") {
    $error_body = "Player does not exist.";
    require "{$BASE_FILES}/inc_error.php";
} else {
    $player = getPlayerClass($name);
    $map = getPlayerMap($player->getId());
    include "{$BASE_FILES}/inc_playerdetails.php";
}
require "{$BASE_FILES}/inc_bottom.php";
コード例 #4
0
function getTop100Players()
{
    global $db, $players_group_and_order, $armory_url, $ALLIANCE, $HORDE, $ALLIANCE_RACES, $HORDE_RACES;
    $query = sprintf("SELECT character_guid, count(character_guid) AS count, characters.name as character_name, characters.level as character_level FROM pvpstats_players INNER JOIN pvpstats_battlegrounds ON pvpstats_players.battleground_id = pvpstats_battlegrounds.id INNER JOIN characters ON pvpstats_players.character_guid = characters.guid WHERE characters.deleteDate IS NULL AND pvpstats_players.winner = 1 %s LIMIT 0,100", $players_group_and_order);
    $result = $db->query($query);
    if (!$result) {
        die("Error querying: " . $query);
    }
    $row = $result->fetch_array();
    if ($row == null) {
        return;
    }
    $position = 1;
    if (!isset($armory_url) || $armory_url == "") {
        $player_name = sprintf("<span style=\"color: %s; \"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $row['character_name']);
    } else {
        $player_name = sprintf("<a style=\"color: %s; \" target=\"_blank\" href=\"%s%s\"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $armory_url, $row['character_name'], $row['character_name']);
    }
    $player_guild = getPlayerGuild($row['character_guid']);
    $guild_name = getGuildName($player_guild);
    printf("<tr><td>%d</td><td>%s</td><td style=\"min-width: 46px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td><td>%s</td><td><strong><a href=\"#%s\"><span style=\"color: %s\">%s</span></a></strong></td><td>%d</td></tr>", $position, $player_name, getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']), $row['character_level'], $guild_name, getGuildColor($player_guild), $guild_name, $row['count']);
    $prev_score = $row['count'];
    if (!isset($armory_url) || $armory_url == "") {
        while (($row = $result->fetch_array()) != null) {
            if ($prev_score != $row['count']) {
                $position++;
            }
            $player_name = sprintf("<span style=\"color: %s; \"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $row['character_name']);
            $player_guild = getPlayerGuild($row['character_guid']);
            $guild_name = getGuildName($player_guild);
            printf("<tr><td>%d</td><td>%s</td><td style=\"min-width: 46px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td><td>%s</td><td><strong><a href=\"#%s\"><span style=\"color: %s\">%s</span></a></strong></td><td>%d</td></tr>", $position, $player_name, getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']), $row['character_level'], $guild_name, getGuildColor($player_guild), $guild_name, $row['count']);
            $prev_score = $row['count'];
        }
    } else {
        while (($row = $result->fetch_array()) != null) {
            if ($prev_score != $row['count']) {
                $position++;
            }
            $player_name = sprintf("<a style=\"color: %s; \" target=\"_blank\" href=\"%s%s\"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $armory_url, $row['character_name'], $row['character_name']);
            $player_guild = getPlayerGuild($row['character_guid']);
            $guild_name = getGuildName($player_guild);
            printf("<tr><td>%d</td><td>%s</td><td style=\"min-width: 46px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td><td>%s</td><td><strong><a href=\"#%s\"><span style=\"color: %s\">%s</span></a></strong></td><td>%d</td></tr>", $position, $player_name, getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']), $row['character_level'], $guild_name, getGuildColor($player_guild), $guild_name, $row['count']);
            $prev_score = $row['count'];
        }
    }
}
コード例 #5
0
                 if ($attr_count > 3) {
                     printf("<td>%s</td>", $row['attr_4']);
                     if ($attr_count > 4) {
                         printf("<td>%s</td>", $row['attr_5']);
                     }
                 }
             }
         }
         printf("</tr>");
     }
 } else {
     while (($row = $result->fetch_array()) != null) {
         printf("<tr>");
         $player_name = sprintf("<a style=\"color: %s; \" target=\"_blank\" href=\"%s%s\"><strong>%s</strong></a>", getPlayerColor($row['character_guid']), $armory_url, getPlayerName($row['character_guid']), getPlayerName($row['character_guid']));
         printf("<td>%s</td>", $player_name);
         printf("<td style=\"min-width: 49px; padding-left: 0; padding-right: 0;\"><img src=\"img/class/%d.gif\"> <img src=\"img/race/%d-%d.gif\"></td>", getPlayerClass($row['character_guid']), getPlayerRace($row['character_guid']), getPlayerGender($row['character_guid']));
         printf("<td>%s</td>", $row['score_killing_blows']);
         printf("<td>%s</td>", $row['score_deaths']);
         printf("<td>%s</td>", $row['score_honorable_kills']);
         printf("<td>%s</td>", $row['score_bonus_honor']);
         printf("<td>%s</td>", $row['score_damage_done']);
         printf("<td>%s</td>", $row['score_healing_done']);
         printf("<td>%s</td>", $row['attr_1']);
         if ($attr_count > 1) {
             printf("<td>%s</td>", $row['attr_2']);
             if ($attr_count > 2) {
                 printf("<td>%s</td>", $row['attr_3']);
                 if ($attr_count > 3) {
                     printf("<td>%s</td>", $row['attr_4']);
                     if ($attr_count > 4) {
                         printf("<td>%s</td>", $row['attr_5']);