• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP membership_db_prefix函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中membership_db_prefix函数的典型用法代码示例。如果您正苦于以下问题:PHP membership_db_prefix函数的具体用法?PHP membership_db_prefix怎么用?PHP membership_db_prefix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了membership_db_prefix函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 function __construct()
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     add_action('plugins_loaded', array(&$this, 'load_textdomain'));
     // Set up Actions
     add_action('init', array(&$this, 'initialise_plugin'), 1);
     add_filter('query_vars', array(&$this, 'add_queryvars'));
     add_action('generate_rewrite_rules', array(&$this, 'add_rewrites'));
     // Add protection
     add_action('parse_request', array(&$this, 'initialise_membership_protection'), 2);
     // Download protection
     add_action('pre_get_posts', array(&$this, 'handle_download_protection'), 3);
     // Payment return
     add_action('pre_get_posts', array(&$this, 'handle_paymentgateways'), 1);
     // add feed protection
     add_filter('feed_link', array(&$this, 'add_feed_key'), 99, 2);
     // Register
     add_filter('register', array(&$this, 'override_register'));
     // Ultimate Facebook Compatibility
     add_filter('wdfb_registration_redirect_url', array(&$this, 'wdfb_registration_redirect_url'));
     // Level shortcodes filters
     add_filter('membership_level_shortcodes', array(&$this, 'build_level_shortcode_list'));
     add_filter('membership_not_level_shortcodes', array(&$this, 'build_not_level_shortcode_list'));
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:28,代码来源:membershippublic.php


示例2: __construct

 function __construct($id = false, &$tips = false)
 {
     global $wpdb, $site_id;
     $this->db = $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     // If we're constructing before the tables exist, just exit.
     $table = membership_db_prefix($this->db, 'coupons');
     if ($this->db->get_var("SHOW TABLES LIKE '{$table}'") != $table) {
         return;
     }
     // If we are passing a non numeric ID we should try to find the ID by searching for the coupon name instead.
     if (!is_numeric($id)) {
         $search = $this->db->get_var($this->db->prepare("SELECT id FROM {$this->coupons} WHERE couponcode = %s", strtoupper($id)));
         if (!empty($search)) {
             $this->id = $search;
         }
     } else {
         $this->id = $id;
     }
     if ($tips !== false) {
         $this->_tips = $tips;
     }
     // Get the coupon for further usage
     $this->_coupon = $this->get_coupon();
 }
开发者ID:vilmark,项目名称:vilmark_main,代码行数:27,代码来源:class.coupon.php


示例3: __construct

 function __construct($id = false)
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     $this->id = $id;
 }
开发者ID:hscale,项目名称:webento,代码行数:9,代码来源:class.urlgroup.php


示例4: __construct

 function __construct()
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     add_action('add_admin_bar_menus', array(&$this, 'add_admin_bar_items'));
     add_action('membership_dashboard_membershipuselevel', array(&$this, 'switch_membership_level'));
 }
开发者ID:shimion,项目名称:member-BMH-,代码行数:10,代码来源:class.adminbar.php


示例5: __construct

 function __construct($id = false, $fullload = false, $loadtype = array('public', 'core'))
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     $this->id = $id;
     if ($fullload) {
         $this->load_rules($loadtype);
     }
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:12,代码来源:class.level.php


示例6: M_Gateway

 function M_Gateway()
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     // Actions and Filters
     add_filter('M_gateways_list', array(&$this, 'gateways_list'));
     add_action('membership_process_payment_return', array(&$this, 'process_payment_return'));
     add_action('membership_record_user_gateway', array(&$this, 'record_user_gateway'));
 }
开发者ID:shimion,项目名称:member-BMH-,代码行数:12,代码来源:class.gateway.php


示例7: __construct

 function __construct()
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     // Set up Actions
     add_action('init', array(&$this, 'set_up_schedule'));
     add_filter('cron_schedules', array(&$this, 'add_time_period'));
     if (!$this->get_expiring_relationships_count() >= 50) {
         // Schedule for quarter hourly to get number of processing down a bit
         add_action('membership_process_quarterhourly_cron', array(&$this, 'transition_user_through_subscriptions'));
     } else {
         // We don't have that many, so let's process hourly instead
         add_action('membership_process_hourly_cron', array(&$this, 'transition_user_through_subscriptions'));
     }
 }
开发者ID:EdoMagen,项目名称:project-s-v2,代码行数:18,代码来源:membershipcron.php


示例8: __construct

 function __construct($id = false, &$tips = false)
 {
     global $wpdb;
     $this->db =& $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     // If we are passing a non numeric ID we should try to find the ID by searching for the coupon name instead.
     if (!is_numeric($id)) {
         $search = $this->db->get_var($this->db->prepare("SELECT * FROM {$this->coupons} WHERE `couponcode` = %s", $id));
         if (!empty($search)) {
             $this->id = $search;
         }
     } else {
         $this->id = $id;
     }
     if ($tips !== false) {
         $this->_tips = $tips;
     }
 }
开发者ID:hscale,项目名称:webento,代码行数:20,代码来源:class.coupon.php


示例9: __construct

 public function __construct($id = false, $fullload = false, $loadtype = array('public', 'core'))
 {
     global $wpdb, $M_options;
     $this->id = $id;
     $this->db = $wpdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     if (is_null($this->active)) {
         //only run if hasn't been run before
         //check if this level is active - if it isn't we don't want to load it's rules
         $this->active = (bool) $wpdb->get_var($wpdb->prepare("\n\t\t\t\tSELECT level_active\n\t\t\t\tFROM {$this->membership_levels}\n\t\t\t\tWHERE level_active = 1\n\t\t\t\t\tAND id = %d", $this->id));
     }
     $allow_page_cascade = isset($M_options['allow_page_rule_cascade']) ? $M_options['allow_page_rule_cascade'] : 'yes';
     $this->allow_page_cascade = 'yes' == $allow_page_cascade ? true : false;
     if ($fullload && $this->active) {
         $this->load_rules($loadtype);
     }
     add_action('remove_this_level_members', 'remove_level_members', 10, 1);
 }
开发者ID:vilmark,项目名称:vilmark_main,代码行数:20,代码来源:Level.php


示例10: __construct

 function __construct()
 {
     global $nxtdb;
     $this->db =& $nxtdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     // Add administration actions
     add_action('init', array(&$this, 'initialise_plugin'), 1);
     // Add in admin area membership levels
     add_action('init', array(&$this, 'initialise_membership_protection'), 999);
     add_action('admin_menu', array(&$this, 'add_admin_menu'));
     add_action('plugins_loaded', array(&$this, 'load_textdomain'));
     // Header actions
     add_action('load-toplevel_page_membership', array(&$this, 'add_admin_header_membership'));
     add_action('load-membership_page_members', array(&$this, 'add_admin_header_members'));
     add_action('load-membership_page_membershiplevels', array(&$this, 'add_admin_header_membershiplevels'));
     add_action('load-membership_page_membershipsubs', array(&$this, 'add_admin_header_membershipsubs'));
     add_action('load-membership_page_membershipgateways', array(&$this, 'add_admin_header_membershipgateways'));
     add_action('load-membership_page_membershipoptions', array(&$this, 'add_admin_header_membershipoptions'));
     add_action('load-membership_page_membershipurlgroups', array(&$this, 'add_admin_header_membershipurlgroups'));
     add_action('load-membership_page_membershippings', array(&$this, 'add_admin_header_membershippings'));
     add_action('load-users_page_membershipuser', array(&$this, 'add_admin_header_membershipuser'));
     add_filter('membership_level_sections', array(&$this, 'default_membership_sections'));
     // Media management additional fields
     add_filter('attachment_fields_to_edit', array(&$this, 'add_media_protection_settings'), 99, 2);
     add_filter('attachment_fields_to_save', array(&$this, 'save_media_protection_settings'), 99, 2);
     // rewrites
     add_action('generate_rewrite_rules', array(&$this, 'add_rewrites'));
     add_filter('query_vars', array(&$this, 'add_queryvars'));
     // profile field for feeds
     add_action('show_user_profile', array(&$this, 'add_profile_feed_key'));
     // Pings
     add_action('membership_subscription_form_after_levels', array(&$this, 'show_subscription_ping_information'));
     add_action('membership_subscription_add', array(&$this, 'update_subscription_ping_information'));
     add_action('membership_subscription_update', array(&$this, 'update_subscription_ping_information'));
     add_action('membership_level_form_after_rules', array(&$this, 'show_level_ping_information'));
     add_action('membership_level_add', array(&$this, 'update_level_ping_information'));
     add_action('membership_level_update', array(&$this, 'update_level_ping_information'));
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:40,代码来源:membershipadmin.php


示例11: __construct

 function __construct()
 {
     global $nxtdb;
     $this->db =& $nxtdb;
     foreach ($this->tables as $table) {
         $this->{$table} = membership_db_prefix($this->db, $table);
     }
     add_action('plugins_loaded', array(&$this, 'load_textdomain'));
     // Set up Actions
     add_action('init', array(&$this, 'initialise_plugin'), 1);
     add_filter('query_vars', array(&$this, 'add_queryvars'));
     add_action('generate_rewrite_rules', array(&$this, 'add_rewrites'));
     // Add protection
     add_action('parse_request', array(&$this, 'initialise_membership_protection'), 2);
     // Download protection
     add_action('pre_get_posts', array(&$this, 'handle_download_protection'), 3);
     // Payment return
     add_action('pre_get_posts', array(&$this, 'handle_paymentgateways'), 1);
     // add feed protection
     add_filter('feed_link', array(&$this, 'add_feed_key'), 99, 2);
     // Register
     add_filter('register', array(&$this, 'override_register'));
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:23,代码来源:membershippublic.php


示例12: membership_news_stream

function membership_news_stream()
{
    global $wpdb;
    $table = membership_db_prefix($wpdb, 'membership_news');
    // Superfluous prepare, but do it anyway
    $news = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$table} ORDER BY newsdate DESC LIMIT %d, %d", 0, 50));
    ?>

	<div class="postbox " id="dashboard_news">
		<h3 class="hndle"><span><?php 
    _e('News', 'membership');
    ?>
</span></h3>
		<div class="inside">
			<?php 
    if (!empty($news)) {
        foreach ($news as $key => $newsitem) {
            echo "<p id='newsitem-" . $newsitem->id . "'>";
            echo "[ ";
            echo date("Y-m-d : H:i", strtotime($newsitem->newsdate));
            echo " ] ";
            echo $newsitem->newsitem;
            echo "</p>";
        }
    } else {
        echo "<p>" . __('There will be some interesting news here when your site gets going.', 'membership') . "</p>";
    }
    ?>
			<br class="clear">
		</div>
	</div>

	<?php 
}
开发者ID:klgrimley,项目名称:mzf,代码行数:34,代码来源:newsstream.php


示例13: M_build_database_structure

function M_build_database_structure()
{
    global $wpdb;
    $bi = 'bigint(20)';
    $biu = 'bigint(20) unsigned';
    $bi11 = 'bigint(11)';
    $bi35 = 'bigint(35)';
    $i = 'int(11)';
    $v1 = 'varchar(1)';
    $v5 = 'varchar(5)';
    $v10 = 'varchar(10)';
    $v30 = 'varchar(30)';
    $v35 = 'varchar(35)';
    $v50 = 'varchar(50)';
    $v20 = 'varchar(20)';
    $v200 = 'varchar(200)';
    $v250 = 'varchar(250)';
    $t = 'text';
    $jd = 'date';
    $d = 'datetime';
    $ts = 'timestamp';
    $dc = 'decimal(11,2)';
    $structure = array(membership_db_prefix($wpdb, 'membership_levels') => array('id' => $bi, 'level_title' => $v250, 'level_slug' => $v250, 'level_active' => $i, 'level_count' => $bi), membership_db_prefix($wpdb, 'membership_relationships') => array('rel_id' => $bi, 'user_id' => $bi, 'sub_id' => $bi, 'level_id' => $bi, 'startdate' => $d, 'updateddate' => $d, 'expirydate' => $d, 'order_instance' => $bi, 'usinggateway' => $v50), membership_db_prefix($wpdb, 'membership_rules') => array('level_id' => $bi, 'rule_ive' => $v20, 'rule_area' => $v20, 'rule_value' => $t, 'rule_order' => $i), membership_db_prefix($wpdb, 'subscriptions') => array('id' => $bi, 'sub_name' => $v200, 'sub_active' => $i, 'sub_public' => $i, 'sub_count' => $bi, 'sub_description' => $t, 'sub_pricetext' => $v200), membership_db_prefix($wpdb, 'subscriptions_levels') => array('sub_id' => $bi, 'level_id' => $bi, 'level_period' => $i, 'sub_type' => $v20, 'level_price' => $dc, 'level_currency' => $v5, 'level_order' => $bi, 'level_period_unit' => $v1), membership_db_prefix($wpdb, 'subscription_transaction') => array('transaction_ID' => $biu, 'transaction_subscription_ID' => $bi, 'transaction_user_ID' => $bi, 'transaction_sub_ID' => $bi, 'transaction_paypal_ID' => $v30, 'transaction_payment_type' => $v20, 'transaction_stamp' => $bi35, 'transaction_total_amount' => $bi, 'transaction_currency' => $v35, 'transaction_duedate' => $jd, 'transaction_gateway' => $v50, 'transaction_note' => $t, 'transaction_expires' => $d), membership_db_prefix($wpdb, 'urlgroups') => array('id' => $bi, 'groupname' => $v250, 'groupurls' => $t, 'isregexp' => $i, 'stripquerystring' => $i), membership_db_prefix($wpdb, 'communications') => array('id' => $bi11, 'subject' => $v250, 'message' => $t, 'periodunit' => $i, 'periodtype' => $v5, 'periodprepost' => $v5, 'lastupdated' => $ts, 'active' => $i, 'periodstamp' => $bi), membership_db_prefix($wpdb, 'pings') => array('id' => $bi, 'pingname' => $v250, 'pingurl' => $v250, 'pinginfo' => $t, 'pingtype' => $v10), membership_db_prefix($wpdb, 'ping_history') => array('id' => $bi, 'ping_id' => $bi, 'ping_sent' => $ts, 'ping_info' => $t, 'ping_return' => $t), membership_db_prefix($wpdb, 'levelmeta') => array('id' => $bi, 'level_id' => $bi, 'meta_key' => $v250, 'meta_value' => $t, 'meta_stamp' => $ts), membership_db_prefix($wpdb, 'subscriptionmeta') => array('id' => $bi, 'sub_id' => $bi, 'meta_key' => $v250, 'meta_value' => $t, 'meta_stamp' => $ts), membership_db_prefix($wpdb, 'member_payments') => array('id' => $bi11, 'member_id' => $bi, 'sub_id' => $bi, 'level_id' => $bi, 'level_order' => $i, 'paymentmade' => $d, 'paymentexpires' => $d), membership_db_prefix($wpdb, 'coupons') => array('id' => $biu, 'site_id' => $bi, 'couponcode' => $v250, 'discount' => $dc, 'discount_type' => $v5, 'discount_currency' => $v5, 'coupon_startdate' => $d, 'coupon_enddate' => $d, 'coupon_sub_id' => $bi, 'coupon_uses' => $i, 'coupon_used' => $i, 'coupon_apply_to' => $v20));
    return $structure;
}
开发者ID:shimion,项目名称:member-BMH-,代码行数:25,代码来源:upgrade.php


示例14: prepare_query

 function prepare_query()
 {
     global $wpdb, $wp_version;
     $this->first_user = ($this->page - 1) * $this->users_per_page;
     $this->query_limit = $wpdb->prepare(" LIMIT %d, %d", $this->first_user, $this->users_per_page);
     $this->query_orderby = ' ORDER BY user_login';
     $search_sql = '';
     if ($this->search_term) {
         $searches = array();
         $search_sql = 'AND (';
         foreach (array('user_login', 'user_nicename', 'user_email', 'user_url', 'display_name') as $col) {
             $searches[] = $col . " LIKE '%{$this->search_term}%'";
         }
         $search_sql .= implode(' OR ', $searches);
         $search_sql .= ')';
     }
     // The following code changes in WP3 and above
     // We are on version 3.0 or above
     $this->query_from = " FROM {$wpdb->users}";
     $this->query_where = " WHERE 1=1 {$search_sql}";
     if ($this->role) {
         $this->query_from .= " INNER JOIN {$wpdb->usermeta} ON {$wpdb->users}.ID = {$wpdb->usermeta}.user_id";
         $this->query_where .= $wpdb->prepare(" AND {$wpdb->usermeta}.meta_key = '{$wpdb->prefix}capabilities' AND {$wpdb->usermeta}.meta_value LIKE %s", '%' . $this->role . '%');
     } elseif (is_multisite()) {
         $level_key = $wpdb->prefix . 'capabilities';
         // wpmu site admins don't have user_levels
         $this->query_from .= ", {$wpdb->usermeta}";
         $this->query_where .= " AND {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$level_key}'";
     }
     if ($this->sub_id) {
         $sql = $wpdb->prepare("SELECT user_id FROM " . membership_db_prefix($wpdb, "membership_relationships") . " WHERE sub_id = %d", $this->sub_id);
         $subs = $wpdb->get_col($sql);
         if (!empty($subs)) {
             $this->query_where .= " AND {$wpdb->users}.ID IN (" . implode(',', $subs) . ")";
             // wp 2.9.2 and lower
             $this->query_from_where .= " AND {$wpdb->users}.ID IN (" . implode(',', $subs) . ")";
         } else {
             $this->query_where .= " AND {$wpdb->users}.ID IN (0)";
             // wp 2.9.2 and lower
             $this->query_from_where .= " AND {$wpdb->users}.ID IN (0)";
         }
     }
     if ($this->level_id) {
         $sql = $wpdb->prepare("SELECT user_id FROM " . membership_db_prefix($wpdb, "membership_relationships") . " WHERE level_id = %d", $this->level_id);
         $levels = $wpdb->get_col($sql);
         if (!empty($levels)) {
             $this->query_where .= " AND {$wpdb->users}.ID IN (" . implode(',', $levels) . ")";
             // wp 2.9.2 and lower
             $this->query_from_where .= " AND {$wpdb->users}.ID IN (" . implode(',', $levels) . ")";
         } else {
             $this->query_where .= " AND {$wpdb->users}.ID IN (0)";
             // wp 2.9.2 and lower
             $this->query_from_where .= " AND {$wpdb->users}.ID IN (0)";
         }
     }
     if ($this->active) {
         $sql = $wpdb->prepare("SELECT user_id FROM " . $wpdb->usermeta . " WHERE meta_key = '" . membership_db_prefix($wpdb, 'membership_active', false) . "' AND meta_value = 'no'");
         $actives = $wpdb->get_col($sql);
         if (!empty($actives)) {
             if ($this->active == 'yes') {
                 $this->query_where .= " AND {$wpdb->users}.ID NOT IN (" . implode(',', $actives) . ")";
                 // wp 2.9.2 and lower
                 $this->query_from_where .= " AND {$wpdb->users}.ID NOT IN (" . implode(',', $actives) . ")";
             } else {
                 // no
                 $this->query_where .= " AND {$wpdb->users}.ID IN (" . implode(',', $actives) . ")";
                 // wp 2.9.2 and lower
                 $this->query_from_where .= " AND {$wpdb->users}.ID IN (" . implode(',', $actives) . ")";
             }
         } else {
             if ($this->active == 'yes') {
                 $this->query_where .= " AND {$wpdb->users}.ID NOT IN (0)";
                 // wp 2.9.2 and lower
                 $this->query_from_where .= " AND {$wpdb->users}.ID NOT IN (0)";
             } else {
                 // no
                 $this->query_where .= " AND {$wpdb->users}.ID IN (0)";
                 // wp 2.9.2 and lower
                 $this->query_from_where .= " AND {$wpdb->users}.ID IN (0)";
             }
         }
     }
     do_action_ref_array('pre_user_search', array(&$this));
 }
开发者ID:hscale,项目名称:webento,代码行数:84,代码来源:class.membersearch.php


示例15: get_subscriptions

 function get_subscriptions()
 {
     global $wpdb;
     return $wpdb->get_results("SELECT * FROM " . membership_db_prefix($wpdb, 'subscriptions') . " WHERE sub_active = 1");
 }
开发者ID:vilmark,项目名称:vilmark_main,代码行数:5,代码来源:member.widget.php


示例16: deactivate

 function deactivate()
 {
     update_user_meta($this->ID, membership_db_prefix($this->db, 'membership_active', false), 'no');
 }
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:4,代码来源:class.membership.php


示例17: get_last_transaction_for_user_and_sub

function get_last_transaction_for_user_and_sub($user_id, $sub_id)
{
    global $wpdb;
    $sql = $wpdb->prepare("SELECT * FROM " . membership_db_prefix($wpdb, 'subscription_transaction') . " WHERE transaction_user_ID = %d and transaction_subscription_ID = %d ORDER BY transaction_stamp DESC LIMIT 0,1", $user_id, $sub_id);
    return $wpdb->get_row($sql);
}
开发者ID:hscale,项目名称:webento,代码行数:6,代码来源:functions.php


示例18: the_targets

 /**
  * Get target groups
  **/
 function the_targets($single_list_echo = 1, $groups = 1, $roles = 1, $membership = 1)
 {
     global $wpdb;
     $targets = array();
     if ($groups) {
         $groups = $this->get_groups();
         foreach ($groups as $group) {
             $count = count($this->get_members_of_group($group['group_id'], '', 1));
             if ($count) {
                 $targets['groups']['name'] = __('eNewsletter Groups', 'email-newsletter');
                 $targets['groups'][] = '<label><input type="checkbox" name="target[groups][]" value="' . $group['group_id'] . '"> ' . $group['group_name'] . ' (' . $count . ')</input></label>';
             }
         }
     }
     if ($membership) {
         if (class_exists('MS_Plugin')) {
             // Support for the Membership 2 plugin.
             $api = MS_Plugin::$api;
             $memberships = $api->list_memberships();
             if (count($memberships)) {
                 $targets['m2'] = array();
                 $targets['m2']['name'] = __('Membership 2 Subscribers', 'email-newsletter');
                 foreach ($memberships as $membership) {
                     $count = $this->get_members_of_membership2($membership->id, 1);
                     $targets['m2'][] = sprintf('<label><input type="checkbox" name="target[m2][]" value="%2$s" /> %1$s (%3$s)</label>', $membership->name, $membership->id, $count);
                 }
             }
         } elseif (function_exists('membership_db_prefix')) {
             // Support for old Membership1 plugin (deprecated).
             $prefix = membership_db_prefix($wpdb, 'membership_levels');
             $membership_levels = $wpdb->get_results("SELECT * FROM {$prefix} WHERE level_active = 1", "ARRAY_A");
             foreach ($membership_levels as $membership_level) {
                 $count = $this->get_members_of_membership($membership_level, 1);
                 if ($count) {
                     $targets['membership_levels']['name'] = __('Membership Plugin Levels', 'email-newsletter');
                     $targets['membership_levels'][] = '<label><input type="checkbox" name="target[membership_levels][]" value="' . $membership_level['id'] . '"> ' . $membership_level['level_title'] . ' (' . $count . ')</input></label>';
                 }
             }
         }
     }
     if (1 == $wpdb->blogid && class_exists('ProSites') && 0 == 1) {
         $psts_levels = get_site_option('psts_levels');
         foreach ($psts_levels as $psts_level_id => $psts_level) {
             $targets['psts_levels'][] = '<label><input type="checkbox" name="target[prosite_levels][]" value="' . $psts_level_id . '"> ' . $psts_level['name'] . '</input></label>';
         }
     }
     if ($roles) {
         $roles = $this->get_roles();
         foreach ($roles as $role_id => $role) {
             $targets['roles']['name'] = __('WordPress User Roles', 'email-newsletter');
             $targets['roles'][] = '<label><input type="checkbox" name="target[roles][]" value="' . $role_id . '"> ' . $role['name'] . '</input></label>';
         }
     }
     if (1 == $wpdb->blogid && function_exists('is_multisite') && is_multisite()) {
         $count = $this->get_global_wp_user_ids();
         $count = count($count);
         if ($count) {
             $targets['site_admins'][] = '<label><input type="checkbox" name="target[site_admins]" value="yes"> <strong>' . __('Admins of all sites', 'email-newsletter') . '</strong> (' . $count . ')</input></label>';
         }
     }
     if ($single_list_echo) {
         foreach ($targets as $type) {
             if (isset($type['name'])) {
                 $type['name'] = '<strong>' . $type['name'] . ':</strong>';
             }
             $targets_echo[] = implode('<br/>', $type);
         }
         echo implode('<br/><br/>', $targets_echo);
     } else {
         return $targets;
     }
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:75,代码来源:class.functions.php


示例19: get_groups

 function get_groups()
 {
     global $wpdb;
     $sql = $wpdb->prepare("SELECT * FROM " . membership_db_prefix($wpdb, 'urlgroups') . " WHERE groupname NOT LIKE (%s) ORDER BY id ASC", '\\_%');
     $results = $wpdb->get_results($sql);
     if (!empty($results)) {
         return $results;
     } else {
         return false;
     }
 }
开发者ID:hscale,项目名称:webento,代码行数:11,代码来源:default.rules.php


示例20: membership_exclude_inactive_users

function membership_exclude_inactive_users($bp_user_query)
{
    global $wpdb;
    if (Membership_Plugin::is_enabled()) {
        $query = new WP_User_Query(array('meta_key' => membership_db_prefix($wpdb, 'membership_active', false), 'meta_value' => 'no', 'meta_compare' => '='));
        if ($query->get_total() > 0) {
            $bp_user_query->query_vars['exclude'] = wp_list_pluck($query->get_results(), 'ID');
        }
    }
}
开发者ID:vilmark,项目名称:vilmark_main,代码行数:10,代码来源:functions.php



注:本文中的membership_db_prefix函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP memcache_add函数代码示例发布时间:2022-05-15
下一篇:
PHP members_is_role_editable函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap