The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Disable subscriptio...
 
Share:
Notifications
Clear all

[Solved] Disable subscription bar for guests

12 Posts
3 Users
1 Likes
888 Views
Posts: 12
Topic starter
(@jharries)
Eminent Member
Joined: 3 years ago

Good day,

 

We run a membership site www.morganscloud.com

I see that I can disable commenting for guests, which is great.

But I can't see a way to disable the subscription bar for guests only, but leave it there for logged in users.

Maybe this is in one of the premium add ons? If so happy to buy it.

Am I missing something, and if not, is there a way I could make this work?

Maybe enclose the subscribe bar in the template in a php function that tested for logged in?

Thanks

John

11 Replies
Posts: 12
Topic starter
(@jharries)
Eminent Member
Joined: 3 years ago

Hi Again

Just took a look at the templates and it looks like I need to edit the comment-form.php and wrap the following code in an if statement so not to show if the user is not logged in:

<div class="wpd-sbs-toggle">
<i class="far fa-envelope"></i> <span class="wpd-sbs-title"><?php echo esc_html($wpdiscuz->options->phrases["wc_subscribe_anchor"]); ?></span> <i class="fas fa-caret-down"></i>
</div>

 

Is it OK to copy and edit comment-form.php in the same way as you document here: https://wpdiscuz.com/docs/wpdiscuz-documentation/customization/custom-template-and-style/

 

Thanks

John

Posts: 12
Topic starter
(@jharries)
Eminent Member
Joined: 3 years ago

Hi Again,

I thought I had it with this filter: 

https://wpdiscuz.com/docs/codex/filters/wpdiscuz_before_subscription_added/

But the field is still visible  although I do get an error code and the sub is blocked.

Still, not quite what I was looking for.

All suggestions gratefully received.

John

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7119

@jharries,

You can hide the subscription bar for guests using this CSS code provided in this post: https://wpdiscuz.com/community/postid/3065/

Posts: 12
Topic starter
(@jharries)
Eminent Member
Joined: 3 years ago

Hi Asti,

 

That's a great idea, thanks. I did not know that you could test in CSS for a logged in user, so that's a great learning for me too, double thank you

One thought, I think I'm right that spammers could still find the the field and fill it in so maybe I should also disable it for non logged in users using the filter above? Or will that break something else?

Thanks

John

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7119

@jharries,

I may also suggest you remove the element via JS code:

jQuery( "body:not(.logged-in) .wpd-sbs-toggle" ).hide();

In this case, it'll not be visible in inspect element section. 

This article should be helpful for you: https://medium.com/better-programming/how-to-add-javascript-to-wordpress-a4fdc7618a21

Posts: 12
Topic starter
(@jharries)
Eminent Member
Joined: 3 years ago

Hi Asti,

Even better, thanks. That will I think stop the spammers cold?

John

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7119

@jharries,

Yes, this should. I may also suggest you read this article: https://www.wpexplorer.com/prevent-wordpress-spam/

It also should be helpful for you. 

Posts: 1
(@martin___)
New Member
Joined: 12 months ago

Feature request. Would it be possible that you add this option to the general settings of the plugin? In the "Subscription and User Following section"?  Besides i restricted guests from commenting but they still see the option to subscripe to "messages to their own comments" . 

2 Replies
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7119

I'll aks the developers and get back to you soon. 

Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7119

Hi @martin___,

The feature will be added in the next version of the wpDiscuz plugin (no ETA). I'll update this topic once it'll be ready. 

Asti
Posts: 7119
 Asti
Support
(@asti)
Illustrious Member
Joined: 6 years ago

Hi,

We want to let you know that the new options are added in the latest version of the wpDiscuz plugin (v. 7.6.1). 

Please update the plugin, then go to the Dashboard > wpDiscuz > Forms admin page, edit the current form (if nothing is changed it's called "Default Form") and you'll see the newly added two options: 

  1. Enable subscription bar for guests
  2. Enable subscription bar for roles

Find out the news about the wpDiscuz latest version here:  https://wpdiscuz.com/community/news/wpdiscuz-7-6-1-is-released/#post-20898

Share: