The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

avatar in a table under the header

View previous topic View next topic Go down

Solved avatar in a table under the header

Post by _Aceee on September 21st 2015, 9:11 pm

Good evening Smile

I hope, this is the right place for my question. First of all I want to apologize for my English and my grammar. My native language is German and I do not know if I am using the correct expressions for some things. I hope you will understand me anyway. Smile

I want to display the avatar of a user in a table under the header just like you did it here. I asked the german Support of forumotion. They said that this could be possible with javascript, but they had no code for it.
When you follow the link below you can imagine that I want to insert the avatar of a user in the table under the point 'mirror on the wall'. I inserted the code of the table into the templates.

The link to my homepage: http://fairytail-newdivide.forumfrei.com/




Last edited by _Aceee on September 21st 2015, 9:30 pm; edited 1 time in total

_Aceee
New Member

Posts : 2
Reputation : 1
Language : English, German

http://fairytail-newdivide.forumfrei.com/

Back to top Go down

Solved Re: avatar in a table under the header

Post by darki on September 21st 2015, 9:22 pm

One minute ago I read your topic in german forum. Very Happy

In past I had used this:
Code:
$(function() {
  var avatars = $(_userdata.avatar).attr('src');
  document.getElementById('user_avatar').src = avatars;
});

Code:
<img src="" id="user_avatar" />

It works fine with phpbb3. Maybe it needs a rework for phpbb2, you have to try. Smile

Edit: Trust Ange, he knows what's the best. Wink


Last edited by darki on September 21st 2015, 9:24 pm; edited 2 times in total

darki
Forumember

Posts : 254
Reputation : 10
Language : German, english

http://schiggysboard.com

Back to top Go down

Solved Re: avatar in a table under the header

Post by Ange Tuteur on September 21st 2015, 9:22 pm

Hi @_Aceee,

You want to display the user avatar in that area correct ? If so, you can use a bit of JavaScript to write it into the document.

If you want to add the avatar for all ( including guests ) use this code :
Code:
<script>document.write(_userdata.avatar);</script>

If you want to add the avatar for only users logged in, use this code instead :
Code:
<script>if (_userdata.session_logged_in) document.write(_userdata.avatar);</script>


If you have any questions let me know. Smile

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: avatar in a table under the header

Post by _Aceee on September 21st 2015, 9:29 pm

You are awesome! Very Happy It worked! Smile

Thank you! Smile

_Aceee
New Member

Posts : 2
Reputation : 1
Language : English, German

http://fairytail-newdivide.forumfrei.com/

Back to top Go down

Solved Re: avatar in a table under the header

Post by SLGray on September 21st 2015, 9:31 pm

Topic solved and archived


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36691
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum