今天解决Diccuz制定uid直接登录问题,顺手记录下:

    根据登录部分的关键代码,实现制定uid直接登录Discuz:

    1、/discuz/source/function/function_core.php 调用function_core.php中(line:70) 的如下代码:

getuserbyuid($uid, $fetch_archive = 0)

 

    2、/discuz/source/function/function_member.php 调用(line:68)的如下代码:

setloginstatus($member, $cookietime)

 

    具体参考示例:

require '../source/class/class_core.php';
require '../source/function/function_member.php';
$discuz = C::app();
$discuz->init();
$member = getuserbyuid($uid);
setloginstatus($member, 604800);