Plugin Login to view content (Working)

Hi Everybody.

Hi everybody

I created a Plugin based on the idea of BBCode Color Plugin and BBCode Lock.

Currently I have made it work, but I have not been able to change the css class when the visitor is not logged in and logged in.

How do I know if a member has logged in and changed the css class value?

I use BBCode:

[hideto=guest]Content Hide.[/hideto]

Example:

Plugin: GitHub - tohaitrieu/discourse-bbcode-hide: Hide content from guest for Discourse

BBCode Color Plugin: GitHub - discourse/discourse-bbcode-color: A Discourse Plugin to support BBCode color tags.

BBCode Lock (Broken Plugin): GitHub - vinkashq/discourse-bbcode-lock: A Discourse plugin to lock post contents to guest (anonymous) users

Please help me to complete this plugin

Thank you.

إعجاب واحد (1)

When no user is logged in, the html element has a class called anon.
So prefixing any CSS selector with html.anon will do the trick.

5 إعجابات

Wow. BBCode is working right now. Thank you!

Installing now I’ll Let you know how it goes :slight_smile:

إعجاب واحد (1)

I’m working to add Signup and Login button to BBCode.

So I see this


How can I change the language to english

I use css to hide content. I’m a newbie, now I have no option to change the text in admin. You can Fork my repo to your account and edit file:

discourse-bbcode-hide/assets/stylesheets/bbcode_hide.scss

Line 19th:

content: "Bạn phải đăng nhập để xem nội dung (Miễn Phí).";
إعجاب واحد (1)

OK thanks Ill Take a look :slight_smile:

I’m trying change from inline to Block to wrap and hide a block content.

[quote=“tohaitrieu, post:1, topic:126196”]
[hideto=guest]Content Hide.[/hideto]

It does not run
[hideto=guest]Content Hide.[/hideto]
[/quote]