1
waleedpak
How to show User's Avatar on User Menu?
  • 2008/9/6 5:44

  • waleedpak

  • Just popping in

  • Posts: 45

  • Since: 2007/11/25


Is there any way i can show the user's avatar on XOOPS User Menu,
for the user who is logged in....

Plese help.. I am sure there is a way 4 that...

2
ghia
Re: How to show User's Avatar on User Menu?
  • 2008/9/6 7:31

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Look in the code and template for the block 'New members' or 'Top posters' and adapt the users menu block.

3
waleedpak
Re: How to show User's Avatar on User Menu?
  • 2008/9/14 5:41

  • waleedpak

  • Just popping in

  • Posts: 45

  • Since: 2007/11/25


can anyone help me to look at the codes...
i;m not dat expert

4
waleedpak
Re: How to show User's Avatar on User Menu?
  • 2008/10/10 14:13

  • waleedpak

  • Just popping in

  • Posts: 45

  • Since: 2007/11/25


i found the trick..
1st open modules/system/blocks/system_blocks.php

insert this code just before the ?> sign..
GLOBAL $xoopsUser;
if (
is_object($xoopsUser)) {
$uavatar $xoopsUser->getVar('user_avatar');
if (
file_exists(XOOPS_ROOT_PATH.'/uploads/'.$uavatar)) {
$GLOBALS['xoopsTpl']->assign('uavatar'XOOPS_URL.'/uploads/'.$uavatar);
}else{
$GLOBALS['xoopsTpl']->assign('uavatar''');
}
}


then after that edit the User Block template from the block administrations menu..

add the following code at the place you want the avatar to be displayed.
<{if $uavatar != ""}>
      <
img src="<{$uavatar}>" alt="" width="100" /><br />
      <{/if}>

you can change the width if you want...
besides you can also display the user's username by using the code
<{$xoops_uname}>


that's all
tanx

5
waleedpak
Re: How to show User's Avatar on User Menu?
  • 2008/10/16 13:49

  • waleedpak

  • Just popping in

  • Posts: 45

  • Since: 2007/11/25


i will post this codes as a custom block code module pretty soon

Login

Who's Online

227 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 227


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits