1
kymseen
adding user avatars in wordpress
  • 2006/10/4 3:47

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


Hello, I wanted to have the user avatars show up after the poster' name.
I tried to do this with the news module and some people were successful. (I had trouble with the news1.44)
see this post...

but now I am using wordpress0.6 and I wondered if I could do the same...

I found this post where you can put avatars in the user menu module.

it adds a code in the system_block.php then calls out the avatar by,
<img src="<{$block.avatar}>" alt="" width="32" />
in the system_block_user.html

and it works just great.


Can anyone modify this for wordpress?? the wordpress module is a little complicating...
I want avatars to show after the poster's name.

Thank you!!

2
kymseen
Re: adding user avatars in wordpress
  • 2006/10/6 6:33

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


anyone??

3
kymseen
Re: adding user avatars in wordpress
  • 2006/10/30 5:29

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


I found an interesting hack of wordpress which allows you to show user avatar in side posts. Unfortunately, it doesn't work perfectly. The avatars show up in the module page but doesn't show up on the contents block on the top page...

here is the deal...

Inside the file, index-template.php...near row 10to17..

Quote:
<?php
$myrow[username] = $authordata->user_login;
$rawuid = $xoopsDB->fetchArray($xoopsDB->query("SELECT uid,uname,user_avatar FROM ".$xoopsDB->prefix("users")." WHERE uname = '".$myrow[username]."'"));
$avatar = $rawuid['user_avatar'];
if($avatar != "blank.gif"){
echo '<IMG SRC="../../uploads/' . $avatar . '" height="24">';
}
?>


is the hack that will allow the avatar to show up in the module page.
this works just fine.

but, inside content_block-template.php around row 9to16...there is this code,

Quote:
<?php
$myrow[username] = $authordata->user_login;
$rawuid = $xoopsDB->fetchArray($xoopsDB->query("SELECT uid,uname,user_avatar FROM ".$xoopsDB->prefix("users")." WHERE uname = '".$myrow[username]."'"));
$avatar = $rawuid['user_avatar'];
if($avatar != "blank.gif"){
echo '<IMG SRC="./uploads/' . $avatar . '" height="22">';
}
?>


that is I suppose the code to bring up the avatar. When I put in these codes, all i get is a blank white block. When I delete these codes I get a perfect block(without avatars) so I assume there is a problem with these codes.

anyone had the same problem??

Login

Who's Online

95 user(s) are online (62 user(s) are browsing Support Forums)


Members: 0


Guests: 95


more...

Donat-O-Meter

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

Latest GitHub Commits