For SMF 1,
If the last poster ID of this topic is equal to the ID of the logged in member
Echo'';
This is going somewhere in display.template.php.
Was wondering if SMF keeps information about the poster of the last message added. If possible, could someone write it out for me.
You aren't making much sense :P
The code you asked is perfectly possible to be made in 2.0
But then you mention details about last message added.
Can you rephrase to specify what you need? ;)
If the member that posted last in this topic equals the ID of the member who's logged in.
I'm sorry, it is clear, I misread.
I'm not sure and I'm not on the computer right now, but you can print_r $topic (or is it $context['topic'] ?) and you can see the current information. When I get to the computer I can check it for you ;)
Thanks, looking forward to your response.
ok here you go.. in Display.template.php
Find:
// Show information about the poster of this message.
Replace with:
// Show information about the poster of this message.
$lastid = $message['member']['id'];
next do
Find:
echo '<br />';
Replace with:
echo '<br />';
if ($context['user']['id'] == $lastid)
echo'<p><b>The last poster in this topic is the person who is logged in now!</b></p>';
save, upload and your good to go, before changes make backup of the file.
That's not entirely true... That only works if the last post is on the page currently being viewed.
Looking at it now, there is no such information being extracted by default. You get the ID of the last post but not its author.
If you need to do that, an extra query is required ;)
And you couldn't add, say, t.ID_MEMBER_UPDATED to the query early in Display.php where it already fetches t.id_MEMBER_STARTED and then check $topicinfo['ID_MEMBER_UPDATED']
We need an innocent-whistle smiley.
Thanks fellas, I think I'll try what Arantor suggested.