Advertise activity in a private category (discourse-category-lockdown)

Great, thanks for taking this on @fzngagan. I’ve re-assigned the OP to you, and started the GitHub transfer.

4 Likes

Thanks for all of that David. :slight_smile:

1 Like

I just installed this plugin and noticed that it allows users to create new topics in a locked down category. Can this be fixed?

1 Like

You need to change your category’s security settings so everyone can ‘see’ but only those in the correct group can create topics, here’s how mine is set up:

image

2 Likes

Ah, okay, so I change “everyone” to see only and then grant my “paid member” group the full permissions. Got it. Thank you!

4 Likes

With the Discourse Subscriptions plugin advancing in development, I’d love to see a tight integration with the Category Lockdown plugin.

Testing now with latest, a user who is not a member of the specified group can see the category and posts in it.

The plugin is active and the category security setting is this:


If I remove the everyone can see setting, the category is no longer visible to the non-member user. So, the behavior is as if there was no Category Lockdown plugin active.

There are no errors in the log. Could it be that I’m missing another setting to get this to work?

2 Likes

yes, that is correct, because:

2 Likes

What are the entry restrictions for the current_member group?

I have a forum running both plugins, it worked fine with a private group last time I checked

2 Likes

Gah! :man_facepalming: I was missing the obvious and didn’t have this checked at the bottom of the category settings:

All is well!

2 Likes

The subscriptions plugin should already be doing that. Its tightly integrated with discourse groups which is tightly integrated with category security settings. :wink:

2 Likes

I’ve been looking for a plugin that does almost exactly this (and didn’t realize it existed!). Can you clarify what this statement means though? Just that the thread will be indexed in Google?

If a user not in the group or a user who isn’t logged in navigates to the thread, they will always go to the payment gateway (or whatever link), right?

1 Like

Yes, but the topic entry and some bits and pieces of the content appear in the search results. If that’s ok for you, then that’s it.

Recently, I added a feature to allow category specific redirects.

If you want something more comprehensive, you can look at Discourse Subscriptions

2 Likes

This seems more ideal for my use than Discourse subscriptions because I’m using WordPress and SSO for the membership. I will give it a try.

1 Like

Very easy to configure and I think I have it working properly.

Random question, is it possible to inject a custom icon? i.e. a site logo to use as the icon instead of the font awesome icons? I currently only have it as a png

1 Like

It’s something you can do with some css, I made something similar, but I didn’t keep the code.

If I remember correctly, you need two steps: hiding the custom icon, I used the star icon in my custom theme, then add the custom image before the title

.topic-list .category-idofyourcategory {
    .topic-status .d-icon-star {
        display: none;
    }
    .title::before {
        content: url("/your_image.png");
    }
}

I didn’t reproduce it, so you might need to adjust a few things, but it should give you some direction

3 Likes

I’m re-directing to a WordPress page (my OAuth provider) which allows the user to sign up for a subscription to view the content, or just login.

The issue is that if they login and go back to the forum, they are not automatically logged into the forum (and have to click the Login button again on the forum). What do I need to change to try to make sure they are automatically logged in? Is there something I can add to my link?

If it allows you to redirect to a url you will want to add this to the end of your discourse url /session/sso?return_path=/top, you can change the path it redirects to, but this should log them in for you.

2 Likes

Outstanding! I used to be able to do this on Xenforo, so I was hoping there would be something similar on Discourse. It’s ideal for paid communities to pull folks into premium portions of the forum.

Many thanks,
Ray

P.S. @davidkingham David, took a gander at your community. It’s one of the best I have seen. Props and thanks for sharing.

Ray

2 Likes

This plugin appears to break in 2.6 beta 2. @fzngagan Discourse doesn’t allow me to load any topics when it is activated, see errors below.

Message (204 copies reported)

ArgumentError (wrong number of arguments (given 1, expected 0))
lib/topic_view.rb:59:in `initialize'
app/controllers/topics_controller.rb:81:in `new'
app/controllers/topics_controller.rb:81:in `show'
app/controllers/application_controller.rb:340:in `block in with_resolved_locale'
app/controllers/application_controller.rb:340:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:68:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:334:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:22:in `call'
lib/middleware/request_tracker.rb:176:in `call'

Backtrace

plugins/discourse-category-lockdown/plugin.rb:41:in `check_and_raise_exceptions'
lib/topic_view.rb:59:in `initialize'
app/controllers/topics_controller.rb:81:in `new'
app/controllers/topics_controller.rb:81:in `show'
actionpack (6.0.3.2) lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
actionpack (6.0.3.2) lib/abstract_controller/base.rb:195:in `process_action'
actionpack (6.0.3.2) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (6.0.3.2) lib/abstract_controller/callbacks.rb:42:in `block in process_action'
activesupport (6.0.3.2) lib/active_support/callbacks.rb:112:in `block in run_callbacks'
app/controllers/application_controller.rb:340:in `block in with_resolved_locale'

Env
1 Like

This was also on my list of things to figure out. It seems it was broken by this change (4 days ago)

https://github.com/discourse/discourse/commit/3b55de90e517f7081006947cc4fabbe5651a65c0#diff-456750b7ffa76d2d60b7bb0b60cb21e6R786

5 Likes