Help with class selector

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
zesilo
Registered User
Posts: 1
Joined: Sun Sep 23, 2018 3:15 am

Help with class selector

Post by zesilo » Sun Sep 23, 2018 6:18 pm

So right now the code will call class bg1 with class content on odd forum posts, class bg2 with class content on even forum posts.
When userID is 51 the code then uses class bg1 with class blizz content.
How can I make it so that when userid is 51 the code calls class blizz bg1 with class bg content?

css class ids

Code: Select all

.bg1 .postprofile { background-image: url("./images/avatar-bg1.gif"); }
.bg2 .postprofile { background-image: url("./images/avatar-bg2.gif"); }
.blizz .bg1 .postprofile { background-image: url("./images/avatar-bg1-blizz.gif"); }
.blizz .bg2 .postprofile { background-image: url("./images/avatar-bg2-blizz.gif"); }
.red .bg1 .postprofile { background-image: url("./images/avatar-bg1-red.jpg"); }
.red .bg2 .postprofile { background-image: url("./images/avatar-bg2-red.jpg"); }

.content { color: #E1C492; }
.blizz .content { color: #00C0FF; }
.blizz .content strong { color: #FFF; }
.mvp .content { color: #5DF644; }
.mvp .content strong { color: #FFF; }

html phpbb code in viewtopic_body.html

Code: Select all

<div id = "p{{ postrow.POST_ID }}" class = "
post has-profile {% if postrow.S_ROW_COUNT is odd %}bg1{% else %}bg2{% endif %}
{% if postrow.S_UNREAD_POST %} unreadpost{% endif %}
{% if postrow.S_POST_REPORTED %} reported{% endif %}
{% if postrow.S_POST_DELETED %} deleted{% endif %}
{% if postrow.S_ONLINE and not postrow.S_POST_HIDDEN %} online{% endif %}
{% if postrow.RANK_BLIZZ %} blizz{% elseif postrow.POSTER_ID eq 51 %} blizz{% endif %}
{% if postrow.POSTER_WARNINGS %} warned{% endif %}">
Last edited by kinerity on Sun Sep 23, 2018 10:09 pm, edited 1 time in total.
Reason: Moved to phpBB Custom Coding

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 253 guests