Heliosurge
(Dan DeMontmorency)
21. Februar 2023 um 00:18
1
Hi I have categories that are visible to public but only certain groups are allowed to post/reply.
I am looking for guidance thst if current user is not part of saud groups to hide the Like button in posts. To remove one of the many flaws of reddit.
I am also looking fir code to allow decorating a Topic Author so all of there posts in the topic identify them as Op.
Thanks.
1 „Gefällt mir“
Canapin
(Coin-coin le Canapin)
21. Februar 2023 um 12:53
2
You can hide the like button with CSS, but that won’t prevent users from liking posts (a plugin would be required to ensure that), if they figure out how to un-hide the button for example.
I suppose the easiest way would be using CSS Classes for Current User's Groups which adds the current user groups to the body classes, then use CSS such as:
body.category-your-category-slug:not(.group-group_name) {
button.like {
display: none;
}
}
Let me know if you have trouble understanding
Here’s a related topic which, alas, didn’t have any reply. I cross-link so helping on one topic will help solving the other.
The problem: I want users to be able to post as RPG characters. I would like for them to be able to insert a template into a post - something like the below:
[wrap="characterpost"]
[characterav]https://image.link.example.png[/characterav]
[charactername][[Character Name]][/charactername]
[/wrap]
And then use a script so that the image replaces the original avatar and the charactername topic link goes in front of the username. For example, if the post usually says “Username,” I want to replace …
2 „Gefällt mir“
Stephen
(Stephen)
21. Februar 2023 um 13:31
3
This will decorate responses by the OP to their own topic:
.topic-owner:not(:first-child) article .row .topic-body .topic-meta-data .names::after {
content: "Topic Starter";
color: var(--secondary);
background: var(--secondary-medium);
padding: 0px 8px;
border-radius: 8px;
}
You could substitute “topic starter” for “OP” or whatever you like.
3 „Gefällt mir“
Heliosurge
(Dan DeMontmorency)
21. Februar 2023 um 15:23
4
Cool this us working. I see it is every post adter First. Lol
How do I move this also to after name?
Or even space between decoration & name.
1 „Gefällt mir“
Canapin
(Coin-coin le Canapin)
21. Februar 2023 um 15:49
5
I tried the code out of curiosity. By default, it’s set after your name:
But it depends on the HTML present in this section, which varies from a forum to another depending on the enabled features.
2 „Gefällt mir“
Heliosurge
(Dan DeMontmorency)
21. Februar 2023 um 16:01
6
O have post badges plugin & National flags plugin, User Notes. Woupd anybof these interfer with position?
Alternatively can we sinoly add a border around the Op Name?
Here is a link to the post.