I've been working on a small little project - and was wondering if someone could help me with the last part.
I only want my code snippet to show if :
1) it's the first post in a thread
2) User id = 6 (me)
SMF 1.1.14 (2.0 example would be great as well)
Thank you.
if ($message['id'] == $context['first_message'] && $context['user']['id'] === 6)
That was fast.
Thanks :)
Not a problem, good luck with your project :) Thanks for marking the topic resolved, by the way
The code bit only shows if I'm logged in (won't display code to guests or other users).
How would I fix this?
If you want it so everyone can see it and its the first message, then use this if statement,
if ($message['id'] == $context['first_message'])
Quote from: Mayhem30 on July 26, 2011, 02:04:03 AM
The code bit only shows if I'm logged in (won't display code to guests or other users).
How would I fix this?
In your first post you wanted the code to show only to your user id and it's the first post in a thread. And that is exactly what the code posted above by Labradoodle-360 does.
Now you are asking something different. It would help if you were more precise in what you wanted :)
Sorry, I didn't explain myself clearly in my first post.
What I want to do is add some custom links (and other stuff) under my avatar - but I only want the stuff to show if it's the first post in a thread - and only on my profile (but I would like it to be visible to everyone).
So ... is this not possible?
This is definitely possible, right now, I am on a trip, and when I get back, I'll post the code for you.
Try this
if ($message['id'] == $context['first_message'] && $message['member']['id'] == 1)