Ejemplo n.º 1
0
    <section>
        <section>
            <article>
                <div class="inner">
                    <h1>Character and Guild Demo</h1>
                    <?php 
use bnetlib\Locale\Locale;
use bnetlib\Connection\Stub;
use bnetlib\WorldOfWarcraft;
use bnetlib\Resource\Entity\Wow\Guild\News;
$locale = new Locale(Stub::LOCALE_GB, WorldOfWarcraft::SHORT_NAME);
$wow = new WorldOfWarcraft(new Stub());
$wow->getConnection()->setOptions(array('defaults' => array('region' => Stub::REGION_EU)));
$wow->getServiceLocator()->setLocale($locale);
$guild = $wow->getGuild(array('realm' => 'Blackrock', 'name' => 'Roots of Dragonmaw'));
$char = $wow->getCharacter(array('realm' => 'Blackrock', 'name' => 'Coss', 'fields' => array('guild', 'talents', 'reputation', 'titles', 'professions')));
$tbn = $wow->getThumbnail($char);
printf('<h2><img src="data:image/jpeg;base64,%s" height="26" wight="26"> %s</h2>', base64_encode($tbn->getData()), $char->getFullName());
echo '<table><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>';
echo '<tr>';
echo '<td>Name</td>';
printf('<td>%s</td>', $char->getName());
echo '</tr><tr>';
echo '<td>Realm</td>';
printf('<td>%s</td>', $char->getRealm());
echo '</tr><tr>';
echo '<td>Level</td>';
printf('<td>%d</td>', $char->getLevel());
echo '</tr><tr>';
echo '<td>Race</td>';
printf('<td>%s</td>', $char->getRaceLocale());