MyBB Community Forums

Full Version: separate, multiple thread icons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am converting my heavily customized SMF 2 theme to a MyBB 1.6 theme, but I am running into small issues here and there.

I want to remove the default thread icons that are displayed next to each thread on the thread index (no problem there). But, then I want to add individual icons next to each thread to indicate whether it is a poll, locked and/or sticky. So a thread can have up to three separate images displayed next to its title.

Live examples of the SMF version can be seen here.

Can this be done for MyBB as well? I am not sure how I can specify an image based on the thread status (i.e. how do you know when a thread is locked?)...
The variable {$folder} in the forumdisplay_thread is used to display the images (inside of an img tag such as <img src="blah/{$folder}.ext">). There are a few options;

1 - Replace all of the other images with 1x1 transparent image, then use full images for the ones you want to display,
2 - Use CSS with that variable, and assign it to a span or similar, so the class might look like "status_{$folder}" then use the appropriate css;
.status_closed {
  width: 16px;
  height: 16px;
  display: block;
  float: left;
}
For this application though, it's not really suitable.
3 - Use this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=260
and set up 3 conditionals, compared to {$folder}
4 - Write a custom plugin

I personally would recommend either 3 or 4.
Thanks, option 3 seems like a good solution. However, using conditionals, if you compare to {$folder}, wouldn't you be able to find out if a thread is 'locked' only? As far as I can tell, 'sticky' or important threads don't have a folder icon, and neither do polls. I think for polls I can use the {$prefix} variable, so that leaves sticky threads... I noticed in forumdisplay_thread there is a {$thread_type_class} variable, which can be 'regular' or 'sticky'. Looks like I could use that.
Oh right, forgot that those aren't a part of that variable. But yes, you can use the prefix to do that, won't make a difference.