Communities Supporter Support and Advertising

Greetings :slight_smile:

though I was considering using the Communities Plugin thinking that it would be a great feature and could be an advertising benefit changed my direction once realizing that not only did it not have Supporter Support - meaning that you could not make it available to only supporters via the supporter plugin plus also realized that non-supporter advertising would not appear in the posts, wiki, etc. of the communities plugin.

In a post here from a year ago it was claimed that there seemed to be not much interest in the Communities Plugin - and what I mentioned above is very possibly the reason - no control either all on or all off and no built in monetization .

Joe :slight_smile:

  • DavidM

    Hi Joe,

    I can understand your concerns there and the developers are hard at work on the upcoming version of Supporter, which we all can hardly wait for.

    Until then, if you take a close look at the Membership plugin, it might just be able to do the things you're requesting here. At least from looking at your request, I believe it does.
    https://premium.wpmudev.org/project/membership

    Membership can be setup to use a global database table, so the settings carry from site to site, by editing the membership-config.php file and setting the global table option to true.
    if(!defined('MEMBERSHIP_GLOBAL_TABLES')) define( 'MEMBERSHIP_GLOBAL_TABLES', true);

    With that set, you simply install Membership, network activate it and set up the options on one of your sites. The membership levels and subscriptions you set will persist site-wide. And the crazy thing is that membership levels have all sorts of rules to let you restrict access to any admin menus you like, which includes but isn't limited to the Communities menus, Support System menus, even the Dashboard if you like.

    You can even take it a step further and restrict access to sub-menus as well, making some visible, some not. And you define the membership levels and subscriptions that have access to all these things. And the latest version even has a Supporter integration option where you could still utilize your existing Supporter setup but have it attached to a Membership subscription level.

    It wouldn't cover the Supporter advertising concern you brought up, but perhaps it could tide you over until the Supporter update! :slight_smile:

    Cheers,
    David

  • aecnu

    Greetings David :slight_smile:

    thank you so much for your kind and thoughtful response - I do love it here at WPMU and sincerely appreciate your folks solutions attitude - anyone one can point out a problem - but finding solutions takes effort and thinking and you folks are on top of it :slight_smile:

    In my above post I was just trying to show a perspective as to why people may have not shown much interest in this feature - but complaining I am not :slight_smile: and thought that these particular advances in supporter could/would possibly stimulate more interest I this particular plugin :slight_smile:

    and I send a Big Cheers to you and the development team for there solutions, efforts, and considerations of the past, present, and future!

    I myself want to be part of the solution, not part of the problem :slight_smile:

    Sincerely,
    Joe :slight_smile:

  • DavidM

    Heya Joe, you know, I just realized it's actually quite simple with the current version of Supporter to copy the supporter-write.php file and create a new one called, let's say, supporter-communities.php. And in that file you could make a few slight edits to hide the Communities menus on non-Supporter blogs. I'm taking a look into it right now but it looks like it would be much simpler to do it this way rather than setting up Membership as I mentioned, assuming you're already using Supporter.

    I'll post back here in a moment on this, and maybe I can simply attach a file.

  • DavidM

    Alright, so if you make a copy of supporter-write.php and rename it something like supporter-communities.php you can then make a little copy-pasta following these basic instructions:

    In your newly copied file you'll see the following:

    add_filter('user_has_cap', 'supporter_write_filter');
    
    //------------------------------------------------------------------------//
    //---Functions------------------------------------------------------------//
    //------------------------------------------------------------------------//
    
    function supporter_write_filter($allcaps, $caps, $args) {
      if (!is_supporter()) {
        unset($allcaps["edit_posts"]);
        unset($allcaps["edit_pages"]);
      }
    	return $allcaps;
    }

    You can overwrite that with the following code:

    add_action( 'admin_init', 'remove_communities_menu_item' );
    
    //------------------------------------------------------------------------//
    //---Functions------------------------------------------------------------//
    //------------------------------------------------------------------------//
    
    function remove_communities_menu_item() {
    	if (!is_supporter()) {
    		remove_menu_page('communities.php');
    	}
    }

    And after saving that file, you can place it in your Supporter plugin folder with the other Supporter plugins and it will remove the Communities menu items from your non-Supporter sites.

    I'll gladly clarify any of that if you like though so please just ask! :slight_smile:

    PS. I would have attached a file but I'll have to first run by the developers how to best handle such a plugin (ie. credits, plugin info).

  • aecnu

    Greetings David :slight_smile:

    well sir I tried this exactly as you described and got the following error when trying to address the site in any way, shape, or form:

    ***********************
    Parse error: syntax error, unexpected T_FUNCTION, expecting T_STRING or T_VARIABLE or '$' in /home/facepres/wwwroot/facepresssite.com/wp-content/mu-plugins/supporter-communities.php on line 41

    ***********************

    In this case Line 41 reads:
    function remove_communities_menu_item() {

    I do not know what to assign the variable '$' that it is looking for :slight_frown:

    so I cannot help further at this moment other then this to help debug our adjustment and possible solution :-S

    Joe :slight_smile:

  • DavidM

    Hi Joe,

    I'm not sure what happened there but I've gone ahead and attached a zip with the file in it for sake of ease. I tested the plugin initially and I've further tested this one but if you could let me know if that issue persists, I'll take a look into it.

    To be sure, this only removes the menu item yet not the functionality. In other words, if a users knows the Communities urls, they'll be able to access them. So this is just a simple solution really, and a more robust one would restrict access to those urls as well.

  • aecnu

    Greetings David!

    thank you for the attached file - and maybe I got this right the first time but did not detect it for the following reason - In which I shall explain :slight_smile:

    With the attachment you have so kindly provided - Communities only showed up in the main site but not the rest - and still did not show up in the supporter settings.

    However, after thinking about it for a few minutes and looking over the installation instructions again - It dawned on me as per the instructions we are putting the plugin in mu-plugins.

    So I deleted the communities-framework.php from mu-plugins, created a folder in plugins call communities and uploaded the community-framework.php to the newly created folder in plugins-->communities ..... and Eureka!

    It now shows up in Settings-->Supporter-->Premium Feature Activation

    I checked the main site and it is there and also checked our free member test site and it is there as a supporter only option.

    Fantastic!

    Thanks David for your continuing solution efforts and your patience :slight_smile:

    Joe :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.