discuz 註冊和登陸成功後跳轉頁面修改

本文轉載自: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,
發佈了44 篇原創文章 · 獲贊 26 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章