Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Show avatar in the topics list
Avatar
WE WE Shoot SL
Member
Free Members
sp_UserOfflineSmall Offline
Apr 5, 2012 - 11:30 am

Hi there, first of all, sorry for the broken english. I´m gonna try explain my problem properly.

What I want it´s to show user avatar in the rows of the Topics list "spForumView.php", where the user name is shown for the first and last topic.

I tried this, but every time it´s showing me the same avatar. Thanks!!

 

# Column 5 of the forum row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spColumnSection spRight&width=16%&height=50px');
sp_TopicIndexLastPost('iconClass=spIcon spRight&nicedate=1&date=0&time=0&stackdate=0', __sp('Last Post'));
sp_UserAvatar('tagClass=spPostUserAvatar spCenter&context=user');
sp_ColumnEnd();

# Column 4 of the forum row sp_UserAvatar('tagClass=spPostUserAvatar spCenter&context=user', $spThisPostUser);
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spColumnSection spRight&width=16%&height=50px');
sp_TopicIndexFirstPost('iconClass=spIcon spRight&nicedate=1&date=0&time=0&stackdate=0', __sp('First Post'));
sp_UserAvatar('tagClass=spPostUserAvatar spCenter&context=user');
sp_ColumnEnd();

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 5, 2012 - 1:53 pm

You need to pass some user data as a second parameter. In these cases the user _ID will suffice.

These need to be $spThisTopic->first_user_id and $spThisTopic->last_user_id respectively.

andy-signature.png
YELLOW
SWORDFISH
Avatar
WE WE Shoot SL
Member
Free Members
sp_UserOfflineSmall Offline
Apr 5, 2012 - 6:42 pm

Worked!! thanks so much!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 5, 2012 - 6:57 pm

np. glad we could help.

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 616
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10118
Posts: 79603