Beispiel #1
0
                
                <div class="container_3 account-wide" align="center">
                    <div class="avatars_groups">
                    <div id="dk"><h1>DEATHKNIGHT</h1></div>
					<div id="druid"><h1>DRUID</h1></div>
					<div id="hunter"><h1>HUNTER</h1></div>
					<div id="mage"><h1>MAGE</h1></div>
					<div id="paladin"><h1>PALADIN</h1></div>
					<div id="priest"><h1>PRIEST</h1></div>
					<div id="rogue"><h1>ROGUE</h1></div>
					<div id="shaman"><h1>SHAMAN</h1></div>
					<div id="warlock"><h1>WARLOCK</h1></div>
					<div id="warrior"><h1>WARRIOR</h1></div>
                    <?php 
//Let's display our galleries
$storage = new AvatarGallery();
foreach ($storage->getGalleries() as $RequiredRank => $avatars) {
    $GalleryRank = new UserRank($RequiredRank);
    //make sure we have any avatars in this gallery
    if (count($avatars) == 0) {
        continue;
    }
    //Staff avatars, skip for users
    if ($RequiredRank >= RANK_STAFF_MEMBER) {
        if ($CURUSER->getRank()->int() < RANK_STAFF_MEMBER) {
            continue;
        }
    }
    echo '
                        <div class="avatars_group_holder ', $CURUSER->getRank()->int() < $RequiredRank ? 'not_avaliable' : '', '">
                           
Beispiel #2
0
 public function getAvatar()
 {
     if ((int) $this->get('avatarType') == AVATAR_TYPE_GALLERY) {
         $gallery = new AvatarGallery();
         return $gallery->get($this->get('avatar'));
     } else {
         if ((int) $this->get('avatarType') == AVATAR_TYPE_UPLOAD) {
             return new Avatar(0, $this->get('avatar'), 0, AVATAR_TYPE_UPLOAD);
         }
     }
     return false;
 }
Beispiel #3
0
     $arr['author_str'] = $userInfo['displayName'];
     //prepare the avatar
     if ((int) $userInfo['avatarType'] == AVATAR_TYPE_GALLERY) {
         $gallery = new AvatarGallery();
         $Avatar = $gallery->get((int) $userInfo['avatar']);
         unset($gallery);
     } else {
         if ((int) $userInfo['avatarType'] == AVATAR_TYPE_UPLOAD) {
             $Avatar = new Avatar(0, $userInfo['avatar'], 0, AVATAR_TYPE_UPLOAD);
         }
     }
 } else {
     $userRank = new UserRank(0);
     $arr['author_str'] = 'Unknown';
     $arr['author_rank'] = 'Unknown';
     $gallery = new AvatarGallery();
     $Avatar = $gallery->get(0);
     unset($gallery);
 }
 //format the time
 $arr['added'] = date('D M j, Y, h:i A', strtotime($arr['added']));
 //Is staff post
 $staffPost = $CORE->hasFlag((int) $arr['flags'], WCF_FLAGS_STAFF_POST);
 //Is deleted
 $deletedPost = (int) $arr['deleted_by'] > 0 ? true : false;
 //Resolve the deletion author
 if ($deletedPost) {
     $userInfo = WCF::getAuthorInfo($arr['deleted_by']);
     $arr['deleted_by_str'] = $userInfo['displayName'];
     unset($userInfo);
     $arr['deleted_time'] = date('D M j, Y, h:i A', strtotime($arr['deleted_time']));
Beispiel #4
0
    //Find the auth record
    $authRes = $AUTH_DB->prepare("SELECT * FROM `account` WHERE `id` = :acc LIMIT 1;");
    $authRes->bindParam(':acc', $account, PDO::PARAM_INT);
    $authRes->execute();
    //Fetch it
    $authRecord = $authRes->fetch();
    echo '
					<div class="column left">
						<h3>Web Record</h3>
						<table>';
    //Setup the rank
    $Rank = new UserRank($webRecord['rank']);
    //Setup the avatr
    //prepare the avatar
    if ((int) $webRecord['avatarType'] == AVATAR_TYPE_GALLERY) {
        $gallery = new AvatarGallery();
        $Avatar = $gallery->get((int) $webRecord['avatar']);
        unset($gallery);
    } else {
        if ((int) $webRecord['avatarType'] == AVATAR_TYPE_UPLOAD) {
            $Avatar = new Avatar(0, $webRecord['avatar'], 0, AVATAR_TYPE_UPLOAD);
        }
    }
    echo '
							<tr><td>ID</td><td>', $webRecord['id'], '</td></tr>
							<tr><td>Display Name</td><td>', $webRecord['displayName'], '</td></tr>
							<tr><td>Silver</td><td>', $webRecord['silver'], '</td></tr>
							<tr><td>Gold</td><td>', $webRecord['gold'], '</td>
							<tr><td>Birthday</td><td>', $webRecord['birthday'], '</td></tr>
							<tr><td>Gender</td><td>', $webRecord['gender'], '</td></tr>
							<tr><td>Country</td><td>', $webRecord['country'], '</td></tr>
Beispiel #5
0
<?php

if (!defined('init_ajax')) {
    header('HTTP/1.0 404 not found');
    exit;
}
if (!$CURUSER->isOnline()) {
    echo 'You must be logged in!';
    die;
}
$avatarId = isset($_GET['id']) ? (int) $_GET['id'] : false;
if ($avatarId === false) {
    echo 'You must select an avatar first.';
    die;
}
$storage = new AvatarGallery();
//validate the avatar
$newAvatar = $storage->get($avatarId);
if (!$newAvatar) {
    echo 'The selected avatar is invalid.';
    die;
}
unset($storage);
//Let's validate the ranking requirements
if ($newAvatar->rank() > $CURUSER->getRank()->int()) {
    echo 'The selected avatar requires greater user rank.';
    die;
}
$update = $DB->prepare("UPDATE `account_data` SET `avatar` = :avatar, `avatarType` = :type WHERE `id` = :account LIMIT 1;");
$update->bindParam(':account', $CURUSER->get('id'), PDO::PARAM_INT);
$update->bindParam(':avatar', $newAvatar->int(), PDO::PARAM_INT);