示例#1
0
 function ads_xmlrpc()
 {
     global $psts;
     if (function_exists('psts_hide_ads') && $psts->get_setting('ads_xmlrpc') && psts_hide_ads()) {
         return true;
     } else {
         return false;
     }
 }
示例#2
0
文件: quota.php 项目: hscale/webento
 function filter($space)
 {
     global $psts;
     //don't filter on network settings page to avoid confusion
     if (is_network_admin()) {
         return $space;
     }
     $quota = $psts->get_level_setting($psts->get_level(), 'quota');
     if ($quota && is_pro_site(false, $psts->get_level())) {
         return $quota;
     } else {
         if (function_exists('psts_hide_ads') && psts_hide_ads() && ($quota = $psts->get_setting("quota_upgraded_space"))) {
             return $quota;
         } else {
             return $space;
         }
     }
 }
示例#3
0
 function add_menu_admin_bar()
 {
     global $wp_admin_bar, $blog_id, $wp_version;
     if (is_main_site() || !is_admin_bar_showing() || !is_user_logged_in()) {
         return;
     }
     //add user admin bar upgrade button
     if (!$this->get_setting('hide_adminbar')) {
         if (current_user_can('edit_pages')) {
             $checkout = $this->checkout_url($blog_id);
         } else {
             $checkout = $this->checkout_url();
         }
         $label = is_pro_site() ? $this->get_setting('lbl_curr') : $this->get_setting('lbl_signup');
         $label = '<span>' . esc_attr($label) . '</span>';
         $wp_admin_bar->add_menu(array('id' => 'pro-site', 'parent' => version_compare($wp_version, '3.3', '>=') ? 'top-secondary' : false, 'title' => $label, 'href' => $checkout));
     }
     //add superadmin status menu
     if (is_super_admin() && !$this->get_setting('hide_adminbar_super')) {
         $sup_title = is_pro_site() ? $this->get_level_setting($this->get_level($blog_id), 'name') : false;
         if (!$sup_title) {
             $sup_title = function_exists('psts_hide_ads') && psts_hide_ads($blog_id) ? __('Upgraded', 'psts') : __('Free', 'psts');
         }
         $expire = $this->get_expire($blog_id);
         if ($expire > 2147483647) {
             $expire = __("Permanent", "psts");
         } else {
             $expire = $expire ? date("Y-m-d", $expire) : __("N/A", "psts");
         }
         $sup_title .= " [{$expire}]";
         $wp_admin_bar->add_menu(array('title' => $sup_title, 'href' => network_admin_url('admin.php?page=psts&bid=' . $blog_id), 'parent' => false, 'id' => 'psts-status'));
     }
 }
示例#4
0
function supporter_ads_check($blog_id = null)
{
    return psts_hide_ads($blog_id);
}