Hidden messages visible for Administrators only
4 posters
Page 1 of 1
Hidden messages visible for Administrators only
Hello everyone,
I'm looking for a way to make the messages with "[ hide ]" tag visible for administrators only. In the best case scenario I would like to have this one and a "normal hide", which means, that the Users would be able to choose if they want their message to be seen only by the Admins or just like regular hidden messages (so only by the people that wrote in this exact topic).
I've been loking for any help on this forum already, however I couldn't find a proper solution.
My forum's version is ModernBB.
I'm looking for a way to make the messages with "[ hide ]" tag visible for administrators only. In the best case scenario I would like to have this one and a "normal hide", which means, that the Users would be able to choose if they want their message to be seen only by the Admins or just like regular hidden messages (so only by the people that wrote in this exact topic).
I've been loking for any help on this forum already, however I couldn't find a proper solution.
My forum's version is ModernBB.
Last edited by hazira on December 4th 2021, 6:51 pm; edited 1 time in total
Re: Hidden messages visible for Administrators only
Right now we do not have a default option for this. Maybe someone with coding expertise can help with this topic.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Hidden messages visible for Administrators only
Hi, thanks for your replies!
@pedxz Unfortunately your script doesn't work on my forum. Is there any chance that it is prepared for some other version? Or maybe I'm expected to do something more than pasting it in the Javascript codes management and enabling them?
@pedxz Unfortunately your script doesn't work on my forum. Is there any chance that it is prepared for some other version? Or maybe I'm expected to do something more than pasting it in the Javascript codes management and enabling them?
Re: Hidden messages visible for Administrators only
Your forum is https://hashira.forumpolish.com right?hazira wrote:Is there any chance that it is prepared for some other version?
Re: Hidden messages visible for Administrators only
pedxz wrote:Your forum is https://hashira.forumpolish.com right?hazira wrote:Is there any chance that it is prepared for some other version?
Yes.
Re: Hidden messages visible for Administrators only
Here:hazira wrote:pedxz wrote:Your forum is https://hashira.forumpolish.com right?hazira wrote:Is there any chance that it is prepared for some other version?
Yes.
- Code:
(function($) {
'use strict';
$(function() {
if (! /^\/t(\d+)(p\d+-|-).*$/i.test(location.pathname)) {
return;
}
$('.post').each(function() {
var $post = $(this);
var config = {
link: $post.find('a[href^="/post?p="][href$="&mode=editpost"]'),
message: (_userdata.user_level ? $post.find('a[href^="/post?p="][href$="&mode=editpost"]').attr('href').split('p=')[1].split('&')[0] : $post.attr('class').split('--')[1]),
title: $post.find('.post-head a[href^="/t"]'),
content: $post.find('.postbody > .content').html()
};
if (/> only_admin/.test(config.title.text())) {
config.title
.html('This post is <b>only visible for moderation</b>.')
;
$post
.attr('id', 'only_admin-' + config.message)
.css('opacity', '.5')
.find('.postbody > .content')
.html((_userdata.user_level ? config.content : '<span style="font-weight: 700; color: red;">[ You cannot see this message ]</span>'))
;
}
if (_userdata.user_level !== 1 && _userdata.user_level !== 2) {
return;
}
if (!config.link.length) {
return;
}
$.get(config.link.attr('href'))
.done(function(context) {
var $textarea = $('#text_editor_textarea', context);
if (!$textarea.length) return;
if ($('#only_admin-' + config.message).length) return;
$('<button>', {
'class': 'button1 rep-button',
'role': 'button',
'title': 'Hide this post',
'text': 'Hide post'
})
.appendTo($post.find('.postbody > .content'))
.on('click', function(event) {
event.preventDefault();
$.post("/post", {
p: config.message,
mode: 'editpost',
subject: '> only_admin',
message: $textarea.val(),
edit_reason: '',
attach_sig: 0,
notify: 0,
post: 1
}).done(function() {
location.reload(true);
}).fail(function() {
alert('[Erro]: Something went wrong when editing the post');
});
});
});
});
});
}(jQuery));
skouliki and TonnyKamper like this post
Re: Hidden messages visible for Administrators only
Hello. Sorry for late reply.
Unfortunately the solution which you sent doesn't work for us. We decided to change our mechanics a bit so we don't need this hide option anymore. However, if you have any idea about what could have gone wrong, we will be more than happy to try out any new code or provide more info that could help in case someone else would need it
Unfortunately the solution which you sent doesn't work for us. We decided to change our mechanics a bit so we don't need this hide option anymore. However, if you have any idea about what could have gone wrong, we will be more than happy to try out any new code or provide more info that could help in case someone else would need it
Re: Hidden messages visible for Administrators only
If you no longer need this please mark it as solved so the topic can be closed.
Thank you.
Thank you.
Re: Hidden messages visible for Administrators only
Ape wrote:If you no longer need this please mark it as solved so the topic can be closed.
Thank you.
Done.
Re: Hidden messages visible for Administrators only
Problem solved & topic archived.
|
Similar topics
» Hidden messages visible for Administrators only
» Notifications visible when FM Toolbar is hidden
» divide forum into visible and hidden section
» Administrators ..........
» How do I create different hidden forums for different hidden groups?
» Notifications visible when FM Toolbar is hidden
» divide forum into visible and hidden section
» Administrators ..........
» How do I create different hidden forums for different hidden groups?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum