TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 330
  • Total: 330

[Block] Newest member block with Avatar image which links to their profile

Started by gbingo, August 23, 2006, 06:04:29 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jdvarner

i guess the original post in the thread from page one. do you mind sharing yours with me?

rebelrose

#101
Quote from: jdvarner on April 17, 2007, 01:11:17 AM
i guess the original post in the thread from page one. do you mind sharing yours with me?

If your talking to me I will be happy to share, I will go get it for you.

Here is one version,


global $memberContext;
$user_id = $context['common_stats']['latest_member']['id'];
loadMemberData(array($context['common_stats']['latest_member']['id']));
loadMemberContext($user_id);
if (!empty($memberContext[$user_id]['avatar']['image']))
echo '<div align="center">'.$memberContext[$user_id]['avatar']['image'].'<BR>'.$context['common_stats']['latest_member']['link'].'</div>';
else
echo '<div align="center">( No Avatar Yet )<BR><BR>'.$context['common_stats']['latest_member']['link'].'</div>';


The one I have calls for a image that I created if they do not choose one. I can post that as well if you like.

rebelrose

This code will put an image of your choice in the block when the newest member does not select an avatar:


global $memberContext;
$user_id = $context['common_stats']['latest_member']['id'];
loadMemberData(array($context['common_stats']['latest_member']['id']));
loadMemberContext($user_id);
if (!empty($memberContext[$user_id]['avatar']['image']))
echo '<div align="center">'.$memberContext[$user_id]['avatar']['image'].'<BR>'.$context['common_stats']['latest_member']['link'].'</div>';
else
echo '<div align="center"><img src="path to your image"></img><BR><BR>'.$context['common_stats']['latest_member']['link'].'</div>';


Make sure to replace <img src="path to your image"> with the path to your image you are going to use.

jdvarner

ha ha. figured since the thread was dead, it was obvious i was replying back to you. :)

thank you very much. that worked very good. appreciate it.

jd

rebelrose

Quote from: jdvarner on April 17, 2007, 01:28:03 AM
ha ha. figured since the thread was dead, it was obvious i was replying back to you. :)

thank you very much. that worked very good. appreciate it.

jd

Well you never know sometimes on forum, but I am glad you got what you want.

Your Welcome, we are here to help.  :)

Mannie

Works good for me.
However what i was thinking would be nice if the no avatar image could be clickable wich when clicked take the user to the profile screen to change his avatar

rebelrose


Mannie

I know that, but i was just wondering if it could be done so the image is a link to

rebelrose

Quote from: Mannie on May 12, 2007, 03:18:18 PM
I know that, but i was just wondering if it could be done so the image is a link to

I think it could, just a matter of getting the code right, I am no coder, but I can try to give it a go later and see what happens, Unless one of the coders come along first and give you the answer.

Mannie

Thanks, i am no coder either, that is why i asked here ;). In return i will create a pack of avatars soon ;)

This website is proudly hosted on Crocweb Cloud Website Hosting.