Home › Forums › Community Forum › Additional conditional in comments section
This topic contains 11 replies, has 2 voices. Last updated by Eduardo Colmenares 3 years, 11 months ago.
Topic Author | Topic |
---|---|
Posted: Friday Feb 1st, 2013 at 3:24 pm #40300 | |
|
|
Hi- I’m trying to restrict access to commenting on a site I’m working on. I want only paid members to be able to comment (non-paid users can still read comments). I changed the following comment_status) : ?> to comment_status && current_user_can(“access_s2member_level1”) : ?> The good news is, no errors. The bad news is, it doesn’t do anything. If I’m logged in as a level0 member, I can still comment. Any ideas? thanks |
List Of Topic Replies
Author | Replies |
---|---|
Author | Replies |
Posted: Friday Feb 1st, 2013 at 3:26 pm #40301 | |
|
|
Part of my code was stripped out. I changed if (‘open’ == $post->comment_status) : ?> to if (‘open’ == $post->comment_status && current_user_can(“access_s2member_level1”) : ?> Just pretend the opening php code is on those =) |
|
Posted: Friday Feb 1st, 2013 at 3:40 pm #40303 | |
|
|
Also tried (‘open’ == $post->comment_status && current_user_is(“s2member_level1”) : ?> to no avail. -e |
|
Posted: Saturday Feb 2nd, 2013 at 12:54 pm #40490 | |
![]() |
|
That is all very strange. What happens if you try something like this?:
Of course you would add a closing endif at the bottom. :) Also, I noticed, all of your examples are missing a ‘)’ for all the if statements. ;) – Eduan |
|
Posted: Saturday Feb 2nd, 2013 at 12:55 pm #40493 | |
|
|
Thanks – that if statement already has the endif – I’m just adding the extra conditional. I’ll check out the possible missing “)”, but I’m pretty sure that’s already there too. |
|
Posted: Saturday Feb 2nd, 2013 at 2:41 pm #40510 | |
|
|
Eduan- Yep – I’m missing the first “)” . It still isn’t doing anything though :P thanks |
|
Posted: Monday Feb 4th, 2013 at 1:16 pm #40749 | |
![]() |
|
Hmm… Could you show me the entire post/page or file that contains this code? Or just the whole code from the start of the if till the endif, without cutting out anything. – Eduan |
|
Posted: Monday Feb 4th, 2013 at 1:23 pm #40752 | |
|
|
Hi- Sure. Here’s a post: http://drumsetgallery.com/welcome-to-drum-set-gallery/ And let me try the code tag. Look at line 69:
|
|
Posted: Wednesday Feb 6th, 2013 at 8:27 pm #40951 | |
![]() |
|
Line 69 is:
Try this instead:
The parentheses are messed up. :) – Eduan |
|
Posted: Thursday Feb 7th, 2013 at 2:55 pm #41043 | |
|
|
Hi Eduan- Still no go with the corrected code. Here’s what I finally did, in the Single template
Not the greatest, but it works. thanks |
|
Posted: Friday Feb 8th, 2013 at 10:06 pm #41241 | |
![]() |
|
Well if it works that’s great. :) I’m not sure what could be wrong with the other code. Maybe I’m just blind. :) – Eduan |
|
Posted: Friday Feb 8th, 2013 at 10:11 pm #41242 | |
|
|
Really, it should just work. It’s just being completely ignored for some reason. Thanks for the input though! |
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.