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: https://github.com/tohaitrieu/discourse-bbcode-hide

BBCode Color Plugin: https://github.com/discourse/discourse-bbcode-color

BBCode Lock (Broken Plugin): https://github.com/vinkashq/discourse-bbcode-lock/

Please help me to complete this plugin

Thank you.

1 Like

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 Likes

Wow. BBCode is working right now. Thank you!

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

1 Like

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 Like

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]