latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Custom Capabilities For Read / Write bbPress

Home Forums Community Forum Custom Capabilities For Read / Write bbPress

This topic contains 3 replies, has 1 voice. Last updated by  Donna Bungard 3 years, 6 months ago.

Topic Author Topic
Posted: Tuesday Jun 25th, 2013 at 9:34 pm #52573

It seems like there has to be a way to do this but I am missing it:

I need to have one of my forums viewable by s2member level 0< but only writable by level 4<. I feel like I should be able to give the forum a custom tag that allows it to be seen by the lower levels/not written to while setting the forum to level 4. I'm a designer/developer and PHP is not my strength. Does anyone have insight as how to accomplish this?

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Wednesday Jun 26th, 2013 at 11:52 am #52619

could I add soemthing like this to my functions.php file? (not a scripter so this may be a bit poorly written – would love someone to help me clean it up if it would work)

<?php if (forum("professional-membership-2")
<?php if (current_user_can("access_s2member_level0")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php if (current_user_can("access_s2member_level1")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php if (current_user_can("access_s2member_level2")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php if (current_user_can("access_s2member_level3")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php }  ?>
Posted: Thursday Jun 27th, 2013 at 10:05 am #52681

Hmmm tried putting the below into the header file instead (seemed to make more sense) but it blew up the page – help?!

<!--- Forum Edits--->
  <?php if (forum("professional-membership-2")){
<?php if (current_user_can("access_s2member_level0")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php if (current_user_can("access_s2member_level1")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php if (current_user_can("access_s2member_level2")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php if (current_user_can("access_s2member_level3")){ ?>
<style>
.bbp-reply-form{display:none;}
</style>
<?php }  ?>
<?php }  ?>
<!--- END Forum Edits--->
Posted: Friday Jun 28th, 2013 at 10:22 am #52738

I almost have it = except now it’s targeting all levels. this is the code:


 <?php 
 if($post->ID == 2448){
	if (current_user_can("access_s2member_level0")){ 
echo '<style  type="text/css">
.bbp-reply-form{display:none;}
.bbp-topic-form{display:none;}
</style>';
} elseif (current_user_can("access_s2member_level1")){
echo '<style  type="text/css">
.bbp-reply-form{display:none;}
.bbp-topic-form{display:none;}
</style>';
} elseif (current_user_can("access_s2member_level2")){
echo '<style  type="text/css">
.bbp-reply-form{display:none;}
.bbp-topic-form{display:none;}
</style>';
} elseif (current_user_can("access_s2member_level3")){
echo '<style  type="text/css">
.bbp-reply-form{display:none;}
.bbp-topic-form{display:none;}
</style>';
} else {
}  
 }  ?>
  

I’ve tested it – the bbPress portion – targeting the posts IS working. Its the s2Member part that’s tricky.
Thank you for any help!

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.