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

Recent

Welcome to TinyPortal. Please login or sign up.

April 17, 2024, 09:28:23 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 76
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 65
  • Total: 66
  • illori

[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.

gbingo

Hi, very new here, thought I'd take a stab at a new block. I'd like to create a "newest member" block which shows the newest member to the forum, their avatar, and links to their profile. I'm going to attempt to start building this block by borrowing the newest member code from the bottom of the stock SMF template. Wish me luck :)

RoarinRow


SMF 2.0 RC3
TP 1.0 beta 5-1
Wordpress 3.0

Jpg

Good luck. I hope you are done soon so I can put it on my site. :)

gbingo

Well getting the newest member was easy:
echo $context['common_stats']['latest_member']['link'];

Now to retrieve their avatar

Jpg

You can take it off the roster page. I know you can use the code for the avatar.

gbingo


alan s

What file are you pulling the code from?? oh and the ssi feed for the member would be

<?php ssi_latestMember(); ?>

gbingo


gbingo

#8
All done! Here's my code: If someone can make it more efficient or flexible I'd appreciate it, but this works fine on my site:

global $db_prefix;
$query = "SELECT avatar FROM {$db_prefix}members WHERE ID_MEMBER = ".$context['common_stats']['latest_member']['id'];
$exec = db_query($query);
$row = mysql_fetch_assoc($exec);
echo "<div align='center'><img src='/avatars/".$row['avatar']."' alt='".$context['common_stats']['latest_member']['name']."'><BR>".$context['common_stats']['latest_member']['link']."</div>";
mysql_free_result($exec);


Jpg

Let me test it out!
Hopefully it works!
:)

Edit: Hmmm...the avatar isn't showing.