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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 405
  • Total: 405

Automatic Avatar Script Not Working...

Started by Xarcell, June 30, 2007, 03:46:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Xarcell

I use this script that Ichbin wrote for me to display a noavatar.gif, if a user has not selected an avatar. It works fine everywhere except on the MessageIndex(topic listings).

It shows my avatar as everyone elses. Even if I use the normal show avatar script. Anyone know why, or how I might go about fixing it?

Thanks...


rebelrose

This is the code I use, hope it helps


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="http://yourdomain.com/forum/avatars/yourimage.gif"></img><BR><BR>'.$context['common_stats']['latest_member']['link'].'</div>';



Just replace your domain and image, which I am sure you know already.

This website is proudly hosted on Crocweb Cloud Website Hosting.