当前位置: 首页>>代码示例>>PHP>>正文


PHP SwpmUtils::is_paid_registration方法代码示例

本文整理汇总了PHP中SwpmUtils::is_paid_registration方法的典型用法代码示例。如果您正苦于以下问题:PHP SwpmUtils::is_paid_registration方法的具体用法?PHP SwpmUtils::is_paid_registration怎么用?PHP SwpmUtils::is_paid_registration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SwpmUtils的用法示例。


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

示例1: create_swpm_user

 private function create_swpm_user()
 {
     global $wpdb;
     $member = SwpmTransfer::$default_fields;
     $form = new SwpmFrontForm($member);
     if (!$form->is_valid()) {
         $message = array('succeeded' => false, 'message' => SwpmUtils::_('Please correct the following'), 'extra' => $form->get_errors());
         SwpmTransfer::get_instance()->set('status', $message);
         return false;
     }
     $member_info = $form->get_sanitized();
     $free_level = SwpmUtils::get_free_level();
     $account_status = SwpmSettings::get_instance()->get_value('default-account-status', 'active');
     $member_info['last_accessed_from_ip'] = SwpmUtils::get_user_ip_address();
     $member_info['member_since'] = date("Y-m-d");
     $member_info['subscription_starts'] = date("Y-m-d");
     $member_info['account_state'] = $account_status;
     $plain_password = $member_info['plain_password'];
     unset($member_info['plain_password']);
     if (SwpmUtils::is_paid_registration()) {
         $member_info['reg_code'] = '';
         $member_id = filter_input(INPUT_GET, 'member_id', FILTER_SANITIZE_NUMBER_INT);
         $code = filter_input(INPUT_GET, 'code', FILTER_SANITIZE_STRING);
         $wpdb->update($wpdb->prefix . "swpm_members_tbl", $member_info, array('member_id' => $member_id, 'reg_code' => $code));
         $query = $wpdb->prepare('SELECT membership_level FROM ' . $wpdb->prefix . 'swpm_members_tbl WHERE member_id=%d', $member_id);
         $member_info['membership_level'] = $wpdb->get_var($query);
         $last_insert_id = $member_id;
     } else {
         if (!empty($free_level)) {
             $member_info['membership_level'] = $free_level;
             $wpdb->insert($wpdb->prefix . "swpm_members_tbl", $member_info);
             $last_insert_id = $wpdb->insert_id;
         } else {
             $message = array('succeeded' => false, 'message' => SwpmUtils::_('Membership Level Couldn\'t be found.'));
             SwpmTransfer::get_instance()->set('status', $message);
             return false;
         }
     }
     $member_info['plain_password'] = $plain_password;
     $this->member_info = $member_info;
     return true;
 }
开发者ID:andrewfieldwmg,项目名称:greenschoolsproject,代码行数:42,代码来源:class.swpm-front-registration.php


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