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: 341
  • Total: 341

help with avatar code for comments

Started by koolaid, March 04, 2008, 01:39:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

koolaid

Hi,

       I've been playing around with the code to put avatars in the comments section of an article. This is how far i got: http://img209.imageshack.us/img209/2875/ohyeahex2.jpg

by replacing this code in tportal.template:


<span class="smalltext"> '.$txt['tp-by'].' <a href="'.$scripturl.'?action=profile;u='.$comment['posterID'].'">'.$comment['poster'].'</a>
'.$txt[30].' '.$comment['date'].'</span>


with...

<div class="windowbg5">'.$context['user']['avatar']['image'].'<span class="avatartext"> <a href="'.$scripturl.'?action=profile;u='.$comment['posterID'].'">'.$comment['poster'].'</a></span> 
                                                         '.$txt[30].' '.$comment['date'].'</div>


The problem though with this code is that $context['user']['avatar']['image'] only displays the avatar of the person who is logged in and not of each individual. So right now if i have two users making a comment, they will have the same avatar according to whoever is logged in.

I've been looking at various block snippets that grabs a users avatar but due to my limited knowledge in php, i can't figure out how to fit it in with tportal.template and make it work.

Any help would be appreciated



This website is proudly hosted on Crocweb Cloud Website Hosting.