Esempio n. 1
0
$pathway_info[] = array('title' => $lang['players_online'], 'link' => 'index.php?n=server&sub=playersonline');
// ==================== //
if (!$_GET['realm']) {
    $realm_list = realm_list();
    $count = count($realm_list);
    if ($count == 1) {
        $id = $DB->selectCell("SELECT `id` FROM `realmlist` ORDER BY `name`");
        $_GET['realm'] = $id;
    }
}
if ($_GET['realm']) {
    $realm_info = get_realm_byid($_GET['realm']);
    $pathway_info[] = array('title' => $realm_info['name'], '');
    $cc = 0;
    $rid = $realm_info['cloneid'] == -1 ? $realm_info['id'] : $realm_info['cloneid'];
    $rrealm_info = get_realm_byid($rid);
    AddMangosFields($rrealm_info['Version']);
    $charinfo_link = $rrealm_info['WowdCharInfoLink'];
    $faction_alliance = 0;
    $faction_horde = 0;
    $total = 0;
    if (check_port_status($rrealm_info['address'], $rrealm_info['port']) !== true) {
        output_message('alert', 'Realm <b>' . $rrealm_info['name'] . '</b> is offline <img src="images/downarrow2.gif" border="0" align="top">');
    } else {
        if (!$rrealm_info['CharacterDatabaseInfo']) {
            output_message('alert', 'Check field <u>CharacterDatabaseInfo</u> in table `realmlist` for realm id=' . $realm_info['id']);
        }
        $wsdb_info = parse_worlddb_info($rrealm_info['CharacterDatabaseInfo']);
        if ($DB) {
            $query = $DB->select("SELECT c.*, a.*   FROM " . $wsdb_info['db'] . ".`characters` as c, `account` as a \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE ((c.`online`='1') AND (c.`account`=a.`id`)) \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY c.`name`");
        }
Esempio n. 2
0
         output_message('alert', $strErrorMsg);
     }
     unset($WSDB);
     unset($WDDB);
 } else {
     if ($_GET['realm'] and ($_GET['action'] and $_GET['guid'])) {
         $bResult = true;
         $strErrorMsg = "";
         $realm = $_GET['realm'];
         $realmid = $DB->selectCell("select `id` from `realmlist` where id=?d", $realm);
         if (!$realmid) {
             $strErrorMsg = 'Not realmid';
             $bResult = false;
         }
         if ($bResult) {
             $realm_info = get_realm_byid($realmid);
             if (!$realm_info['CharacterDatabaseInfo']) {
                 $strErrorMsg = 'Check field <u>CharacterDatabaseInfo</u> in table `realmlist` for realm id=' . $realm_info['id'];
                 $bResult = false;
             }
         }
         AddMangosFields($realm_info['Version']);
         $charinfo_link = $realm_info['WowdCharInfoLink'];
         if ($bResult) {
             $wsdb_info = parse_worlddb_info($realm_info['CharacterDatabaseInfo']);
             $WSDB = DbSimple_Generic::connect("" . $config['db_type'] . "://" . $wsdb_info['user'] . ":" . $wsdb_info['password'] . "@" . $wsdb_info['host'] . ":" . $wsdb_info['port'] . "/" . $wsdb_info['db'] . "");
             if (!$WSDB) {
                 $strErrorMsg = 'Not Connect';
                 $bResult = false;
             }
         }
Esempio n. 3
0
$pathway_info[] = array('title' => $lang['honor'], 'link' => 'index.php?n=server&sub=honor');
// ==================== //
// some config //
$max_display_chars = 40;
// Only top 40 in stats
$realm_list = realm_list();
if (!$_GET['realm']) {
    $realm_list = realm_list();
    $count = count($realm_list);
    if ($count == 1) {
        $id = $DB->selectCell("SELECT `id` FROM `realmlist` ORDER BY `name`");
        $_GET['realm'] = $id;
    }
}
if ($_GET['realm']) {
    $realm_info = get_realm_byid($_GET['realm']);
    $pathway_info[] = array('title' => $realm_info['name'], '');
    if (!$realm_info['CharacterDatabaseInfo']) {
        output_message('alert', 'Check field <u>CharacterDatabaseInfo</u> in table `realmlist` for realm id=' . $realm_info['id']);
    }
    $CHDB_info = parse_worlddb_info($realm_info['CharacterDatabaseInfo']);
    $CHDB = DbSimple_Generic::connect("" . $config['db_type'] . "://" . $CHDB_info['user'] . ":" . $CHDB_info['password'] . "@" . $CHDB_info['host'] . ":" . $CHDB_info['port'] . "/" . $CHDB_info['db'] . "");
    if ($CHDB) {
        $CHDB->setErrorHandler('databaseErrorHandler');
    }
    if ($CHDB) {
        $CHDB->query("SET NAMES " . $config['db_encoding']);
    }
    AddMangosFields($realm_info['Version']);
    $qstr = "SELECT * FROM `characters` AS c, `" . $config['db_name'] . "`.`account` as a\n\t\t\t\t\t     WHERE ((c.`account`= a.`id`) AND (a.`gmlevel`=0) AND (c.`race` IN (?a))\n            AND (c.totalHonorPoints > 0)) ORDER BY c.totalHonorPoints DESC LIMIT " . $max_display_chars . ";";
    $allhonor['alliance'] = array();
Esempio n. 4
0
<?php

if (INCLUDED !== true) {
    exit;
}
// ==================== //
$pathway_info[] = array('title' => 'GM Ticket Manager', 'link' => 'index.php?n=admin&sub=tickets');
// ==================== //
?>

<?php 
$MANG = new Mangos();
$query = array();
$realm_info_new = get_realm_byid($user['cur_selected_realmd']);
$cc = 0;
if (!check_port_status($realm_info_new['address'], $realm_info_new['port']) === true) {
    output_message('alert', 'Realm <b>' . $realm_info_new['name'] . '</b> is offline <img src="templates/offlike/images/downarrow2.gif" border="0" align="top">');
}
$action = array();
if ($project == "trinity") {
    $action = $CHDB->select("SELECT `guid`, `playerGuid`, `name`, `message`,`comment`, `assignedto` FROM `gm_tickets` WHERE `closed` = '0' ORDER BY `guid` ");
    $ticket = array();
    $cc1 = 0;
    $result1 = array();
    if (count($action) > 0) {
        foreach ($action as $result1) {
            if ($color == 1) {
                $color = 2;
            } else {
                $color = 1;
            }
<?php

//========================//
if (INCLUDED !== true) {
    echo "Not Included!";
    exit;
}
//=======================//
// For the search bar
if (isset($_POST['action'])) {
    if ($_POST['action'] == 'sort') {
        redirect('?p=admin&sub=chartools&sort=' . $_POST['sortby'], 1);
    }
}
// Get the realm name
$Realm = get_realm_byid($GLOBALS['cur_selected_realm']);
$Realms = getRealmlist('0');
// Include the SDL files
include 'core/SDL/class.character.php';
include 'core/SDL/class.zone.php';
$Character = new Character();
$Zone = new Zone();
//====== Pagination Code ======/
$limit = 50;
// Sets how many results shown per page
if (!isset($_GET['page']) || !is_numeric($_GET['page'])) {
    $page = 1;
} else {
    $page = $_GET['page'];
}
$limitvalue = $page * $limit - $limit;
define("CACHE_FILE", FALSE);
if (isset($_GET['page'])) {
    $p = $_GET['page'];
} else {
    $p = 1;
}
//===== Calc pages1 =====//
$items_per_pages = 100;
$limit_start = ($p - 1) * $items_per_pages;
// ==================== //
include 'core/SDL/class.zone.php';
include 'core/SDL/class.character.php';
$Zone = new Zone();
$Character = new Character();
$query = array();
$realm_info_new = get_realm_byid($_COOKIE['cur_selected_realm']);
$cc = 0;
// array´s
$query1 = array();
//===== Filter ==========//
if ($_GET['char'] && preg_match("/[a-z]/", $_GET['char'])) {
    $filter = "WHERE `name` LIKE '" . $_GET['char'] . "%'";
} elseif ($_GET['char'] == 1) {
    $filter = "WHERE `name` REGEXP '^[^A-Za-z]'";
} else {
    $filter = '';
}
//Find total number of characters in database -- used to calculate total number of pages
$cc2 = $CDB->count("SELECT count(*) FROM `characters` {$filter}");
$query1 = $CDB->select("SELECT * FROM `characters` {$filter} ORDER BY `name` LIMIT {$limit_start}, {$items_per_pages}");
$cc1 = 0;
function completeOrder()
{
    global $RA, $user, $DB, $WDB, $package, $lang;
    // Lets check to see if the realm is online before starting
    $realm = get_realm_byid($GLOBALS['cur_selected_realm']);
    if (!check_port_status($realm['address'], $realm['port'], 3)) {
        output_message('error', $lang['shop_realm_offline']);
        return FALSE;
    }
    // Second check to see if the user has enough points
    if ($package['wp_cost'] > $user['web_points']) {
        output_message('validation', $lang['not_enough_points']);
        return FALSE;
    }
    // Initiate the command array
    $command = array();
    // If there is an item number for the selected package
    if ($package['item_number'] != 0) {
        $item_array = '';
        $package_array = explode(',', $package['item_number']);
        foreach ($package_array as $a) {
            $item_array .= $a . ":" . $package['quanity'] . " ";
        }
        $command[] = "send items " . $_POST['char'] . " \"" . $lang["shop_mail_subject"] . "\" \"" . $lang["shop_mail_message"] . "\" " . $item_array;
    }
    // If there is an itemset for this package, we need to make a command for that as well
    if ($package['itemset'] != 0) {
        $qray = $WDB->select("SELECT `entry` FROM `item_template` WHERE `itemset`='" . $package['itemset'] . "'");
        $items = '';
        foreach ($qray as $d) {
            $items .= $d['entry'] . ":1 ";
        }
        $command[] = "send items " . $_POST['char'] . " \"" . $lang["shop_mail_subject"] . "\" \"" . $lang["shop_mail_message"] . "\" " . $items;
    }
    // If there is gold in this package, make a command for that
    if ($package['gold'] != 0) {
        $command[] = "send money " . $_POST['char'] . " \"" . $lang["shop_mail_subject"] . "\" \"" . $lang["shop_mail_message"] . "\" " . $package['gold'];
    }
    // === Send the command to the RA Class === //
    $send = $RA->send($command, $GLOBALS['cur_selected_realm']);
    // Catch the result of send. If its a 1 or 2, then the send wasnt successful
    if ($send == 1 || $send == 2) {
        output_message('error', $lang['shop_send_error']);
        return FALSE;
    } else {
        // Initiate our counts
        $success = 0;
        $total_commands = count($command);
        // Return will be in an array, so foreach array variable, we need the result
        foreach ($send as $report) {
            // If in the string, the characters name is listed, then its a success
            if (strpos($report, $_POST['char'])) {
                $success++;
            }
        }
        // If the success count is equal to the total amount of commands sent
        // Then all was successful
        if ($success == $total_commands) {
            output_message('success', 'Items Sent Successfully!');
            // Update the DB, subtracting the cost of the package
            $DB->query("UPDATE `mw_account_extend` SET\r\n\t\t\t\t`web_points`=(`web_points` - " . $package['wp_cost'] . "),  \r\n\t\t\t\t`points_spent`=(`points_spent` + " . $package['wp_cost'] . ")  \r\n\t\t\t   WHERE `account_id` = " . $user['id'] . " LIMIT 1");
        } else {
            output_message('validation', $lang['shop_error']);
        }
    }
}