MyBB Community Forums

Full Version: Variable for thread starter/original poster?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
{$last_poster} is the last poster...

What is the thread starter?
We can't reply to this question because you didn't specify a template or any other place where you want to use it. There is a thread last poster in showthread, forumdisplay, forumbit_depth2_forum and in multiple other places, you know.
Okay. I was under the impression there were universal variables for such things.

It's for ASB asb_latest_threads_thread
As the name says, variable is something that can vary (or be not defined at all), it depends on its scope.

Use {$thread['username']}
Okay. and display avatar thread starter's avatar? Is there a variable for that I can use in this template?

I tried <img src="http://www.mysite.com/{$thread['avatar']}"> But that didn't work out. I guess due to parent folder permissions...
It can also depend on the query that fetches the results. If it doesn't fetch the avatar column, you aren't going to be able to show avatars without altering the query. You should right click and select inspect element to see what it tries to use for the image url.
I think for latest threads Wildcard pretty much lifted the portal query - and by default it doesnt get the avatar. You would have to edit the query.

Plugin support ....
Well we are grabbing the avatar, but of the user that has posted last in that thread, not the OP.

I had thought to add the OP but it just seemed way to cluttered for my taste. Actually on my forum I have simplified the details even further.

/ramble

Anyway, no the OP's avatar hasn't been queried.
(2014-05-26, 01:02 PM)dragonexpert Wrote: [ -> ]It can also depend on the query that fetches the results. If it doesn't fetch the avatar column, you aren't going to be able to show avatars without altering the query. You should right click and select inspect element to see what it tries to use for the image url.

Ahh... Fixed it. I had jus right clicked on the non-showing image and copied image link. It looked correct. So couldn't figure why it wasn't showing. THought it was perhaps somethng to do with permissions...

But realized now...

was missing

/forum

so <img src="http://www.mysite.com/{$thread['avatar']}"> does work

or <img src="http://www.mysite.com/forum/{$thread['avatar']}"> if site is at /forum

@wildcard. I wouldn't be displaying both last poster avatar and OP avatar. This is for my sponsor forum boxes. So showing title and sponsor avatar. Regardless, may not use it at all. Need to play with sizes layout to see if can get it looking proper.

EDIT: Had some good results. But for now will leave it just as text name of OP. The sponsor threads are in the main 'latest threads too' and are a bit over bearing when only their avatars are showing (and not regular users avatars in the other threads). I may take sponsors out of the main latest threads altogether and then use this OP avatar method in the sponsor boxes. Anyways... Nice to have to option. Will consider.