AVATAR Coding

I am just looking for the coding to be able to post an avatar image in a block.  If I can it would be nice to post the user name in there as well, but it is not that big of a deal.

I want to remove the Account Control BLOCK from the account page and make my own side.  The Account Control block made by boonex is borderline pointless.

Thanks for everyone's help in advance =)

Ted

What's next to fix D8 issues? D9? (=
Quote · 19 Apr 2012

Like this?

 

            $aMemberInfo     = getProfileInfo( getLoggedId() );
            $sMemberLink    = getProfileLink($aMemberInfo['ID']); 
            $sName             = $aMemberInfo['NickName'];
          
            $sAvatar           = '<a href="' . $sMemberLink . '">';
            $sAvatar           .= '<img src="';
            $sAvatar           .= $aMemberInfo['ID']  ? $GLOBALS['oFunctions']->getMemberAvatar($aMemberInfo['ID'], 'large') : '';
            $sAvatar           .= '"></a>';

 

I modified one of my routines to show you here, it SHOULD work unless I missed something.

http://www.mytikibar.com
Quote · 20 Apr 2012

That might be what I am looking for.  What would be the best way to display that in the site?

Create a PHP Block with that?

What's next to fix D8 issues? D9? (=
Quote · 20 Apr 2012

 Hello

That might be what I am looking for.  What would be the best way to display that in the site?

Create a PHP Block with that?

Yes, if you have a custom module which allows to create blocks and enter PHP code as block's source. If not, you need to modify the page where you want to see the block.

Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV
Quote · 20 Apr 2012

I tried placing that block of code on the Account Page and nothing displays.  Is there something else I have to do then copy and paste this code?  I used Deanos Tools to do it.

Thanks =)

What's next to fix D8 issues? D9? (=
Quote · 20 Apr 2012

All the code does is grab the variables.  You end up with one called $sAvatar which is an image link with their thumbnail, then the variable $sName that contains their name.

 

It's up to you to display it how you want.

 

Typically you encase the $sAvatar and $sName in a <div> so it lays out how you want it.

so in your php block add

echo '<div style="float:left;"><div>$sAvatar<div>$sName</div></div>';

you'll have to play with the layout and divs to make it fit right tho.

http://www.mytikibar.com
Quote · 20 Apr 2012

hey you can try this

$iId = getLoggedId();

$Thumbnail = get_member_thumbnail($iId, 'none');

$sName= getNickName($iId);

echo '<div>".$Thumbnail."</div><br><div>".$sName."</div>';

or for full name

$iId = getLoggedId();

$Thumbnail = get_member_thumbnail($iId, 'none');

$aProfile = getProfileInfo($iId);

$sName =  $aProfile['FirstName']." ".$aProfile['LastName'];

echo '<div>".$Thumbnail."</div><br><div>".$sName."</div>';

you can play with the html code if you want.

Good luck

 

so much to do....
Quote · 20 Apr 2012

Wow thanks so much for the terrific responses.  I am not much one to be good at coding at all.  I have tried adding everyone's example into a PHP and or a HTML block.  I just get code displaying on the site inside the block I placed the code into. =(

I have tried all 3 examples.  I used Deano's Admin tools to add the PHP block on the Accounts page.  Any more help I would much appreciate it. =)

 

THanks

Ted

What's next to fix D8 issues? D9? (=
Quote · 20 Apr 2012

 

Wow thanks so much for the terrific responses.  I am not much one to be good at coding at all.  I have tried adding everyone's example into a PHP and or a HTML block.  I just get code displaying on the site inside the block I placed the code into. =(

I have tried all 3 examples.  I used Deano's Admin tools to add the PHP block on the Accounts page.  Any more help I would much appreciate it. =)

 

THanks

Ted

The code Prashank25 provided above should work in a PHP block. Don't use a HTML block.

Edit the block with my tools and paste the code in. It should work fine.

Try this code as a test.

echo 'This is a test';

If you can't get that test working then your doing something wrong and we will need exact detailed steps on what your doing.

https://www.deanbassett.com
Quote · 20 Apr 2012

I go into Deano's tools and place the following...

 

echo 'This is a test';

 

This code displays correctly inside the block when loading the page.

 

Then...

 

I go to Deano's Tools again and enter...

 

 

 

 $iId = getLoggedId();

 

$Thumbnail = get_member_thumbnail($iId, 'none');

 

$sName= getNickName($iId);

 

echo '<div>".$Thumbnail."</div><br><div>".$sName."</div>';

 

The block ends up displaying like this when loading up the page as an user.

 

 ".$Thumbnail."

 

".$sName."

 

 

 

I am guessing that a TAG or something needs to be closed?

 

Thanks SO MUCH EVERYONE for your assistance!!

 

Ted

What's next to fix D8 issues? D9? (=
Quote · 20 Apr 2012

oh sorry change it to this

 $iId = getLoggedId();

 

$Thumbnail = get_member_thumbnail($iId, 'none');

 

$sName= getNickName($iId);

 

echo "<div>$Thumbnail</div><br><div>$sName</div>";

so much to do....
Quote · 20 Apr 2012

 

oh sorry change it to this

 $iId = getLoggedId();

 $Thumbnail = get_member_thumbnail($iId, 'none');

 $sName= getNickName($iId);

 echo "<div>$Thumbnail</div><br><div>$sName</div>";

 You are awesome.  Thank you so much I am headed in the right direction now.  One last question.  If I wanted to change the size of the thumbnail being displayed... What would I have to do? =)

Thanks

What's next to fix D8 issues? D9? (=
Quote · 20 Apr 2012

by default you have only two sizes of avatar available. a thumbnail and an icon (the smaller one) for which the function is "get_member_icon()". if you want any other size it requires some custom codes.

so much to do....
Quote · 20 Apr 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.