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.
Also are you planning to integrate the exact functionality for the "Forumhome" page listing? (see attachment)
Hmmm.. and for a more advanced developments, I was thinking you could use this same feature for the "Quote" functionality, so basically when I quoted you.. you'd see a little avatar of me at the top bottom right of your avatar.. it's pretty sweet knowing who you're/they're directly communicating to
Nhat
No, there are no plans to do something similar to the forumhome page or add avatars to quotes.
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.)
While I really appreciate you adding the code, would have been great if you copy/paste the code so I can be sure I'm doing it right rather than typing it all over. So far, I've done this:
Code:
if ($vbulletin->userinfo['field28'] == 'yes') $show['hide_thread_avatars'] = true;
However, this doesn't seem to work. I've set it to NO in the options menu (on my profile) and yet it still shows up. And yes, I've updated the product. And yes, the field is also correct. Also, I selected the cache_templates. I've done everything and copied everything from your images above, still doesn't work.
THat *should* be it assuming field28 is being set to 'Yes' for your account.
You can double check by going into phpmyadmin (if you have it installed), going into the userfield table, and checking the record for your userid. Make sure there are no leading/trailing spaces in there.
The opacity will work in the latest version of IE, but for old versions, if you want it to work, you can go into your dpta.css template and change this:
I stopped writing code for old versions of IE. If the user doesn't want to (or can't upgrade to IE), and they also don't want to use a browser that works properly with CSS standards, then ultimately it's their choice.
That being said, if you (personally) want to support old versions of IE, that code will do it.
Maybe a Idee for Future updates.
If the Icon Legend under the Threadlist would be updatet with Threadavatars it shows Great
Maybe as Example with the no Avatar icon
As far as IE goes, anything older than IE9 is what I consider "old". Not necessarily because of it's age, but because it's a terrible browser. The way I figure it is this... if I code something and it works perfect in Firefox, Chrome, Safari and Opera, but not perfectly in IE, then the issue is most likely a problem with IE (in this case old versions of IE not supporting standard CSS), not my code. That being said... IE9 is a pretty good browser. My logic is this... If a user makes the choice to use a browser that sucks, it's ultimately up to them. I'm not going to force a good browsing experience upon them when they consciously choose to not have one. At least that's my logic for digitalpoint.com. But since other people may not share my logic, I rolled the extra CSS into 1.0.4 for you.
As far as search results go, it looks like you may have hit this issue (also fixed in 1.0.4 already in the source)... When a thread was created by a user that no longer exists in the user table (the fix is here).
Updated the download to 1.0.4... the only changes are the CSS for old versions of Internet Explorer, and the issue when search returns a thread created by a non-existant user.