迅睿CMS框架是一款PHP8高性能·简单易用的CMS开源开发框架,基于MIT开源许可协议发布,免费且不限制商业使用,是免费开源的产品,以万端互联为设计理念,支持的微信公众号、小程序、APP客户端、移动端网站、PC网站等多终端式管理系统。
联系官方销售客服
1835022288
028-61286886
请问个人空间如何在用户注册时自动开通呀!https://www.xunruicms.com/shop/app/344.html
插件名称:个人空间
\Phpcmf\Hooks::on('member_register_after', function($data) { //var_dump($data['username']); $catid = 1;// 栏目id \Phpcmf\Service::C()->_module_init('zone'); $save = [1 => [], 0 => []]; $save[1]['uid'] = $data['id']; $save[1]['title'] = $data['username']; $save[1]['author'] = $data['username']; $save[1]['url'] = ''; $save[1]['status'] = 9; //9表示正常发布,1表示审核里面 $save[1]['hits'] = 0; $save[1]['displayorder'] = 0; $save[1]['link_id'] = 0; $save[1]['comments'] = 0; $save[1]['avgsort'] = 0; $save[1]['inputtime'] = $save[1]['updatetime'] = SYS_TIME + rand(0, 7200); $save[1]['inputip'] = '127.0.0.1'; $save[0]['catid'] = $save[1]['catid'] = $catid; $save[0]['uid'] = $data['id']; $save[0]['content'] = '默认内容'; $rt = \Phpcmf\Service::C()->content_model->save(0, $save); if ($rt['code']) { //exit('成功'); } else { //exit('失败'); } });