Hi, I am looking for a way to check if a post is the topic (not its replies). I have no clue where or how to write up such boolean condition. I need to use it in Display.template.php for SMF 2.0.7. Thanks in advance.
Like this:
while ($message = $context['get_message']())
{
if ($message['id'] == $context['topic_first_message'])
echo 'YAY, TOPIC FIRST MESSAGE!!!';
Example result attached ;)
I'd sort of wonder what the use here is for this because that test may not be enough...
Lainaus käyttäjältä: Arantor - toukokuu 26, 2014, 11:09:13 AP
I'd sort of wonder what the use here is for this because that test may not be enough...
No, it is good enough. I have modified a mod that you can like or unlike a post to allow hate or unhate a post. I just need to let users to like or hate only the topic post, not just all posts including the replies. It was just what I needed. Thanks!
Aside from the fact it doesn't actually enforce it and would be quite possible to hate any post...