We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How can i add members avatar on console? | Forum

jeo
jeo Feb 5 '12
Can anyone tell me how i can remove the profile icon on the console for members profile and replace it with their avatar like facebook?
Mark
Mark Feb 6 '12
not sure what code u need to add for the avatar but the file that you want to edit is

public_html/ow_system_plugins/base/views/components/console_member.html
jeo
jeo Feb 7 '12
yes i found that file but don't now how to place a avatar instead of icon lol and thanks for your help :)
Michael
Michael Feb 7 '12
The icon is actually set in ow_system_plugins\base\controllers\component_panel.php

Oxwall uses a service to add the header and icon.
Find
        $this->setPageHeadingIconClass('ow_ic_user');

Since it's set up that way it's not an easy change.

The quick way I see, which is a complete hack, is to fake the icon class.
There are two instances - one for your profile and one for someone else's.
I'll do the "someone else's" as an example.

Profile function line 298
Change it to

$avatar = BOL_AvatarService::getInstance()->getAvatarUrl($userDto->id);
$this->setPageHeadingIconClass("\"><img src=\"".$avatar."\" ><\img>");

That's a big avatar though, and I'm not sure about getting the smaller one because I just took a quick look on my lunch break, but (anyway) I wouldn't suggest doing it.

Other options would be to preg_replace the icon path after it is rendered with your avatar path - still not worth the hassle.

I like it the way it is personally. I'm new to Oxwall too, so their may be an easy way to do this that I don't know about.

Mitch


The Forum post is edited by Michael Feb 7 '12
jeo
jeo Feb 7 '12
i give it a go and see what it looks like, thanks very much
jeo
jeo Feb 21 '12
Stil cart do it :( can any one help me
Sprintally®
Sprintally® Jan 14 '15
checkout www.friendsbookz.com  it can be done with $20
Tecca
Tecca Jan 7 '16
It can also be done for free. We really need to get rid of these posts where people offer to do jobs, this isn't the place for it. Use the appropriate channels if you're a developer, and use Upwork: http://www.oxwall.org/market/specialists

Download the attachment in Nickolay's post: http://www.oxwall.org/forum/topic/33216
Anitaku
Anitaku Jan 7 '16
+1 bryan
Niklas E
Niklas E Jan 11 '16

Quote from Bryan It can also be done for free. We really need to get rid of these posts where people offer to do jobs, this isn't the place for it. Use the appropriate channels if you're a developer, and use Upwork: http://www.oxwall.org/market/specialists

Download the attachment in Nickolay's post: http://www.oxwall.org/forum/topic/33216

Nice with a plugin in for it. Didn't know there was one.
TY
TY Feb 25 '16
Hi,


I had to go right to the base:


.../ow_system_plugins/base/components/console_dropdown_hover.php


Replace _construct function with following (changes are in bold):


public function __construct($label, $key = null)    {        parent::__construct($label, $key);
        $template = OW::getPluginManager()->getPlugin('BASE')->getCmpViewDir() . 'console_dropdown_hover.html';        $this->setTemplate($template);
        $this->addClass('ow_console_dropdown_hover');
        $avatarUrl = BOL_AvatarService::getInstance()->getAvatarUrl(OW::getUser()->getId());
        $this->assign("avatarUrl", $avatarUrl);
    }


.../ow_system_plugins/base/views/components/console_dropdown_hover.html


Replace content with following:


<a href="{$url}" class="ow_console_item ow_console_dropdown ow_avatar"><img class="" src="{$avatarUrl}" style="margin-left: -25px"></a>
<span class="ow_console_more"></span>


Note: This is not for production use. When admin - double avatar will be displayed. I am using Simplicity theme - adjust style as required.

Note: I did not check for case when user did not define avatar.


On the side note: I am not associated with PhpStorm, but after long search - I cannot imagine working without it. 70 USD (or about) is totally worth it. Thank you




TY
TY Feb 25 '16
Not good to leave people hang high and dry 8)


Here is updated code for html part:


{if empty($avatarUrl)}<a href="{$url}" class="ow_console_item_link">{$label}</a>{else}<a href="{$url}" class="ow_console_item ow_console_dropdown ow_avatar" style="width: 50px"><img class="" src="{$avatarUrl}" style="margin-left: -14px"></a>{/if}
<span class="ow_console_more"></span>


Thank you.


Kind regards,

TY