예제 #1
0
파일: emblem.php 프로젝트: Clausi/tenebrae
<?php

define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : './../../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
include $phpbb_root_path . 'guild/includes/constants.' . $phpEx;
include $phpbb_root_path . 'guild/includes/functions.' . $phpEx;
include $phpbb_root_path . 'guild/includes/wowarmoryapi.' . $phpEx;
$armory = new BattlenetArmory($GuildRegion, $GuildRealm);
// $armory->setGuildsCacheTTL(1);
$armory->setLocale($armoryLocale);
// $armory->debug('emblem', true);
$guild = $armory->getGuild($GuildName);
$guildData = $guild->getData();
// echo "<pre>";
// print_r($guildData);
// echo "</pre>";
if (!is_array($guildData)) {
    trigger_error("No guild array, armory not reachable", E_USER_ERROR);
    exit;
}
$guild->showEmblem(false, 215);
$guild->saveEmblem($phpbb_root_path . 'guild/' . $GuildRegion . '_' . $GuildRealm . '_' . $GuildName . '.png');
예제 #2
0
<?php

include 'config.php';
$armory = new BattlenetArmory(WOW_REGION, GUILD_SERVER);
// Enable this is if toons with special characters break the API.
// $armory->UTF8(TRUE);
$armory->setLocale(WOW_LOCALE);
// Exclude everything except progression
$armory->characterExcludeFields(array('titles', 'stats', 'talents', 'items', 'reputation', 'professions', 'appearance', 'mounts', 'achievements', 'pvp', 'quests', 'pets', 'guild', 'petSlots', 'audit', 'feed', 'hunterPets'));
$guild = $armory->getGuild(GUILD_NAME);
$members = $guild->getMembers('rank', 'asc');
//Query the armory to get progression data from a number of characters.
function getRawProgress($armory, $members)
{
    $progress = array();
    $count = 0;
    foreach ($members as $id => $char) {
        if ($char['character']['level'] < MAX_LEVEL) {
            unset($members[$id]);
        } else {
            if ($count < CHARACTERS_TO_CHECK) {
                //$info[] = $char['character']['name'];
                $progress[] = $armory->getCharacter($char['character']['name'], GUILD_SERVER);
                $count++;
            }
        }
    }
    return $progress;
}
//Set the boss kill counts in the main boss array
function setKillCounts($progress, $bosses)
예제 #3
0
파일: roster.php 프로젝트: Clausi/tenebrae
<?php

define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : './../../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
include $phpbb_root_path . 'guild/includes/constants.' . $phpEx;
include $phpbb_root_path . 'guild/includes/functions.' . $phpEx;
include $phpbb_root_path . 'guild/includes/wowarmoryapi.' . $phpEx;
$armory = new BattlenetArmory($GuildRegion, $GuildRealm);
$armory->setLocale($armoryLocale);
$armory->UTF8(TRUE);
$guild = $armory->getGuild($GuildName);
$members = $guild->getMembers();
// echo "<pre>";
// print_r($members);
// echo "</pre>";
if (!is_array($members)) {
    trigger_error("No roster array, armory not reachable", E_USER_ERROR);
    exit;
}
foreach ($members as $char) {
    $character = $char['character'];
    $query = "INSERT INTO\n\t\t\t\t\t" . $TableNames['roster'] . "\n\t\t\t\tSET\n\t\t\t\t\tuniquekey = '" . generateKey($character['name'], $db->sql_escape($character['realm']), "EU") . "',\n\t\t\t\t\tname = '" . $db->sql_escape($character['name']) . "',\n\t\t\t\t\trealm = '" . $db->sql_escape($character['realm']) . "',\n\t\t\t\t\tbattlegroup = '" . $db->sql_escape($character['battlegroup']) . "',\n\t\t\t\t\tguild = '" . $db->sql_escape($character['guild']) . "',\n\t\t\t\t\tguildRealm = '" . $db->sql_escape($character['guildRealm']) . "',\n\t\t\t\t\trank = '" . $char['rank'] . "',\n\t\t\t\t\tclass = '" . $character['class'] . "', \n\t\t\t\t\trace = '" . $character['race'] . "',\n\t\t\t\t\tgender = '" . $character['gender'] . "',\n\t\t\t\t\tlevel = '" . $character['level'] . "',\n\t\t\t\t\tachievementPoints = '" . $character['achievementPoints'] . "',\n\t\t\t\t\tthumbnail = '" . $db->sql_escape($character['thumbnail']) . "',\n\t\t\t\t\tthumbnailURL = '" . $db->sql_escape($character['thumbnailURL']) . "',\n\t\t\t\t\tactive = '1',\n\t\t\t\t\tfirstseen = NOW(),\n\t\t\t\t\tcache = NOW()\n\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\trealm = '" . $db->sql_escape($character['realm']) . "',\n\t\t\t\t\tbattlegroup = '" . $db->sql_escape($character['battlegroup']) . "',\n\t\t\t\t\tguild = '" . $db->sql_escape($character['guild']) . "',\n\t\t\t\t\tguildRealm = '" . $db->sql_escape($character['guildRealm']) . "',\n\t\t\t\t\trank = '" . $char['rank'] . "',\n\t\t\t\t\tclass = '" . $character['class'] . "', \n\t\t\t\t\trace = '" . $character['race'] . "',\n\t\t\t\t\tgender = '" . $character['gender'] . "',\n\t\t\t\t\tlevel = '" . $character['level'] . "',\n\t\t\t\t\tachievementPoints = '" . $character['achievementPoints'] . "',\n\t\t\t\t\tthumbnail = '" . $db->sql_escape($character['thumbnail']) . "',\n\t\t\t\t\tthumbnailURL = '" . $db->sql_escape($character['thumbnailURL']) . "',\n\t\t\t\t\tactive = '1',\n\t\t\t\t\tcache = NOW()\n\t\t\t\t";
    $result = $db->sql_query($query);
}
$db->sql_freeresult($result);
// Deactivate characters not seen last 12 hours
$query = "UPDATE " . $TableNames['roster'] . " SET active = 0 WHERE cache < DATE_SUB(NOW(),INTERVAL 12 HOUR)";
$result = $db->sql_query($query);
예제 #4
0
define('IN_PHPBB', true);
$phpbb_root_path = defined('PHPBB_ROOT_PATH') ? PHPBB_ROOT_PATH : './../../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path . 'common.' . $phpEx;
include $phpbb_root_path . 'guild/includes/constants.' . $phpEx;
include $phpbb_root_path . 'guild/includes/functions.' . $phpEx;
include $phpbb_root_path . 'guild/includes/wowarmoryapi.' . $phpEx;
$query = "SELECT uniquekey, name, realm FROM " . $TableNames['roster'] . " WHERE active = '1' AND level >= " . $maxLevel . " ORDER BY lastupdate ASC LIMIT 1";
$result = $db->sql_query($query);
$row = $db->sql_fetchrow($result);
$Character = $row['name'];
echo $uniquekey = $row['uniquekey'];
echo "<br />";
echo $Character;
echo "<br />";
$realm = $row['realm'];
if ($realm == NULL || $realm == '') {
    $realm = $GuildRealm;
}
echo $realm;
echo "<br />";
echo $GuildRegion;
$armory = new BattlenetArmory($GuildRegion, $realm);
$armory->setLocale($armoryLocale);
//$armory->UTF8(TRUE);
$armory->setCharactersCacheTTL($WGPConfig['Cache']);
$CharacterData = $armory->getCharacter($Character);
include 'character_progress.php';
include 'character_ilvl.php';
$query = "UPDATE " . $TableNames['roster'] . " SET lastupdate = NOW() WHERE uniquekey = '" . $uniquekey . "'";
$result = $db->sql_query($query);