About
This changes thread icons to be the avatar of the thread starter. It applies to thread listings on forumdisplay, search results and subscribed threads in the UserCP.
Installation
Upload the cssrollup_digitalpoint_threadavatars.xml file to includes/xml (this is really only needed if you store CSS as files in the file system)
Install the product-dp_thread_avatars.xml product under AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product
Notes
Icons are cropped (but never stretched) to be square for display.
Threads with no new posts have the avatar slightly greyed out.
Locked threads will have a lock image overlayed.
Soft-deleted threads will have a red X image overlayed.
If the user posted in the thread, they will see a mini version of their avatar overlayed.
If a thread is "hot", the shadow of the icon will change color.
ZERO SQL queries are added.
Overlay images are encoded as CSS data (no extra HTTP requests needed for images or the CSS files themselves).
If your site uses pre-defined avatars, they are not scaled down for use as the icon since vBulletin does not store the dimensions (instead, the upper/left potion is cropped for the icon).
Settings
You can disable the mini-avatars under AdminCP -> Settings -> Options -> Forum Display Options (forumdisplay) -> Highlight Threads in Which User Has Posted
You can disable the hot thread highlight under AdminCP -> Settings -> Options -> Forum Display Options (forumdisplay) -> Hot Threads Enabled
You can change the color of the hot thread shadow under AdminCP -> Styles & Templates -> Style Manager -> StyleVars -> dpta_shadow_hot_color
You can change the size of the avatar under AdminCP -> Styles & Templates -> Style Manager -> StyleVars -> threadbit_iconsize (since they are square, it keys only on width)
If your site uses pre-defined avatars, you should use the AdminCP -> Settings -> Options -> User Picture Options -> Site Uses Pre-Defined Avatars option
Screenshots
Advanced
If you want to add your own mini-icon overlays, you can utilize the $template_hook['thread_avatars'] variable to do so.
If you want to selectively disable thread avatars, you can set the $show['hide_thread_avatars'] to true. This would allow you to create a custom profile field for users and set the $show['hide_thread_avatars'] based on the user's setting. Alternately you could enable the addon for certain usergroups or just for specific styles.
Quite a shame actually. Would be great if it would be on by default, but the user given the ability to disable it.
I had thought about making it a per user setting, but then I decided to go a more flexible route (which I haven't implemented quite yet). I'm going to have the system read a $show variable for it. That way a site owner could make a simple plug-in to hide it based on any logic they want (could be a setting they have via a custom profile field... or maybe by user group, or per style, etc.)
Quote:
Originally Posted by MrEyes
Looks good, one question though:
Does this mod respect the usercp option to disable viewing avatars?
i.e. If the user has chosen to disable avatars for their account, does this mod still display the avatars or something else?
It does because the system does not really consider it an avatar at that point, there would need to be a setting to disable thread icons for something like that to work. But that being said, see response above, because you will be able to disable it based on any logic you see fit (such as the user setting to disable avatars).
Quote:
Originally Posted by alfanexus
I would like to set it to 100% all the time, but I could not find the "opacity:0.6" in the dpta.css template. Has this been changed?
Ick... My apologies, I thought I had moved that to the CSS, but after checking, it's still in the template_compile plug-in. As a quick fix, go into that plug-in, and there are two places that "opacity:0.6" exist... just change them to "opacity:1". Then go to AdminCP -> Maintenance -> Update Counters -> Compile Thread Avatar Templates
I've since moved that styling to the CSS file (for real this time), so it will be there for the next version.
Since I'm sure someone will ask how to make a custom setting that users can use to disable Thread Avatars just for themselves, you can go to AdminCP -> User Profile Fields -> Add New User Profile Field
Choose the "Single Selection Radio Buttons" option. These are the settings I use for digitalpoint.com:
An important thing to note is what the internal field ID is for your new setting. In my case it's 21... so in the plug-in, we are reading field21.
Create a new plug-in like so (do NOT pick the Thread Avatars as the product since it would get overwritten on an update):
You now should have a setting that users can set in their UserCP settings that allows them to toggle Thread Avatars on/off.
You can use a similar plug-in to set the $show['hide_thread_avatars'] variable to "true" for other things if you want (per style, per usergroup, etc.)
An example of the sort of thing you could do with the new hook location...
On digitalpoint.com, premium members can see the "true country" of a poster... I extended it a bit so premium members show the flag of the country the thread starter is in. I made it so the flag only shows when you mouseover the thread (that way it's normally hidden so it's not too obnoxious).