示例#1
0
 function load_modules()
 {
     global $psts;
     //get modules dir
     $dir = $psts->plugin_dir . 'modules/';
     // Avoiding file scan
     $modules = apply_filters('prosites_modules', self::$modules);
     ksort($modules);
     //include them suppressing errors
     foreach ($modules as $file) {
         require_once $dir . $file . '.php';
     }
     //allow plugins from an external location to register themselves
     do_action('psts_load_modules');
     //load chosen plugin classes
     foreach (array_keys($modules) as $class) {
         $name = call_user_func($class . '::get_name');
         $description = call_user_func($class . '::get_description');
         $restriction = '';
         if (method_exists($class, 'get_class_restriction')) {
             $restriction = call_user_func($class . '::get_class_restriction');
         }
         if (empty($restriction) || !empty($restriction) && class_exists($restriction)) {
             psts_register_module($class, $name, $description);
         }
         if (class_exists($class) && in_array($class, (array) $psts->get_setting('modules_enabled'))) {
             global ${$class};
             ${$class} = new $class();
         }
     }
 }
示例#2
0
文件: quota.php 项目: hscale/webento
        global $psts;
        if (current_user_can('edit_pages') && !is_upload_space_available()) {
            $level = $psts->get_level() + 1;
            if ($name = $psts->get_level_setting($level, 'name')) {
                //only show if there is a higher level
                $space = $this->display_space($psts->get_level_setting($level, 'quota'));
                $msg = str_replace('LEVEL', $name, $psts->get_setting('quota_message'));
                $msg = str_replace('SPACE', $space, $msg);
                echo '<div class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $msg . '</a></p></div>';
            }
        }
    }
    function display_space($space)
    {
        if (!$space) {
            return '0' . __('MB', 'psts');
        }
        if ($space > 1000) {
            $space = number_format($space / 1024);
            /* translators: Gigabytes */
            $space .= __('GB', 'psts');
        } else {
            /* translators: Megabytes */
            $space .= __('MB', 'psts');
        }
        return $space;
    }
}
//register the module
psts_register_module('ProSites_Module_Quota', __('Upload Quota', 'psts'), __('Allows you to give additional upload space to Pro Sites.', 'psts'));
示例#3
0
        		<th scope="row"><?php 
            echo $p['Name'];
            ?>
</th>
        		<th scope="row"><?php 
            echo $p['Version'];
            ?>
</th>
        		<td><?php 
            echo $p['Description'];
            ?>
</td>
          </tr>
        <?php 
        }
        ?>
  			</tbody>
  		</table>
  		
  		<p class="submit"><input type="submit" name="supporter_plugins" class="button-primary" value="<?php 
        _e('Save Changes', 'psts');
        ?>
" /></p>
  	</form>
		</div>
	  <?php 
    }
}
//register the module
psts_register_module('ProSites_Module_Plugins', __('Premium Plugins', 'psts'), __('Allows you to create plugin packages only available to selected Pro Site levels.', 'psts'));
示例#4
0
        $this->WP_Widget('psts_widget', sprintf(__('%s Widget', 'psts'), $psts->get_setting('rebrand')), $widget_ops);
    }
    function widget($args, $instance)
    {
        global $psts, $blog_id;
        $level = $psts->get_level($blog_id);
        $level_name = $psts->get_level_setting($level, 'name');
        $images = $psts->get_setting('widget_imgs', array());
        //if image not set
        if (!isset($images[$level]) || empty($images[$level])) {
            return;
        }
        extract($args);
        echo $before_widget;
        ?>
		<center>
			<img src="<?php 
        echo esc_url($images[$level]);
        ?>
" alt="<?php 
        printf(__('A proud %s site.', 'psts'), esc_attr($level_name));
        ?>
" />
		</center>
		<?php 
        echo $after_widget;
    }
}
//register the module
psts_register_module('ProSites_Module_ProWidget', __('Pro Widget', 'psts'), __('Allows Pro Sites to put a widget in their sidebar to proudly display their Pro level.', 'psts'));
示例#5
0
文件: xmlrpc.php 项目: hscale/webento
        }
        ?>
        </select><br />
        <?php 
        _e('Select the minimum level required to enable remote publishing.', 'psts');
        ?>
				</td>
			  </tr>
			  <tr valign="top">
			  <th scope="row"><?php 
        _e('Restricted Message', 'psts');
        ?>
</th>
			  <td><input type="text" name="psts[xmlrpc_message]" id="xmlrpc_message" value="<?php 
        echo esc_attr($psts->get_setting('xmlrpc_message'));
        ?>
" style="width: 95%" />
			  <br /><?php 
        _e('Required - This message is displayed on the writing settings screen for sites that don\'t have permissions. "LEVEL" will be replaced with the needed level name.', 'psts');
        ?>
</td>
			  </tr>
		  </table>
		  </div>
		</div>
	  <?php 
    }
}
//register the module
psts_register_module('ProSites_Module_XMLRPC', __('Restrict XML-RPC', 'psts'), __('Allows you to only enable XML-RPC for selected Pro Site levels.', 'psts'));
示例#6
0
					<?php 
            $caps[$post_type->cap->publish_posts] = $post_type->label;
        }
        ?>
			  </table>
		  </div>
		</div>
	  <?php 
    }
    function message()
    {
        global $psts, $current_screen, $post_type, $blog_id;
        if (is_pro_site(false, $psts->get_setting('pq_level', 1))) {
            return;
        }
        if (in_array($current_screen->id, array('edit-post', 'post', 'edit-page', 'page'))) {
            $quota_settings = $psts->get_setting("pq_quotas");
            if (is_array($quota_settings)) {
                if (isset($quota_settings[$post_type])) {
                    if (is_numeric(@$quota_settings[$post_type]['quota']) && wp_count_posts($post_type)->publish >= @$quota_settings[$post_type]['quota']) {
                        $notice = str_replace('LEVEL', $psts->get_level_setting($psts->get_setting('pq_level', 1), 'name'), @$quota_settings[$post_type]['message']);
                        echo '<div class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $notice . '</a></p></div>';
                    }
                }
            }
        }
    }
}
//register the module
psts_register_module('ProSites_Module_PostingQuota', __('Post/Page Quotas', 'psts'), __('Allows you to limit the number of post types for selected Pro Site levels.', 'psts'));
示例#7
0
        checked($psts->get_setting('ptb_front_disable'));
        ?>
 /> <?php 
        _e('Disable', 'psts');
        ?>
</label></td>
				  </tr>
	      	<tr valign="top">
				  <th scope="row"><?php 
        _e('Front End Restricted Message', 'psts');
        ?>
</th>
				  <td>
					<textarea name="psts[ptb_front_msg]" rows="5" wrap="soft" style="width: 95%"><?php 
        echo esc_textarea($psts->get_setting('ptb_front_msg'));
        ?>
</textarea>
				  <br /><?php 
        _e('Required - This message is displayed on front end of the site if it is unpaid and disabling the front end is enabled. HTML Allowed', 'psts');
        ?>
</td>
				  </tr>
			  </table>
		  </div>
		</div>
	  <?php 
    }
}
//register the module
psts_register_module('ProSites_Module_PayToBlog', __('Pay To Blog', 'psts'), __('Allows you to completely disable a site both front end and back until paid.', 'psts'));
示例#8
0
  	</form>
		</div>
	  <?php 
    }
    function customize_controls_print_footer_scripts()
    {
        global $psts, $blog_id;
        $theme = wp_get_theme($_REQUEST['theme']);
        $allowed_themes = $psts->get_setting('pt_allowed_themes');
        if ($allowed_themes == false) {
            $allowed_themes = array();
        }
        if (isset($allowed_themes[esc_html($theme['Stylesheet'])]) && $allowed_themes[esc_html($theme['Stylesheet'])] && !is_pro_site($blog_id, $allowed_themes[$theme['Stylesheet']]) && !$this->ads_theme()) {
            $rebrand = sprintf(__('%s Only', 'psts'), $psts->get_level_setting($allowed_themes[$theme['Stylesheet']], 'name'));
            $upgrade_notice = str_replace('LEVEL', $psts->get_level_setting($allowed_themes[$theme['Stylesheet']], 'name'), $psts->get_setting('pt_text'));
            $upgrade_link = '<a href="' . $psts->checkout_url($blog_id) . '" class="activatelink nonpsts button-primary" title="' . esc_attr($upgrade_notice) . '">' . $rebrand . '</a>';
            ?>
			<script type="text/javascript">
				jQuery('#save').remove();
				jQuery('#customize-header-actions').prepend('<?php 
            echo $upgrade_link;
            ?>
');
			</script>
			<?php 
        }
    }
}
//register the module
psts_register_module('ProSites_Module_PremiumThemes', __('Premium Themes', 'psts'), __('Allows you to give access to selected themes to a Pro Site level.', 'psts'));
示例#9
0
Plugin Name: Pro Sites (Feature: MarketPress Global Products Filter)
*/
class ProSites_Module_MarketPress_Global
{
    var $pro_sites = false;
    function ProSites_Module_MarketPress_Global()
    {
        $this->__construct();
    }
    function __construct()
    {
        add_filter('mp_list_global_products_results', array(&$this, 'filter'));
    }
    function filter($results)
    {
        global $wpdb;
        if (!$this->pro_sites) {
            $this->pro_sites = $wpdb->get_col("SELECT blog_ID FROM {$wpdb->base_prefix}pro_sites WHERE expire > '" . time() . "'");
        }
        foreach ($results as $key => $row) {
            if (!in_array($row->blog_id, $this->pro_sites)) {
                unset($results[$key]);
            }
        }
        return $results;
    }
}
//register the module
if (class_exists('MarketPress')) {
    psts_register_module('ProSites_Module_MarketPress_Global', __('MarketPress Global Products Filter', 'psts'), __('When enabled, removes non-pro site products from the MarketPress global product lists.', 'psts'));
}
示例#10
0
            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';
    }
    function message()
    {
        global $psts;
        //link to the primary blog
        $blog_id = get_user_meta(get_current_user_id(), 'primary_blog', true);
        if (!$blog_id) {
            $blog_id = false;
        }
        $notice = str_replace('LEVEL', $psts->get_level_setting(1, 'name'), $psts->get_setting('bp_notice'));
        echo '<div id="message" class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $notice . '</a></p></div>';
    }
    function css_output()
    {
        //display css for error messages
        ?>
	  <style type="text/css">#message.error p a {color:#FFFFFF;}</style>
	  <?php 
    }
}
//register the module
psts_register_module('ProSites_Module_BP', __('Limit BuddyPress Features', 'psts'), __('Allows you to limit BuddyPress group creation and messaging to users of a Pro Site.', 'psts'));
示例#11
0
        ?>
</th>
				  <td><input type="text" name="psts[uh_message]" id="uh_message" value="<?php 
        echo esc_attr($psts->get_setting('uh_message'));
        ?>
" style="width: 95%" />
				  <br /><?php 
        _e('Required - This message is displayed on the post/page screen for sites that don\'t have unfiltered html permissions upon the saving of a post. "LEVEL" will be replaced with the needed level name.', 'psts');
        ?>
</td>
				  </tr>
			  </table>
		  </div>
		</div>
	  <?php 
    }
    function message()
    {
        global $psts, $current_screen, $blog_id;
        if (is_pro_site(false, $psts->get_setting('uh_level', 1)) || $this->ads_unfilter()) {
            return;
        }
        if (in_array($current_screen->id, array('edit-page', 'page', 'edit-post', 'post')) && isset($_GET['message'])) {
            $notice = str_replace('LEVEL', $psts->get_level_setting($psts->get_setting('uh_level', 1), 'name'), $psts->get_setting('uh_message'));
            echo '<div class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $notice . '</a></p></div>';
        }
    }
}
//register the module
psts_register_module('ProSites_Module_UnfilterHtml', __('Unfilter HTML', 'psts'), __('Allows you provide the "unfiltered_html" permission to specific user types for selected Pro Site levels.', 'psts'));
示例#12
0
                    $class = 'alternate' == $class ? '' : 'alternate';
                    //=========================================================//
                }
                ?>
						</tbody>
						</table></p>
						<?php 
                if ($upgrade_credits > 0) {
                    ?>
	          <p class="submit">
	          <input type="submit" id="submit_process" name="submit_process" value="<?php 
                    _e('Upgrade Sites', 'psts');
                    ?>
 &raquo;" />
	          </p>
						<?php 
                }
                ?>
		      </div>
		    </div>
        <?php 
            }
            ?>
      <?php 
        }
        echo '</form></div></div>';
    }
}
//register the module
psts_register_module('ProSites_Module_BulkUpgrades', __('Bulk Upgrades', 'psts'), __('Allows you to sell Pro Site level upgrades in bulk packages.', 'psts'));
示例#13
0
	  <?php 
        //show feature message
        if (!is_pro_site(false, $psts->get_setting('ps_level', 1))) {
            $notice = str_replace('LEVEL', $psts->get_level_setting($psts->get_setting('ps_level', 1), 'name'), $psts->get_setting('ps_notice'));
            echo '<div class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $notice . '</a></p></div>';
            $disabled = ' disabled="disabled"';
        }
        ?>
	  <form method="post" action="">
	  <textarea name="support-message" type="text" rows="10" wrap="soft" id="support-message" style="width: 100%"<?php 
        echo $disabled;
        ?>
></textarea>

	  <p class="submit">
	    <input type="submit" value="<?php 
        _e('Submit Request &raquo;', 'psts');
        ?>
"<?php 
        echo $disabled;
        ?>
 />
	  </p>
	  </form>
	  </div>
	  <?php 
    }
}
//register the module
psts_register_module('ProSites_Module_Support', __('Premium Support', 'psts'), __('Allows you to provide a premium direct to email support page for selected Pro Site levels.', 'psts'));
示例#14
0
文件: write.php 项目: hscale/webento
" style="width: 95%" />
				  <br /><?php 
        _e('Required - This message is displayed on the page screen for sites that don\'t have permissions. "LEVEL" will be replaced with the needed level name.', 'psts');
        ?>
</td>
				  </tr>
			  </table>
		  </div>
		</div>
	  <?php 
    }
    function message()
    {
        global $psts, $current_screen, $blog_id;
        if (is_pro_site(false, $psts->get_setting('publishing_level', 1))) {
            return;
        }
        if ($psts->get_setting('publishing_posts') && in_array($current_screen->id, array('edit-post', 'post'))) {
            $notice = str_replace('LEVEL', $psts->get_level_setting($psts->get_setting('publishing_level', 1), 'name'), $psts->get_setting('publishing_message_posts'));
            echo '<div class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $notice . '</a></p></div>';
        } else {
            if ($psts->get_setting('publishing_pages') && in_array($current_screen->id, array('edit-page', 'page'))) {
                $notice = str_replace('LEVEL', $psts->get_level_setting($psts->get_setting('publishing_level', 1), 'name'), $psts->get_setting('publishing_message_pages'));
                echo '<div class="error"><p><a href="' . $psts->checkout_url($blog_id) . '">' . $notice . '</a></p></div>';
            }
        }
    }
}
//register the module
psts_register_module('ProSites_Module_Writing', __('Limit Publishing', 'psts'), __('Allows you to only enable writing posts and/or pages for selected Pro Site levels.', 'psts'));
示例#15
0
文件: ads.php 项目: hscale/webento
                ?>
 &raquo;" />
	          </p>
		      </div>
		    </div>
		    <?php 
            }
            ?>
		    
      <?php 
        }
        echo '</div></form></div>';
    }
}
//register the module
psts_register_module('ProSites_Module_Ads', __('Advertising', 'psts'), __('Allows you to disable ads for a Pro Site level, or give a Pro Site level the ability to disable ads on a number of other sites.', 'psts'));
/* Ads functions used by other plugins */
function psts_show_ads($blog_id = null)
{
    global $ProSites_Module_Ads;
    if (isset($ProSites_Module_Ads) && is_object($ProSites_Module_Ads)) {
        return $ProSites_Module_Ads->show_ads($blog_id);
    } else {
        return true;
    }
}
function psts_hide_ads($blog_id = null)
{
    global $ProSites_Module_Ads;
    if (isset($ProSites_Module_Ads) && is_object($ProSites_Module_Ads)) {
        return $ProSites_Module_Ads->hide_ads($blog_id);