|
论坛根目录新建一个php文件并粘贴以下代码即可:
- <?php
- require './source/class/class_core.php';
- $discuz = C::app();
- $discuz->init();
- $invite = array(
- 'uid' => 1, //邀请码生成者UID
- 'code' => rand(100,999).rand(100,999).rand(100,999).rand(100,999), //邀请码
- 'fuid' => 0, //邀请码使用者UID
- 'fusername' => '', //邀请码使用者用户名
- 'type' => 0, //邮件邀请 1是0否
- 'inviteip' => $_G['clientip'], //邀请IP
- 'appid' => 0, //应用ID(固定为0)
- 'dateline' => TIMESTAMP, //邀请码生成时间
- 'endtime' => TIMESTAMP+3600, //邀请码过期时间
- 'regdateline' => 0, //邀请码使用时间
- 'status' => 1, //邀请码状态 1未使用 2已使用
- 'orderid' => '', //邀请码订单ID(留空)
-
- );
- C::t('common_invite')->insert($invite);
- showmessage('您获得的邀请码:{code} 有效期1小时',array(),$invite,array('alert'=>'right'));
- ?>
复制代码
|
|