Exemple #1
0
function is_supporter_user($user_id = '')
{
    return is_pro_user($user_id);
}
Exemple #2
0
 function messages_template($template)
 {
     global $psts;
     if (!$psts->get_setting('bp_compose')) {
         return $template;
     }
     //don't mess with pro_sites
     if (is_pro_user()) {
         return $template;
     }
     add_action('bp_template_content', array(&$this, 'message'));
     return 'members/single/plugins';
 }
    /**
     * 
     *
     * @since 1.0.2
     *
     * @param none
     * @return none
     */
    function settings_main_admin_display_selection_options_panel()
    {
        ?>
		<table class="form-table">
		<tr>
			<th scope="row">
				<label for="site-categories-sites-category-limit"><?php 
        _e('Number of categories per site', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</label>
			</th>
			<td>
				<p class="description"><?php 
        _e('This option lets you limit the number of Site Categories available to the site. This option adds a number of dropdown form elements on the Settings General page where the admin can set the categories for their site.', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</p>
				<input type="text" class='widefat' id="site-categories-sites-category-limit" name="bcat[sites][category_limit]" 
					value="<?php 
        echo intval($this->opts['sites']['category_limit']);
        ?>
" />
			</td>
		</tr>
		<tr>
			<th scope="row">
				<label for="site-categories-sites-category-limit-prosites"><?php 
        _e('Pro Sites', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</label>
			</th>
			<td>		
				<?php 
        if (function_exists('is_pro_user')) {
            // If not a Pro User (whatever that is). Then we do not show the Pro Site section
            if (is_pro_user(get_current_user_id())) {
                $levels = (array) get_site_option('psts_levels');
                if ($levels) {
                    ?>
								<p class="description"><?php 
                    _e('You can offer your Pro Sites level more site categories selections', SITE_CATEGORIES_I18N_DOMAIN);
                    ?>
</p>
								<ul style="float: left; width: 100%;">
								<?php 
                    $level_value = '';
                    foreach ($levels as $level_idx => $level) {
                        if (isset($this->opts['sites']['prosites_category_limit'][$level_idx])) {
                            $level_value = intval($this->opts['sites']['prosites_category_limit'][$level_idx]);
                        }
                        if ($level_value == 0) {
                            $level_value = '';
                        }
                        ?>
<li><input type="text" id="bcat-sites-prosites-category-limit-<?php 
                        echo $level_idx;
                        ?>
" width="40%" 
											value="<?php 
                        echo $level_value;
                        ?>
" 
											name="bcat[sites][prosites_category_limit][<?php 
                        echo $level_idx;
                        ?>
]" /> <label for="bcat-sites-prosites-category-limit-<?php 
                        echo $level_idx;
                        ?>
"><?php 
                        echo $level['name'];
                        ?>
</label></li><?php 
                    }
                    ?>
								</ul>
								<?php 
                }
            }
        } else {
            ?>
<p class=""><?php 
            echo sprintf(__('If you install the %1$sPro Sites%2$s plugin, you can offer your Pro Sites levels more categories selections.', SITE_CATEGORIES_I18N_DOMAIN), '<a href="http://premium.wpmudev.org/project/pro-sites/" target="_blank">', '</a>');
            ?>
</p><?php 
        }
        ?>
			</td>
		</tr>

		<?php 
        if (isset($this->opts['sites']['category_excludes']) && !empty($this->opts['sites']['category_excludes']) && count($this->opts['sites']['category_excludes'])) {
            $cat_excludes = implode(', ', $this->opts['sites']['category_excludes']);
        } else {
            $cat_excludes = '';
        }
        ?>
		<tr>
			<th scope="row">
				<label for="site-categories-sites-category-exclude"><?php 
        _e('Excluded Categories', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</label>
			</th>		
			<td>
				<p class="description"><?php 
        _e('Enter a comma separated list of category IDs. These categories will be excluded dropdown selection on the new site signup page as well as the blog Settings > Site Categories page.', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</p>
				<input type="text" class='widefat' id="site-categories-sites-category-excludes" name="bcat[sites][category_excludes]" 
					value="<?php 
        echo $cat_excludes;
        ?>
" />
			</td>
		</tr>
		
<?php 
        /* ?>
        		<tr>
        			<th scope="row">
        				<label for="site-categories-signup-category-minimum"><?php _e('Minimum Selected Site Categories', SITE_CATEGORIES_I18N_DOMAIN); ?></label>
        			</th>
        			<td>
        				<input type="text" class='widefat' id="site-categories-signup-category-minimum" name="bcat[sites][signup_category_minimum]" 
        					value="<?php echo intval($this->opts['sites']['signup_category_minimum']); ?>" />
        					<p class="description"><?php _e("The minimum number of site categories to be set. This value should be between 1 and the value of the 'Number of categories per site' item", SITE_CATEGORIES_I18N_DOMAIN); ?></p>
        
        			</td>
        		</tr>
        <?php */
        ?>
		<tr>
			<th scope="row">
				<label for="site-categories-signup-category-parent-selectable-yes"><?php 
        _e('Category parents selectable', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</label>
			</th>
			<td>
				<p><?php 
        _e('When displaying Site Categories on the Landing page using the <strong>Grid</strong> or <strong>Accordion</strong> styles. It is advisable to set this option to <strong>no</strong>. This option controls the dropdown categories options on the New Site form as well as the Settings page within wp-admin.');
        ?>
</p>
				<input type="radio" name="bcat[sites][signup_category_parent_selectable]" id="site-categories-signup-category-parent-selectable-yes" value="1" 
				<?php 
        if ($this->opts['sites']['signup_category_parent_selectable'] == "1") {
            echo ' checked="checked" ';
        }
        ?>
 /> <label
				 for="site-categories-signup-category-parent-selectable-yes"><?php 
        _e('Yes', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</label><br />
				
				<input type="radio" name="bcat[sites][signup_category_parent_selectable]" id="site-categories-signup-category-parent-selectable-no" value="0" 
				<?php 
        if ($this->opts['sites']['signup_category_parent_selectable'] == "0") {
            echo ' checked="checked" ';
        }
        ?>
/> <label
				 for="site-categories-signup-category-parent-selectable-no"><?php 
        _e('No', SITE_CATEGORIES_I18N_DOMAIN);
        ?>
</label>
				
			</td>
		</tr>
		
		</table>
		<?php 
    }
    function embi_prosites_section($title = '')
    {
        global $wpdb, $psts;
        if (!current_user_can('manage_options')) {
            if (!function_exists('is_pro_user')) {
                return;
            }
        }
        // If not a Pro User (whatever that is). Then we do not show the Pro Site section
        if (!is_pro_user(get_current_user_id())) {
            return;
        }
        $levels = (array) get_site_option('psts_levels');
        $site_level = $psts->get_level($wpdb->blogid);
        if (isset($levels[intval($site_level)])) {
            $site_level_text = $levels[intval($site_level)]['name'];
        } else {
            $site_level_text = '<a class="button button-primary" href="' . admin_url('admin.php?page=psts-checkout') . '">' . __('Upgrade to Pro!', 'embi') . '</a>';
        }
        if (is_pro_trial($wpdb->blogid)) {
            $site_level_text .= " (Trial)" . ' <a style="float: right" class="button button-primary" href="' . admin_url('admin.php?page=psts-checkout') . '">' . __('Upgrade to Pro!', 'embi') . '</a>';
        }
        $site_expire = $psts->get_expire($wpdb->blogid);
        //echo "site_expire=[". $site_expire ."]<br />";
        //$site_expire_text = '<strong>'. __('Expired', 'embi'). '</strong>';
        if (empty($site_expire)) {
            $site_expire_text = '';
        } else {
            if ($site_expire > 2147483647) {
                $site_expire_text = __('<strong>Never</strong>', 'embi');
            } else {
                $site_expire_text = date_i18n(get_option('date_format'), $site_expire) . " (" . intval(($site_expire - time()) / 86400) . " " . __('days', 'embi') . ")";
            }
        }
        ?>
		<div class="embi-rightnow-wrapper embi-rightnow-my-blogs-section">
			<div class="embi_dashboard">
				<h4 class="embi-section-title"><?php 
        echo $title;
        ?>
<a 
					style="float:right" href="<?php 
        echo admin_url('admin.php?page=psts-checkout');
        ?>
"><?php 
        _e('Manage Pro Account', 'embi');
        ?>
</a></h4>
				<ul>	
					<li>
						<div class="embi-item_title"><?php 
        _e('Level');
        ?>
:</div>
						<div class="embi-item_value"><?php 
        echo $site_level_text;
        ?>
</div>
					</li>
					<?php 
        if (!empty($site_expire_text)) {
            ?>
					<li>
						<div class="embi-item_title"><?php 
            _e('Expiration date');
            ?>
:</div>
						<div class="embi-item_value"><?php 
            echo $site_expire_text;
            ?>
</div>
					</li>
					<?php 
        }
        ?>
				</ul>
			</div>
		</div>
		<?php 
    }