Hello There, Guest! › Register

MySubscriptions 2.2 released.
Looking for a custom plugin for your site? Ask here for a quote.

Adding user avatar in Who's Online list
#11

I'm going to use this.. thank you Pirata! Big Grin anyway one question possible to decrease avatar size right? thanks again.. Smile
Andrew - NewPoints Plugin Developer


[Image: dragonanimated_446370.gif]
#12

Sure. If you would like the username under the avatar, utilizing the code mentioned above in Nervo's post, then please do the following:

After placing the above mentioned code into your index.php,
FIND THIS:
Code:
$user['profilelink'] = "<a href=\"member.php?action=profile&amp;uid={$user['uid']}\"><img src=\"".htmlspecialchars_uni($user['avatar'])."\" width=\"50\" height=\"50\" title=\"{$user['username']}\" ></a>";
                    else $user['profilelink'] = "<a href=\"member.php?action=profile&amp;uid={$user['uid']}\"><img src=\"images/avatar.png\" width=\"50\" height=\"50\" title=\"{$user['username']}\" ></a>";

REPLACE WITH:
Code:
$user['profilelink'] = "
                        <div style=\"padding:4px;text-align:center;float:left;\" >
                           <a href=\"member.php?action=profile&amp;uid={$user['uid']}\" title=\"{$user['username']}\">
                              <img src=\"".htmlspecialchars_uni($user['avatar'])."\" width=\"50\" height=\"50\" alt=\"{$user['username']}\" />
                              <br />{$user['username']}
                           </a>
                        </div>";
                    else
                    $user['profilelink'] = "
                    <div style=\"padding:4px;text-align:center;float:left;\" >
                       <a href=\"member.php?action=profile&amp;uid={$user['uid']}\" title=\"{$user['username']}\">
                          <img src=\"images/midnight/default.png\" width=\"50\" height=\"50\" alt=\"{$user['username']}\" />
                          <br />{$user['username']}
                       </a>
                    </div>";

I have changed the structure of the code to make it easier to see each element and added some outer divs and css styling to center and separate each user from one another, along with the code to display the username underneath the avatar.

You can change the avatar size by replacing the "50" in the width and height of both conditional branches with your own dimensions.

BTW: What happened to the site Nervo? I came to check in on the boards and there was a mysql issue. If you ever need any help, please let me know. I a veteran programmer and i know my way around SQL like the back of my hand. You have my email.

BTW2: Why Nervo!? Do not place the attribute "title" in an "img" tag... that is not allowed there. You must use the "alt" tag. I find it easy to remember if I tell myself this:

ok, what if the image is not there, or i mis-typed the url?
The browser will fill in the "alt" or alternate.

Links have titles, images do not. shame on you Pirata! lol
[Image: eternalwolfsig.php]
#13

thanks eternalwolf.. much appreciated.. now we can see who's really online via their avatar..not just by their username Smile
Andrew - NewPoints Plugin Developer


[Image: dragonanimated_446370.gif]
#14

This is what happened:
http://forums.consoleworld.net/thread-20...tpost.html

I don't have any problems with MySQL, I know MySQL and I have some experience with databases Tongue
Thanks anyway.

title is for when you place the mouse over the img, it shows something.
alt is for when the image is not available
Smile
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#15

But in XHTML 1.0 transitional, the title attribute is not allowed in img tags. I just re-verified my XHTML for mybb and my main site and i had to fix your code and a few other urls.

The "Alt" attribute actually does the same as the "title" attribute in all browsers, when used with an "img" tag, in accordance with XHTML standards.
[Image: eternalwolfsig.php]
#16

Oh thanks Smile
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#17

How about adding username appearence to the online thingy? (The username under avatars?)
[Center][Image: eiw9hy.png]
[Image: 15re2q8.png]
!Liverpool 4 Life![/Center]
Pirata Nervo Wrote:IE6 is weird and sucks
#18

I will add but not now lol
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
#19

Okey, that's cool. Wink
[Center][Image: eiw9hy.png]
[Image: 15re2q8.png]
!Liverpool 4 Life![/Center]
Pirata Nervo Wrote:IE6 is weird and sucks
#20

@Co_ol, that's a good idea too.. whos online will going to look colorful Big Grin
Andrew - NewPoints Plugin Developer


[Image: dragonanimated_446370.gif]




Users browsing this thread: 1 Guest(s)