Author Topic: User avatar on index page  (Read 4751 times)

Offline Kraha

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: User avatar on index page
« Reply #10 on: Nov 01, 2010, 04:57:10 »
So what I must to edit in index.template.php to have the avatar od index?

Offline Kraha

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: User avatar on index page
« Reply #11 on: Nov 02, 2010, 03:39:52 »
bump

Offline Chair

  • Hero Member
  • *****
  • Posts: 861
  • I'm a Yes-Man.
    • Brosquad
    • Email
Re: User avatar on index page
« Reply #12 on: Nov 02, 2010, 05:08:06 »
Hello Kraha,

The changes you need to make are the following:

In index.template.php

Find:
Code: [Select]
   <div id="userinfo">';
Replace with:
Code: [Select]
   <div id="userinfo">';
if(!empty($context['user']['avatar']))
echo '
<div class="ds-avatar"><a href="', $scripturl, '?action=profile">'.$context['user']['avatar']['image'].'</a></div>';

Now, in index.css

Find:
Code: [Select]
#userinfo {
font-size: 1.0em;
color: #fff;
font-family: tahoma, sans-serif;
float: right;
padding: 25px 20px;
text-align: right;
}

Replace with:
Code: [Select]
.ds-avatar {
float: right;
margin-left: 15px;
}

.ds-avatar img {
width: 65px;
height: 65px;
}

#userinfo {
font-size: 1.0em;
color: #fff;
font-family: tahoma, sans-serif;
float: right;
padding: 25px 20px;
text-align: right;
width: 250px;
}


That should sort you out.  :thumbup:


Some people deserve a high five once in a while....in the face... with an ARG
(see what I did there?)

Offline Kraha

  • Jr. Member
  • **
  • Posts: 19
    • Email
Re: User avatar on index page
« Reply #13 on: Nov 03, 2010, 04:10:02 »
Thanks for help, but I do it myself :P

Offline iainsherriff

  • Newbie
  • *
  • Posts: 7
    • Email
Re: User avatar on index page
« Reply #14 on: Apr 10, 2012, 07:30:10 »
 :welcome:

Hello. Long time since I have posted. I know this is an old topic but it covers my problem, so................

I have the Avatar as described above along with my forum header. The text looks messy and I cant work out how to move it. It would look better if the text was aligned below the Avatar, unless anyone has a better idea  ;)

How can I do this please ? See link...............

http://uklows.com/forum/


....... a day later realised of course you cant see it as your not registered !

string of night shifts in the way now  ???
« Last Edit: Apr 11, 2012, 12:22:16 by iainsherriff »