此功能可以实现Discuz! X1.5 跨站登录功能,有时可能会遇到,要在另外一个网站去获取Discuz! X1.5 的登录状态。
未登录预览图
登录预览图
演示网址 
http://www.xaydyx.com
- <?php
 - require 'source/class/class_core.php';
 - $discuz = & discuz_core::instance();
 - $discuz->init(); //以上是调用discuz公共执行类等核心代码
 - if (empty($_G['uid'])) {
 - ?>
 - //window.alert("未登录");
 - <? } else { ?>
 - var strbbs;
 - strbbs='<table width="248" border="0" cellpadding="0" cellspacing="0">';
 - strbbs=strbbs+'<tr >';
 - strbbs=strbbs+'<td height="40" align="center" >欢迎您: <a href="http://bbs.xaydyx.com/space-uid-<?php echo $_G['uid']; ?>.html"><b><? echo $_G['username']; ?></b></a></td>';
 - strbbs=strbbs+'</tr><tr >';
 - strbbs=strbbs+'<td height="40" align="center" ><a href="http://bbs.xaydyx.com/home-space-do-thread-view-me.html">我的帖子</a> <a href="http://bbs.xaydyx.com/home.php">个人中心</a> <a href="http://bbs.xaydyx.com/member-logging-action-logout-formhash-<? echo FORMHASH;?>.html">退出登录</a></td></tr>';
 - strbbs=strbbs+'</table>';
 - document.getElementById("bbsajax").innerHTML=strbbs;
 - <? }?>
 
 复制代码