Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[疑问] 关于登陆的老问题,还是没有解决,强力求助

[复制链接]
君子笑笑 发表于 2010-2-21 15:31:25 | 显示全部楼层 |阅读模式
本帖最后由 君子笑笑 于 2010-02-21 15:33 编辑

借用了几个模板,我这首页真是模板大杂烩了,最后顶部又借用了个登陆框,但是用这个登陆框并不能实现登陆和退出;在其他页面登陆后刷新,这里才显示登陆状态。

其他地方登陆无错,DZ,UCH,SS本来的登陆界面都能实现正确的一体化登陆和退出,请教该如何设置,附配置文件
http://www.smilehome.net.cn/
1.JPG

SS config文件
=================================================================
//--------------- SupeSite设置 ---------------
$_SC['dbname'] = 'home';                                                //SupeSite数据库名
$_SC['tablepre'] = 'supe_';                                        //SupeSite表名前缀(不能与论坛的表名前缀相同)
$_SC['pconnect'] = 0;                                                //SupeSite数据库持久连接 0=关闭, 1=打开
$_SC['dbcharset'] = 'gbk';                                        //SupeSite数据库字符集
$_SC['siteurl'] = '';                                                //SupeSite程序文件所在目录的URL访问地址。可以填写以 http:// 开头的完整URL,也可以填写相对URL。末尾不要加 /。如果程序无法自动获取,请务必手工修改为 http://www.yourwebsite.com/supesite 形式



//--------------- COOKIE设置 ---------------
$_SC['cookiepre'] = 'supe_';        //Cookie前缀
$_SC['cookiedomain'] = '';        //cookie 作用域。请设置为 .yourdomain.com 形式
$_SC['cookiepath'] = '/';        //cookie 作用路径


// 数据库相关 (mysql 连接时)
define('UC_DBNAME', 'ucenter');        // UCenter 数据库名称
define('UC_DBCHARSET', 'gbk');        // UCenter 数据库字符集
define('UC_DBTABLEPRE', '`ucenter`.uc_');        // UCenter 数据库表前缀
define('UC_DBCONNECT', '0');                // UCenter 数据库持久连接 0=关闭, 1=打开

// 通信相关
define('UC_API', '/ucenter');                // UCenter 的 URL 地址, 在调用头像时依赖此常量
define('UC_CHARSET', 'gbk');                // UCenter 的字符集
define('UC_IP', '127.0.0.1');                // UCenter 的 IP, 当 UC_CONNECT 为非 mysql 方式时, 并且当前应用服务器解析域名有问题时, 请设置此值
define('UC_APPID', '5');                // 当前应用的 ID
define('UC_PPP', '20');
===============================================================

UC config.inc文件
===============================================================
<?php
define('UC_DBNAME', 'ucenter');
define('UC_DBCHARSET', 'gbk');
define('UC_DBTABLEPRE', 'uc_');
define('UC_COOKIEPATH', '/');
define('UC_COOKIEDOMAIN', '');
define('UC_DBCONNECT', 0);
define('UC_CHARSET', 'gbk');
define('UC_PPP', 20);
================================================================

顶部登陆框文件
================================================================
<?php

/*
        [SupeSite] (C) 2007-2009 Comsenz Inc.
        $Id: batch.panel.php 13359 2009-09-22 09:06:19Z zhaofei $
*/

include_once('./common.php');
include_once(S_ROOT.'./language/batch.lang.php');

$uid = $_SGLOBAL['supe_uid'];
$ucurl = avatar($uid);
$siteurl = S_URL_ALL;
if(!empty($uid)) {

        if($channels['menus']['bbs']) {
                $bbshtml = ' | <a href="'.$_SC['bbsurl'].'" target="_blank">'.$blang['forum_visit'].'</a>';
        }
        if($channels['menus']['uchblog'] || $channels['menus']['uchimage']) {
                $uchhtml = ' | <a href="'.$_SC['uchurl'].'" target="_blank">'.$blang['home_visit'].'</a>';
        }
        $showpost = 0;
        $showposturl = '';
        $divhtml = '<div id="contribute_op" style="display:none;"><ul>';

        if(!empty($channels['menus'])) {
                foreach($channels['menus'] as $value) {
                        $channel = $value['nameid'];
                        if(!checkperm('allowpost')) continue;
                        if($value['type']=='type' || $value['type']=='user' && $value['upnameid']=='news') {
                                $divhtml .= '<li><a href="'.$siteurl.'/cp.php?ac=news&op=add&type='.$value['nameid'].'" target="_blank">'.$value['name'].'</a></li>';
                                $showpost++;
                                $showposturl = $siteurl.'/cp.php?ac=news&op=add&type='.$value['nameid'];
                        } elseif($value['type']=='model') {
                                $divhtml .= '<li><a href="'.$siteurl.'/cp.php?ac=models&op=add&nameid='.$value['nameid'].'" target="_blank">'.$value['name'].'</a></li>';
                                $showpost++;
                                $showposturl = $siteurl.'/cp.php?ac=models&op=add&nameid='.$value['nameid'];
                        }
                }
        }
        
        if($showpost == 1) {
                $showposturl = "document.write('<a href=\"$showposturl\" class=\"contribute_txt\" target=\"_blank\">$lang[pannel_contribution]</a> ');";
        } elseif($showpost > 1) {
                $showposturl = "document.write('<a href=\"javascript:contributeop();\" class=\"contribute_txt\">$lang[pannel_contribution]</a> ');";
        }
        
        $divhtml .= '</ul></div>';
        
        print <<<END
        function contributeop() {
                if($('contribute_op').style.display != 'block') {
                        $('contribute_op').style.display = 'block';
                } else {
                        $('contribute_op').style.display = 'none';
                }        
        }
        function hidendivop(){
                $('contribute_op').style.display = 'none';
        }
        document.write('<div style="float:left;margin-left:10px;padding-top:5px;" >');
        document.write('$blang[welcome], <a href="$siteurl/home/space.php?uid=$uid"  class="bai_12">$_SGLOBAL[supe_username] </a>欢迎回来! [ <a href="$siteurl/batch.login.php?action=logout" class="bai_12">$blang[safe_logout]</a> ] ');
        document.write(' |  <a href="home/space.php?do=blog"  class="bai_12">写日志</a>');
        document.write(' |  <a href="home/space.php?do=doing"  class="bai_12">记心情</a>');
        document.write(' |  <a href="home/cp.php?ac=userapp&my_suffix=%2Fapp%2Flist"  class="bai_12">玩游戏</a>');
        document.write('  |  <a href="$siteurl/admincp.php" target="_blank" class="bai_12">$blang[management]   </a> ');
document.write('</div>');
END;
} else {

        $formhash = formhash();
        print <<<END
        var noseccode = $_SCONFIG[noseccode];

        document.write('<form id="login_box" name="login_box" action="$siteurl/batch.login.php?action=login"method="post">');
        document.write('<input type="hidden" name="formhash" value="$formhash" />');
        document.write(' <span class="bai_12">会员登陆:    用户名: </span> <input type="text" name="username" size="20" tabindex="1" class="zi_bd1" />');
        document.write('  <span class="bai_12">密码: <input type="password" name="password" size="20" tabindex="1" class="zi_bd2" />');
        document.write('<p id="login_authcode_input" style="display:none"><label>$lang[verification_code]:</label> <input type="text"  name="seccode" size="10"; /> <a href="javascript:updateseccode();">$lang[changge_verification_code]</a></p>');
                document.write('<input id="cookietime" type="hidden" value="315360000" name="cookietime" />');
        document.write('<div id="login_showclose" style="display:none"><a href="javascript:hidesec();"> </a></div>');
        document.write('  <span class="bai_12"><input type="submit"  class="zi_bd4"  value="" name="loginsubmit" id="navbt"  style="margin-left:5px;"/>');
        document.write('   <a href="$siteurl/home/do.php?ac=24b375dfc36db50c7fbedc5bc1b73e27" target="_blank" class="bai_12">会员注册</a>');
        document.write('</form>');
END;
}


?>
======================================================================

再次谢谢各位,请帮帮忙
config.rar (2.74 KB, 下载次数: 35) 打包附件
回复

使用道具 举报

 楼主| 君子笑笑 发表于 2010-2-21 16:15:34 | 显示全部楼层
这么多人在线,为什么没人帮我{:2_123:}
回复

使用道具 举报

 楼主| 君子笑笑 发表于 2010-2-21 17:36:10 | 显示全部楼层
............................
回复

使用道具 举报

Alice.Girl 发表于 2010-2-21 17:59:55 | 显示全部楼层
本帖最后由 Alice.Girl 于 2010-02-21 18:00 编辑

回复 2# 君子笑笑

1、把DZ,UCH,SS配置文件内的
  1. $_SC['cookiedomain'] = '.yourdomain.com';        //cookie 作用域。请设置为 .yourdomain.com 形式
复制代码
都填上。
2、UCENTER里的每一个应用也需要开启同步登录。
回复

使用道具 举报

天婷a 发表于 2010-2-21 18:05:21 | 显示全部楼层
本帖最后由 天婷a 于 2010-02-21 18:06 编辑

下面是我自己用的主页登陆代码[code]<?php
看来不需要我的代码,删除了
回复

使用道具 举报

 楼主| 君子笑笑 发表于 2010-2-21 20:59:37 | 显示全部楼层
该填什么呢?都填.smilehome.net.cn???
回复

使用道具 举报

 楼主| 君子笑笑 发表于 2010-2-21 21:06:52 | 显示全部楼层
试过了,DZ,UCH,SS的配置文件都设置作用域为.smilehome.net.cn。没用
回复

使用道具 举报

 楼主| 君子笑笑 发表于 2010-2-21 21:09:56 | 显示全部楼层
回复 4# Alice.Girl


    还有,我已经说明了,不使用头部登陆框,使用其他的登陆页面,都能实现同步,只有这个头部登陆框无效
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-15 01:08 , Processed in 0.115940 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表