1
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??



2
kymseen
Re:Inbox structure
  • 2006/10/26 20:09

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


I would like to know the answer too!!
HERV??

the titles would change the order but, inside the PM, the order is not changed.

help!



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

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


anyone??



4
kymseen
Re: xoopsmembers : a link to the list of all members ?
  • 2006/10/6 6:28

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


Hello, I got this script to work!

I was wondering if some one could modify this to make it that that, only the user avatars and name show(this must be easy) and have it line up left to right, top to bottom.
like this

+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + +=user avatar

right now the users are aligned by user name in alphabetical order, but can it b modified to be aligned by "last log in date"??

I think this modification would make a good block for the users to see other fellow members of the site!

has anyone done this kind of thing???



5
kymseen
Re: Can i Show a Avatar in user Menu
  • 2006/10/5 23:48

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


I couldn't figure out what was wrong but I found a simislar code and got it!

I put in

Quote:
<{if $block.avatar != ""}>
<img src="<{$block.avatar}>" alt="" width="80" /><br />
<{else}>
<img src="http://rnjp.sakura.ne.jp/xoops/uploads/blank.gif" width="80"/><br/>
<{/if}>


in system_user_block.html

and it showed up fine!



6
kymseen
Re: Can i Show a Avatar in user Menu
  • 2006/10/5 14:19

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


hello, this worked great for me!

Although one problem! default avatar, blank.gif doesn't show up...
does anyone know how to fix this??


In the same system_block.php there is the code for user ranking
Quote:
function b_system_topposters_show($options)
{
$block = array();
$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
$limit = (!empty($options[0])) ? $options[0] : 10;
$size = count($options);
for ( $i = 2; $i < $size; $i++) {
$criteria->add(new Criteria('rank', $options[$i], '<>'));
}
$criteria->setOrder('DESC');

// $criteria->setSort('posts');

$criteria->setLimit($limit);
$member_handler =& xoops_gethandler('member');
$topposters =& $member_handler->getUsers($criteria);
$count = count($topposters);
for ($i = 0; $i < $count; $i++) {
$block['users'][$i]['rank'] = $i+1;
if ( $options[1] == 1 ) {
$block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$topposters[$i]->getVar('user_avatar') : '';
} else {
$block['users'][$i]['avatar'] = '';
}
$block['users'][$i]['id'] = $topposters[$i]->getVar('uid');
$block['users'][$i]['name'] = $topposters[$i]->getVar('uname');
$block['users'][$i]['posts'] = $topposters[$i]->getVar('posts');
}
return $block;
}


and it shows the default avatar blank.gif just fine.

but this code doesn't
Quote:
$block['avatar'] = $xoopsUser->getVar('user_avatar') != 'blank.gif' ? XOOPS_URL.'/uploads/'.$xoopsUser->getVar('user_avatar') : '';


What's wrong???

please help figure this little problem out!



7
kymseen
Re: change img display size in with HTML (wordpress content block)
  • 2006/10/5 13:41

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


I was succcesful by adding codes under wp_contents.html

I added replace:"<img":"<img width='80'
like this

Quote:
<{$content.body|xoops_substr:"0":"480"|replace:"<img":"<img width='80'"}>


hooray!!
thanks



8
kymseen
change img display size in with HTML (wordpress content block)
  • 2006/10/4 21:23

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


Hello, I am using the wordpress0.6 module with the content blocks showing.

I have shortened the content text in the content blocks and I wanted to make the images smaller (thumbnail size) just for the content blocks.
I was successful to change the image size with CSS, but it doesn't seem to reflect on Internet Explorer...
I was wondering if I could change the image size via HTML??

has anyone done this? I don't know which file to edit...

in wp_contents.html, this is where i modified to shorten the content text with xoops_substr. would this be where I would make changes??


Quote:
<div class="post">
<{if $content.date != ""}>
<h2><{$content.date}></h2>
<{/if}>
<h3 class="storytitle" id="post-<{$content.date}>"><a href="<{$content.permlink}>" rel="bookmark" title="Permanent Link: <{$content.title}>"><{$content.title}></a></h3>

<div class="meta">
Filed under: <{$content.category}> - <{$content.author}> @ <{$content.time}>
</div>
<div class="storycontent">
<p><{$content.body|xoops_substr:"0":"480"}></p>

<br clear=left>
</div>
<div class="feedback">
<{$content.linkpage}> <{$content.comments}>
</div>



please give me some guidance.

Thank You!!



9
kymseen
Re: usermenu modify (show w/avatar and banners)
  • 2006/10/4 20:45

  • kymseen

  • Just popping in

  • Posts: 23

  • Since: 2006/9/11


I got what I needed!
instead of showing it in a custom block, I had it show up on the user menu block. ha!

this threadhelped me out.

however, as I posted in the thread, user avatars show up in the user menu block only if users have uploaded their own image. Meaning the blank.gif (default avatar) does not respond or show up!!

anyone know how to fix this?

please see this thread

Thanks!!



10
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!!




TopTop
(1) 2 3 »



Login

Who's Online

130 user(s) are online (86 user(s) are browsing Support Forums)


Members: 0


Guests: 130


more...

Donat-O-Meter

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

Latest GitHub Commits