Hide a Level

Is it possible to hide a level from all but the admin?

I am setting up an online film festival, and want a level that will be only for film makers who have had a film accepted. I will then manually set them up to be on that level.

  • digitsoft
    • The Crimson Coder

    Yes...just use a php plugin like execphp and this code on the reg page:

    <?php
    global $current_user;
    get_currentuserinfo();
    $user_level = $current_user->user_level;
    $user_id = $current_user->ID;
    if ($user_id == 1)
    {
    [subscriptionform]
    }
    ?>

    You can also display the form based on level if you wanted....

  • digitsoft
    • The Crimson Coder

    Here's the answer:
    1. Add this on line 22 of /membership/membershipincludes/includes/subscription.form.php

    global $current_user;
    get_currentuserinfo();
    $user_level = $current_user->user_level;
    $user_id = $current_user->ID;
    if ($user_id == 1)
    {

    2. Add this on line 70 or so:
    }

    The center of this file should look like this:

    foreach((array) $subs as $key => $sub) {
    
    			$subscription = new M_Subscription($sub->id);
    
    global $current_user;
    get_currentuserinfo();
    $user_level = $current_user->user_level;
    $user_id = $current_user->ID;
    if ($user_id == 1)
    {
    			?>
    			<div class="pricebox subscriptionbox" id='subscriptionbox-<?php echo $subscription->id; ?>'>
    				<div class="topbar"><span class='title'><?php echo $subscription->sub_name(); ?></span></div>
    				<div class="pricedetails"><?php echo $subscription->sub_description(); ?></div>
    				<div class="bottombar"><span class='price'><?php echo $subscription->sub_pricetext(); ?></span>
    				<?php
    					$pricing = $subscription->get_pricingarray();
    
    					if($pricing) {
    						?>
    						<span class='link'>
    							<?php
    
    								if($M_options['formtype'] == 'new') {
    									// pop up form
    									$link = admin_url( 'admin-ajax.php' );
    									$link .= '?action=buynow&subscription=' . (int) $sub->id;
    									$class = 'popover';
    								} else {
    									// original form
    									$link = '?action=registeruser&subscription=' . (int) $sub->id;
    									$class = '';
    								}
    
    								if(empty($linktext)) {
    									$linktext = apply_filters('membership_subscription_signup_text', __('Sign Up', 'membership'));
    								}
    
    								$html = "<a href='" . $link . "' class='button " . $class . " " . apply_filters('membership_subscription_button_color', 'blue') . "'>" . $linktext . "</a>";
    								echo $html;
    							?>
    							<?php //do_action('membership_purchase_button', $subscription, $pricing, $user_id); ?>
    						</span>
    						<?php
    					}
    					?>
    				</div>
    			</div>
    
    		<?php
    } //Added by rob
  • aecnu
    • WP Unicorn

    Greetings Joe and Rob,

    It appears this particular topic is now resolved/closed, if you need any further assistance please let us know.

    If it wasn't resolved, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Thank you for being a WPMU Dev member!

    Cheers, Joe :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.