Replacing avatar with preset

15 years 4 months ago #81138 by duronl
Replacing avatar with preset was created by duronl
Hello,

Im in need of some help, im running a Xbox community and with the new xbox experience adding avatars to gamertags i thougt it would be nice if i could change the avatar that people upload to the actual avatar of people with a xbox live acount.

Example! avatar.xboxlive.com/avatar/Duro%20NL/avatar-body.png

so that when you go to there profile you would see that avatar of them!

I got the followin script that loads there gamercard into the website the script retrieves there gamertag.
i changed it so that it would display the avatar!
[code:1]defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
global $my;

$query = "SELECT cb_gamertag FROM #__comprofiler WHERE id = ". $my->id;
$database->setQuery( $query );
$cb_fieldvalue = htmlspecialchars($database->loadResult());



?>
<img src="avatar.xboxlive.com/avatar//avatar-body.png" scrolling="no" frameBorder="0">
[/code:1]

And i think i need to edit this code:
[code:1] // Display Avatar/Image:
$return = "";
if ( $ueConfig == '1' ) {

$cbMyIsModerator = isModerator( $my->id );
if ( $params->get( 'portrait_descrPos', 'above' ) == "above" ) {
$return .= $this->_writeTabDescription( $tab, $user, 'cbPortraitDescription' );
}

$name = htmlspecialchars(getNameFormat($user->name,$user->username,$ueConfig));
$return .= "\n\t\t\t\t<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" width=\"100%\"><tr>";
$uimage = $user->avatar;
if ( file_exists( "components/com_comprofiler/plugin/language/".$mosConfig_lang."/images" ) ) {
$uimagepath = "components/com_comprofiler/plugin/language/".$mosConfig_lang."/images/";
} else {
$uimagepath = "components/com_comprofiler/plugin/language/default_language/images/";
}
if ( $user->avatarapproved == 0 ) {
$uimage = $uimagepath."pendphoto.jpg";
} elseif ( $user->avatar == '' || $user->avatar == null ) {
$uimage = $uimagepath."nophoto.jpg";
}
else {
$uimage = "images/comprofiler/".$uimage;
}
$return .= "<td align=\"center\" width=\"100%\"><img src=\"".sefRelToAbs($uimage)."\" alt=\"".$name."\" title=\"".$name."\" /></td>";
if ( $user->avatarapproved == 0 && $cbMyIsModerator ) {
$uimage = "images/comprofiler/".$user->avatar;
$return .= "<td align=\"center\" width=\"100%\">"._UE_IMAGE_ADMIN_SUB.":<br /><br />"
. "<img src=\"".$uimage."\" alt=\"".$name."\" title=\"".$name."\" /></td>";
}
$return .= "</tr></table>";

if ( $params->get( 'portrait_descrPos', 'above' ) == "below" ) {
$return .= $this->_writeTabDescription( $tab, $user, 'cbPortraitDescription' );
}[/code:1]

I tried some things, like replacing the image source put that does not work.

does anyone got some pointers for me!

thanks in advance.

regards,
Duro

Post edited by: duronl, at: 2008/12/02 20:40

Founder of Stampgasten.nl & globalxboxcommunity.com
Check: www.stampgasten.nl | www.globalxboxcommunity.com

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.332 seconds

Facebook Twitter LinkedIn