Support Forum

Modify Last Post Section in Group View

MO Moggle
Moggle
Member

First of all, thank you for the wonderful plugin.  It is exactly what I am looking for.

Using the latest version.

Currently working on the theme and modifying the template files.

Just a couple of things:

  1. If there are no posts/topics, I would like a message to display in the Group View, i.e. “No topics/posts” in the last poster section.  Currently, it is just a blank box which doesn’t look right.
  2. How do I move the topic/post title to be above the username?  So instead of: by user, post title, date/time, I would like post title, by user, date/time.  At the moment, the template in GroupView has “sp_ForumIndexLastPost” and the parameters, however there isn’t a way to change how it is displayed.  Will I need to use different tags?

If you need any more information, then feel free to as.

21 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

At the moment you can not actually influence either of those through the templates which is a bit remiss of us. They are both valid requests and I will open a ticket on these to get them done.

MO Moggle
Moggle
Member

Thank you for replying and thank you again for this wonderful plugin.

MO Moggle
Moggle
Member

Rather than creating another post for the last poster column, is there a way to display the last poster’s avatar?  I’ve used the useravatar tag, but it doesn’t display the correct avatar.  Instead it was showing the guest avatar on the sections which had no posts and no avatar is displayed where there is last poster info.

MO Moggle
Moggle
Member

I’ll try to explain it as best as I can:

If I used the following code:

sp_UserAvatar(‘tagClass=spImg spLeft&size=30&context=user’);

I get this:
http://i43.tinypic.com/dd04e8.jpg
which is incorrect as the blank last post section should not display an avatar. The two users should have their own avatars displays.

Even if I change the context to current, it will display the same avatar instead of guest avatar.
Basically I would like something similar to how the recentposts widget displays the avatar.

I know some people do not want to display the avatar in groupview or forum view, so an option to turn it on or off will be great.

MP Mr Papa
Mr Papa
Member

if you set context=user, you have to pass a second argument telling us what user… ie

sp_UserAvatar('tagClass=spImg spLeft&size=30&context=user', $userid);

current would not be right as thats the current user viewing the page…  so

$spThisTopic->first_user_id

or

$spThisTopic->last_user_id

in place of the $userid in my code above…

MO Moggle
Moggle
Member

The code above works fantastic in Forum View, however does not seem to work with Group View. I’m sure i’m missing something to allow it to work in Group View.

YS Yellow Swordfish
Yellow Swordfish
Member

It’s quite a bit more complicated in spGroupView as it depends on whether you are showing the last post from the main forum or if it can include the last post from a subforum.

if the main forum you would use $spThisForum->user_id

if from a sub forum you would use $spThisForum->user_id_sub

The problem is that there is no current way of determining in the template which might be used. That is something we could consider trying to make more exposed I guess.

MO Moggle
Moggle
Member

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.

YS Yellow Swordfish
Yellow Swordfish
Member

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

MO Moggle
Moggle
Member

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.

YS Yellow Swordfish
Yellow Swordfish
Member

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

MO Moggle
Moggle
Member

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.