Legend icons phpbb 3.3.11

For support and discussion related to templates and themes in phpBB 3.3.
MortallCsAl3x
Registered User
Posts: 80
Joined: Fri Apr 14, 2023 5:01 pm
Location: Romania
Name: Alex Cornea

Legend icons phpbb 3.3.11

Post by MortallCsAl3x »

Hello, I would like if someone could help me to add some icons to the legend on phpbb 3.3.11.
I leave you a picture below so you can understand what it is about. Please, I've been looking for an answer for a long time and I haven't found it yet.

Image
:roll: Forum - https://www.worldcs.ro - Gaming Community PHPBB3
:arrow: Counter-Strike 1.6 download - https://www.cstrike16.eu
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 6756
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James

Re: Legend icons phpbb 3.3.11

Post by HiFiKabin »

Mis read the question, answer deleted
Last edited by HiFiKabin on Sun Mar 17, 2024 6:49 pm, edited 1 time in total.
Reason: edit again, forgot to delete screenshot
MortallCsAl3x
Registered User
Posts: 80
Joined: Fri Apr 14, 2023 5:01 pm
Location: Romania
Name: Alex Cornea

Re: Legend icons phpbb 3.3.11

Post by MortallCsAl3x »

Bro i know this!! I need how to put the icon!
:roll: Forum - https://www.worldcs.ro - Gaming Community PHPBB3
:arrow: Counter-Strike 1.6 download - https://www.cstrike16.eu
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 492
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: Legend icons phpbb 3.3.11

Post by danieltj »

I don’t think I’ve seen any extensions that do this to add an icon next to a group name. You might need to make an extension request.
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.
User avatar
Madalin10
Registered User
Posts: 84
Joined: Wed Jun 18, 2014 2:42 pm
Name: Madalin C.

Re: Legend icons phpbb 3.3.11

Post by Madalin10 »

If you only want to add icons to the legend (but not the usernames aswell), you can do this via css easily by targeting the <a> element and using :before or :after.

This is just an example, you can even use font awesome / google material icons etc..
-> https://jsfiddle.net/hteoya23/
https://awesome-web.design - I offer phpBB & web design services at fair prices.
MortallCsAl3x
Registered User
Posts: 80
Joined: Fri Apr 14, 2023 5:01 pm
Location: Romania
Name: Alex Cornea

Re: Legend icons phpbb 3.3.11

Post by MortallCsAl3x »

Madalin10 wrote: Mon Mar 18, 2024 8:53 am If you only want to add icons to the legend (but not the usernames aswell), you can do this via css easily by targeting the <a> element and using :before or :after.

This is just an example, you can even use font awesome / google material icons etc..
-> https://jsfiddle.net/hteoya23/
Do you think you can help me with a tutorial where exactly to add those codes?
:roll: Forum - https://www.worldcs.ro - Gaming Community PHPBB3
:arrow: Counter-Strike 1.6 download - https://www.cstrike16.eu
MortallCsAl3x
Registered User
Posts: 80
Joined: Fri Apr 14, 2023 5:01 pm
Location: Romania
Name: Alex Cornea

Re: Legend icons phpbb 3.3.11

Post by MortallCsAl3x »

@up
:roll: Forum - https://www.worldcs.ro - Gaming Community PHPBB3
:arrow: Counter-Strike 1.6 download - https://www.cstrike16.eu
User avatar
ssl
Registered User
Posts: 1977
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Legend icons phpbb 3.3.11

Post by ssl »

Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.13 | PHP: 8.3.9
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
User avatar
cabot
Registered User
Posts: 755
Joined: Sat Jan 07, 2012 4:16 pm

Re: Legend icons phpbb 3.3.11

Post by cabot »

Hello,
MortallCsAl3x wrote: Tue Mar 19, 2024 7:21 pm Do you think you can help me with a tutorial where exactly to add those codes?
At the end of colours.css or in a separate file, so that you can find them easily.

Proposal using FontAwesome icons:

Code: Select all

/* Common properties on the href attributes that link a group page. */
[href^="./memberlist.php?mode=group&g="]::before {
	display: inline-block;
	font-family: FontAwesome;
	font-weight: normal;
	font-style: normal;
	font-variant: normal;
	font-size: 1.2em;
	line-height: 1;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	padding-right: 3px;
}

/* Group ID 4  */
[href^="./memberlist.php?mode=group&g=4"]::before {
	content: "\f0e3";
}

/* Group ID 5 */
[href^="./memberlist.php?mode=group&g=5"]::before {
	content: "\f013";
}
The first rule déclare common properties on the href attributes that link a group page.

The others relate to each group.
Simply change the group ID in the attribute selector and the icon code.


Some screenshots:

legend.png
breadcrumb_group_page.png
team_page.png
ucp_memberships.png
You do not have the required permissions to view the files attached to this post.
Last edited by cabot on Wed Mar 20, 2024 9:36 am, edited 1 time in total.
User avatar
ssl
Registered User
Posts: 1977
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: Legend icons phpbb 3.3.11

Post by ssl »

Much more complete solution than the one proposed above
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.13 | PHP: 8.3.9
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
User avatar
Mannix_
Registered User
Posts: 1974
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: Legend icons phpbb 3.3.11

Post by Mannix_ »

Using group id as a selector is much more reliable since you won't have to adjust anything if you decide to change group color :)
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
MortallCsAl3x
Registered User
Posts: 80
Joined: Fri Apr 14, 2023 5:01 pm
Location: Romania
Name: Alex Cornea

Re: Legend icons phpbb 3.3.11

Post by MortallCsAl3x »

cabot wrote: Wed Mar 20, 2024 9:23 am Hello
It works perfectly, but I want the icon to appear here too when someone posts don't nuai in the caption! look where I mean, I'll leave you a screenshot!

Image: Image
:roll: Forum - https://www.worldcs.ro - Gaming Community PHPBB3
:arrow: Counter-Strike 1.6 download - https://www.cstrike16.eu
User avatar
cabot
Registered User
Posts: 755
Joined: Sat Jan 07, 2012 4:16 pm

Re: Legend icons phpbb 3.3.11

Post by cabot »

This is not what you originally asked for and, imho, it will overload the display in the forum list.

The solution I've given you won't work and you'll have to use the colour of the "style" attribute, as Madalin10 suggested, to declare properties on the elements to which you want to add an icon.

And it won't be very intuitive because properties are not declared in the same way for groups or users (spacing/no spacing after colon) and you need to respect the format returned by the HTML.
Otherwise extrapolate and consider that the colour can only be the one declared on the color property, something like that:

Code: Select all

[href^="./memberlist.php?mode=group&g="]::before,
.username-coloured::before {
	display: inline-block;
	font-family: FontAwesome;
	font-weight: normal;
	font-style: normal;
	font-variant: normal;
	font-size: 1.1em;
	line-height: 1;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	padding-right: 3px;
}

/* Group/User color #00AA00 */
[href^="./memberlist.php?mode=group&g="][style*="#00AA00"]::before,
.forums .username-coloured[style*="#00AA00"]::before {
	content: "\f0e3";
}

/* Group/User color #AA0000 */
[href^="./memberlist.php?mode=group&g="][style*="#AA0000"]::before,
.forums .username-coloured[style*="#AA0000"]::before {
	content: "\f013";
}
It goes without saying that the cleanest solution would be to create an extension that adds classes (group-group-id and user-group-id) in addition to the existing style attribute.

Return to “[3.3.x] Styles Support & Discussion”