discuz 注册和登陆成功后跳转页面修改

来源:互联网 发布:听学英语软件 编辑:程序博客网 时间:2024/04/30 09:43

本文转载自:www.discuzlab.com

方法1:


修改文件 source/class/class_member.php

查找:
  1. $locationmessage = 'register_succeed_location';
复制代码

本帖隐藏的内容

只修改下方: $url_forward = dreferer(); 更改跳转页面

例如:
$url_forward = 'http://www.chinagirlol.com/thread-1495-1-1.html';




方法2(这个有效,对新浪微博登录用户无效):

第一步,修改文件 : template/你的模板目录/member/register.htm

查找:
  1. <input type="hidden" name="referer" value="$dreferer" />
复制代码
将 $dreferer  修改成你要跳转的地址即可! 例如 :

本帖隐藏的内容

  1. <input type="hidden" name="referer" value="http://www.chinagirlol.com/thread-1495-1-1.html" />
复制代码



方法3: (登陆跳转)

登录成功之后跳转到家园或者群组或者门户的方法!
但是默认主页不会改变!

PS:不用更改任何官方代码,只需添加代码即可!方便快捷

这里我分享一下我的方法!
一、找到文件source/class/class_member.php

二、登录成功跳转到家园
1.查找文件:

showmessage($loginmessage, $location, $param, $extra);

else {


2.在代码下添加下段代码:

本帖隐藏的内容

  1. $tt=substr($location,-9,9);

  2. //$location=$tt=='forum.php'? 'home.php' : $location;

  3. //$location=$location==''? 'home.php' : 
  4. $location;
  5. $href = str_replace("'", "\'", $location);

  6. if($location=='http://www.chinagirlol.com/' or $tt=='forum.php'){
  7. $href='home.php';
  8. }
  9. else{
  10. $href=$href;
  11. }
复制代码



三、注册成功跳转到家园
1.查找:

if(strpos($url_forward, $this->setting['regname']) !== false || strpos($url_forward, 'buyinvITecode') !== false) {
$url_forward = 'forum.php';
}


2.在代码下面添加:

本帖隐藏的内容

  1. $href = str_replace("'", "\'", $url_forward);
  2. if($url_forward=='http://www.chinagirlol.com/'){
  3. $href='home.php';
  4. }else{
  5. $href=$href;
  6. }
复制代码


四:上传文件(记得备份源文件)

备注:代码中的网址替换成自己的网址即可,想跳转到其它页就更改:$href='home.php';  后面的即可!

或者直接更改这里的href即可showmessage('location_login_succeed', $location, array(),

array(
'showid' => 'succeedmessage',
'extrajs' => '<script type="text/javascript">'.
'setTimeout("window.location.href =\''.$href.'\';", 3000);'.
'$(\'succeedmessage_href\').href = \''.$href.'\';'.
'$(\'main_message\').style.display = \'none\';'.
'$(\'main_succeed\').style.display = \'\';'.
'$(\'succeedlocation\').innerHTML = \''.lang('message', $loginmessage, $param).'\';</script>'.$ucsynlogin,
原创粉丝点击