jslirola
Hi! Thanks for link to new extension!
I have some confusion, what to do )) Its will be long text partially with google translate, so excuse me, but its necessery to undestanding the state of affairs.
As I discribe here
I want to comletely hide some content from not a members. This content most often is semi-private information, what I dont wana share with everybody. Looks like extension members-class, did the trick. But members-class is just hide conten with CSS, and at the end, this "hidden" content can be easy obtained if somebody want to do this. This is not enough for me.
Looks like your extension can hide content completly. This is what I need? ๐ ? No again.... ๐
Because I dont want to hide all urls, images or code. I need to hide custom text and some urls and images. And at the same time, I need to some other urls, images can be full visible to all visitors.
About new extension BBCode Hide Content...
I have not yet figured out whether it hides the content completely, but I also see some drawbacks here.
In the first place, forcing people to write comments will eventually just lead to more unnecessary flooding. Requiring a press like is an better option. To press it, user MUST be registered/logined, and this does not oblige to anything else. After all, it's just one click or tap. But here, too, there is some dissonance.
First - I'm planning on migrating my forum from vbulletin, and there are a lot of posts that are ALREADY available to forum members, and now, after the transfer of data, these users will have to put likes or write unnecessary comments to see connent what was available for them before.. I'm sure this will confuse many of them. And secondly, on my working forum, which I plan to transfer to the flarum engine, at the moment the "thank you system" is completely disabled. It happened by the common will of the majority of users of my forum. I dont know.. they seem to take themselves very seriously ๐ ๐
Aneway. I found some difficult way to solve my problem. I combined members-class and your extension.
I'll try to explain.
Extension members-class allows to use [members][/members] tags to tender it on page load as:
<span class="members-only">hidden content</span>
Then I have this code, I use your extension with next actions:
With options of your extension in ACP, I dissable links and images options and enable code.
And then I did something what I must never to do... I know it, but )))
In file: \vendor\jslirola\flarum-ext-login2seeplus\src\HideContentInPosts.php
I found:
$newHTML = preg_replace('/<pre><code(.*?)>[^>]*<\/pre>/is', $this->get_link('jslirola-login2seeplus.forum.code'), $newHTML);
$newHTML = preg_replace('/<code(.*?)>[^>]*<\/code>/is', $this->get_link('jslirola-login2seeplus.forum.code'), $newHTML);
And replace with:
$newHTML = preg_replace('/(<span class="members-only">)(.*?)<\/span>/is', $this->get_link('jslirola-login2seeplus.forum.link'), $newHTML);
As you can see, now your extension looks and hide for content inside
<span class="members-only"></span>
and it work for me like a charm. Your extesion completly hide my any custom content in[members][/members]
tags. ๐
And now.... finally my question.... ๐
Can I somehow add <span class="members-only"></span>
to patterns, what your extension will hide, without editing sources?
Or may be you be so good and explain in general terms how to correctly add a new option to your code, so that I would try to make a PR in the repository?
Thanks! And sorry for my english and long text. ))