Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Modify Last Post Section in Group View
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Feb 23, 2012 - 10:03 am

That's fantastic, the first code worked as I don't have any sub forums at the moment. I may do in the future.

Thank you so much. The support here has been fantastic!!!!

edit: just need to work out how to get rid of the guest icons where there are no topics/posts in the forum.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 23, 2012 - 10:09 am

Well in that case the user ID would be set to zero.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Feb 23, 2012 - 10:19 am

This is going to sound dumb but where do i set the user ID to zero? Also I cannot seem to find this parameter, assuming it is a parameter within sp_UserAvatar.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 23, 2012 - 10:22 am

Sorry - I simply meant that for  a guest then $spThisForum->user_id will equal zero.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Feb 23, 2012 - 10:33 am

Ok, i'm probably missing something here.

I have the following code:

sp_UserAvatar('tagClass=spAvatarGroup spLeft&size=30&link=none&context=user', $spThisForum->user_id);

which displays the avatars of the last poster but with the guest icon:
http://i40.tinypic.com/2d6vbc4.jpg

If I add the =0 after user_id, it changes all the avatars to the guest icon.

If a forum has no topics/posts, then technically it shouldn't display anything at all.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 23, 2012 - 3:25 pm

Well you needs to test it. If the $user_id == 0 then don't display anything

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Feb 27, 2012 - 2:43 am

I've managed to get this working so thought I would post the code so other people can use it:

This is what I used:

if ($spThisForum->user_id == 0):
echo '';
else:
sp_UserAvatar('tagClass=spAvatarGroup spLeft&size=30&link=none&context=user', $spThisForum->user_id);
endif;

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 27, 2012 - 4:19 am

That's great. You could simplify this even further and remove the empty echo statement by using a not equals instead of an equals:

if ($spThisForum->user_id != 0) sp_UserAvatar('tagClass=spAvatarGroup spLeft&size=30&link=none&context=user', $spThisForum->user_id);

which will do the same thing.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Moggle
Member
Free Members
sp_UserOfflineSmall Offline
Feb 27, 2012 - 4:27 am

Oooh, thank you so much for your help laugh

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 27, 2012 - 4:48 am

You're welcome.

andy-signature.png
YELLOW
SWORDFISH
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: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626