avatar custom size with username , radius or border and users online details
Announcement
Collapse
No announcement yet.
Visitors in the Last X Hours Module
Collapse
This is a sticky topic.
X
X
-
Avatar Size, Border-Radius, Border & Username
By default, the avatars in this module have the same size, border-radius and border as the avatars on other parts of the site (except for the size on topic pages and the main profile picture on Profile page). So if you've made custom CSS to change the style of those avatars, it will also be applied to the same in this module. But if you want to make the avatar style different in this module, you can add these custom CSS in css_additional template:
Change 100px to your desired size and border-radius and border to desired value.Code:.vbmodsthatrocks-last-visitors-widget .b-avatar { width: 100px; height: 100px; } .vbmodsthatrocks-last-visitors-widget .b-avatar img { width: 100px; height: 100px; max-width: none !important; max-height: none !important; border-radius: 100%; border: 1px solid #ccc; }
For displaying username, add this CSS:
User Online DetailsCode:.vbmodsthatrocks-last-visitors-widget li { margin-bottom: 15px; } .vbmodsthatrocks-last-visitors-widget .b-avatar:after { content: attr(title); display: block; text-align: center; }
Did you mean this Profile Preview Tooltip which is similar to the new Name Card tooltip?
Note: I made those CSS code on the fly. So it's not fully tested. Let me know if it's not working.

My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
Comment
-
Note that username has no fixed length, some are long, some are short. So you may see overlapping usernames. You can add ellipsis (...) to prevent username to go beyond its container by adding these CSS properties inside the .vbmodsthatrocks-last-visitors-widget .b-avatar:after CSS rule block.
Code:overflow: hidden; text-overflow: ellipsis;

My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
Comment
-
Please see updated code below and disregard the original code.Originally posted by glennrocksvb View PostAvatar Size, Border-Radius, Border & Username
By default, the avatars in this module have the same size, border-radius and border as the avatars on other parts of the site (except for the size on topic pages and the main profile picture on Profile page). So if you've made custom CSS to change the style of those avatars, it will also be applied to the same in this module. But if you want to make the avatar style different in this module, you can add these custom CSS in css_additional template:
Change 100px to your desired size and border-radius and border to desired value.Code:.vbmodsthatrocks-last-visitors-widget .b-avatar { width: 100px; height: 100px; } .vbmodsthatrocks-last-visitors-widget .b-avatar img { width: 100px; height: 100px; max-width: none !important; max-height: none !important; border-radius: 100%; border: 1px solid #ccc; }
For displaying username, add this CSS:
User Online DetailsCode:.vbmodsthatrocks-last-visitors-widget li { margin-bottom: 15px; } .vbmodsthatrocks-last-visitors-widget .b-avatar:after { content: attr(title); display: block; text-align: center; }
Did you mean this Profile Preview Tooltip which is similar to the new Name Card tooltip?
Note: I made those CSS code on the fly. So it's not fully tested. Let me know if it's not working.
Adjust the values according to your preferences. I added comments enclosed within /* */ in the CSS code to describe the CSS variables I introduced that you can edit.Code:/* Last Visitors Module Avatars with Username - START */ .vbmodsthatrocks-last-visitors-widget .display-avatar { --lastVisitorAvatarSize: 100px; /* Avatar width and height on desktop */ --lastVisitorAvatarColumnGapSize: 40px; /* Gaps between Avatar columns on desktop */ --lastVisitorAvatarRowGapSize: 20px; /* Gaps between Avatar rows on desktop */ --lastVisitorAvatarBorderRadius: 100%; /* Avatar border-radius on desktop and mobile */ margin: 0 !important; } .l-small .vbmodsthatrocks-last-visitors-widget .display-avatar { --lastVisitorAvatarSize: 80px; /* Avatar width and height on mobile */ --lastVisitorAvatarColumnGapSize: 20px; /* Gaps between Avatar columns on mobile */ --lastVisitorAvatarRowGapSize: 10px; /* Gaps between Avatar rows on mobile */ } .vbmodsthatrocks-last-visitors-widget .display-avatar .last-visitor-list { display: grid; grid-template-columns: repeat(auto-fill, var(--lastVisitorAvatarSize)); justify-content: center; grid-column-gap: var(--lastVisitorAvatarColumnGapSize); grid-row-gap: var(--lastVisitorAvatarRowGapSize); } .vbmodsthatrocks-last-visitors-widget .display-avatar li { margin: 0; float: none; } .vbmodsthatrocks-last-visitors-widget .display-avatar .b-avatar { width: var(--lastVisitorAvatarSize); height: var(--lastVisitorAvatarSize); border-radius: var(--lastVisitorAvatarBorderRadius); margin: 0 !important; } .vbmodsthatrocks-last-visitors-widget .display-avatar .b-avatar:after { content: attr(title); display: block; text-align: center; word-break: break-word; width: calc(100% + var(--lastVisitorAvatarColumnGapSize)); margin-left: calc(-1 * (var(--lastVisitorAvatarColumnGapSize)/2)); } .vbmodsthatrocks-last-visitors-widget .display-avatar .b-avatar img { width: var(--lastVisitorAvatarSize); height: var(--lastVisitorAvatarSize); max-width: none !important; max-height: none !important; transform: none !important; } /* Last Visitors Module Avatars with Username - END */Last edited by glennrocksvb; 02-04-2022, 11:49 AM.
My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
-
I updated the first post with this code.
- Top
- Translate
- Bottom
-
I also added the same code here. Take a look at this module on homepage.
- Top
- Translate
- Bottom
-
If you are using the Profile Preview Tooltip mod, then you need to add extra CSS code. Please refer to the updated first post.
- Top
- Translate
- Bottom
-
This code is obsolete and is no longer needed as of v1.10.
- Top
- Translate
- Bottom
-
USC, thanks for your purchases and your request. I will consider adding that.
My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
-
Through the power of CSS, I was able to figure out and add the number of visitors. I didn't know that CSS has counters that could count the number of elements, in this case the <li> tags containing the avatars. It just needs more CSS trickery to display the count above the list because the total count can only be displayed after all the elements to be counted. Without this additional trick, the visitor count would have been displayed below the list of avatars.Originally posted by USC View Postno mention of number of visitors ?
"XXX Members have visited the forum"
would be great if you could add that thanks
I have updated the Last Visitors module on homepage here with this code. Check it out!Code:/* Last Visitors Module with Visitor Count - START */ .vbmodsthatrocks-last-visitors-widget { counter-reset: last-visitor-count; } .vbmodsthatrocks-last-visitors-widget .widget-content { display: grid; } .vbmodsthatrocks-last-visitors-widget .last-visitor-list { order: 2; } .vbmodsthatrocks-last-visitors-widget li { counter-increment: last-visitor-count; } .vbmodsthatrocks-last-visitors-widget .widget-content:after { content: counter(last-visitor-count) ' members have visited this forum.'; /* Adjust wording as desired */ order: 1; margin-bottom: 20px; font-weight: bold; } /* Last Visitors Module with Visitor Count - END */
Enjoy!
Last edited by glennrocksvb; 02-05-2022, 09:56 PM.
My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
-
USC, the CSS code here to show the visitor count is no longer needed starting from v1.8 of this mod. I have added it as a module option to show or hide the visitor count.
- Top
- Translate
- Bottom
-
lange I have released v1.8 to add support for PHP 8.0 and 8.1 as well as add module option to show visitor count.Originally posted by lange View PostRight now, my forum is running on 5.6.6 /PHP 8.0.15 with a lot of custom templates, custom hooks, three or four mods. I haven't noticed any problems so far.
I'll wait a bit for this mod then.
Thank you.
My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
Comment
-
This doesn't work on vBCloud because it requires uploading a PHP file to the server. Please disregard it. But I'll take a look why you got an email.Originally posted by Mitch View PostI assume this does not work on cloud? I received an email for the update, but don't believe I ever purchased the original
My Amazon Affiliate Link
Fast vBulletin VPS Host:
This site is hosted by IONOS
- Top
- Translate
- Bottom
- Likes 1
Comment
Latest Posts
Collapse
-
Reply to some ideas for new modsin Chit Chatby desmomax
I finally created a mod that allows you to add an icon to each post with options for sharing on other platforms. I honestly thought it was absurd that...
Today, 03:59 AM -
by flohseHi Glenn, what do you think about adding "Like Counts" similar to "Like Counts on Postbit and Profile" (when this mod is in use) in...Yesterday, 11:28 PM
-
Reply to push notification prompt?by desmomaxhy glenn
have you thought about this?Yesterday, 05:44 AM

Comment