Adding icon to latest post by "specific rank" - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Extensions (https://community.mybb.com/forum-201.html) +--- Forum: Themes (https://community.mybb.com/forum-103.html) +---- Forum: Theme Development (https://community.mybb.com/forum-105.html) +---- Thread: Adding icon to latest post by "specific rank" (/thread-194699.html) |
Adding icon to latest post by "specific rank" - Mr Frosty - 2016-06-25 Hey there, I was wondering if it was possible to add icons to specific ranks who posted on a thread?
this bit shows the users name
Is there a way to check if that users is lets say an admin and then add an icon next to its name? Now i know a fair bit of css and i know i can just add styling to:
but that would add the icon to every last user that posted, and I want to be able to have diffrent icons depending on their ranks. This is the idea, but then depending on their ranks instead of hardcoded for all latest posts Thanks in advance! Tom van Lierop RE: Adding icon to latest post by "specific rank" - Eric - 2016-06-27 I don't believe a user's group information is available at that spot (Someone please correct me if I'm wrong). I'll provide this hackish way around it, in case you're interested. This is by no means the best solution, you'd want to use some sort of plugin to bring this information forward. You can target these by user ID (For each staff member) and style them accordingly.
You can also combine it with font-awesome and use a pseudo element to place the icon there. Hope it helps and good luck. RE: Adding icon to latest post by "specific rank" - Mr Frosty - 2016-06-27 Alright i will try that out! thanks RE: Adding icon to latest post by "specific rank" - Mr Frosty - 2016-07-05 Alright, So I tried it out and didnt have any luck with it. I do like the idea, because I am not too big of a fan using too much plugins.. But /* post-author here is ".last-post and user-1 since my user ID is 1?" */ .post-author a[href~=user-1]:before { /* styling */ } my apologies for the - sign i wont show as the curled sign in the reply... Is there anything i am doing wrong? Looking at your post it seems the 1 isnt the right number, but i am pretty sure thats my user ID... Thanks in advance. kind regards Tom. RE: Adding icon to latest post by "specific rank" - Johnny S - 2016-07-05 Are you using SEF urls (or ones by provided by Google SEO) ? If you are using sef urls (forumurl.com/user-1.html) try with this code .post-author a[href*="user-1"]:before { /* styling */ } If you aren't using SEF urls (forumurl.com/member.php?action=profile&uid=1) then use .post-author a[href*="uid=1"]:before { /* styling */ } RE: Adding icon to latest post by "specific rank" - Mr Frosty - 2016-07-06 Thank you both!! it works now Cheers, Tom |