Discuz!x1.5 二级域名问题解决方案

更新时间:2024-02-26 16:47:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Discuz!x1.5 二级域名问题解决方案

一、 域名跳转且跳转到的域名显示为用户的二级域名

(1)修改/index.php文件第82行 switch($domain['idtype']) { case'home': $apphost=$domain['domain'].'.'.$_ENV['domain']['root'][$domain['idtype']].'/'; $domainroot='http://'.$domain['domain'].'.'.$_ENV['domain']['root'][$domain['idtype']].'/';

if($_G['setting']['rewritestatus']&&in_array('home_space', _G['setting']['rewritestatus'])) { $url=rewriteoutput('home_space',1,$apphost, domain['id']); } else {

$url = $domainroot.'home.php?mod=space&uid='.$domain['domain']; } break;

(2)修改/source/function/function_core.php 第1102行 if(empty($_G['setting']['domain']['app']['default'])) { $temp = parse_url($_G['siteurl']);

$_G['setting']['domain']['app']['default'] = $temp['host'];// }

$_G['domain'] = array();

$port = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':'.$_SERVER['SERVER_PORT'];

if(is_array($_G['setting']['domain']['app'])) {

foreach($_G['setting']['domain']['app'] as $app => $domain) { if(($domain || $_G['setting']['domain']['app']['default'])) { $appphp = \if(!$domain) {

$domain = $_G['setting']['domain']['app']['default'];

}elseif($_GET['mod']=='space' && !empty($_GET['uid']) && $app=='home'){// $temp = parse_url($_G['siteurl']);// $domain=$temp['host'];// }//

$_G['domain']['search'][$app] = \

$_G['domain']['replace'][$app] = '

href\\=\

} else {

$_G['domain']['pregxprw'][$app] = \} }

$_G['domain']['pregxprw']['all_script'] .= '

$_G['setting']['domain']['app']).'|'.$temp['host'].')'.preg_quote($port.$_G['siteroot'], '/').')';// }

if($_G['setting']['rewritestatus'] || $_G['domain']['search']) {

(2)修改修改/source/function/function_home.php 第256行 function space_domain($space) { global $_G; if($_G['config']['home']['allowdomain'] && $_G['config']['home']['domainroot']) { //space_merge($space, 'field_home');//注释 $uid = empty($space['uid'])?$_G['uid']:$space['uid'];//插入 $query = DB::query(\* FROM \WHERE id='$uid'\ $spaces = DB::fetch($query);// if($spaces['domain']) { $space['domainurl'] = 'http://'.$spaces['domain'].'.'.$_G['config']['home']['domainroot']; $_G['siteurl']=$space['domainurl']; } } if(empty($space['domainurl'])) { space_merge($space, 'field_home');// if($_G['setting']['allowrewrite']) { $space['domainurl'] = $_G['siteurl'].$space['uid']; } else { $space['domainurl'] = $_G['siteurl'].'space-uid-'.$space['uid'].'.html'; } } return $space['domainurl']; }

二、 增加二级域名审核功能

1.在后台管理->全局加入域名审核模块

(1)修改文件/source/admincp/admincp_menu.php文件第42行 $menu['global'] = array( array('menu_setting_basic', 'setting_basic'), array('menu_setting_access', 'setting_access'), array('menu_setting_optimize', 'setting_seo'),

array('menu_setting_functions', 'setting_functions'), array('menu_setting_domain', 'domain'),

array('menu_shmain_domain','shmain_domain'), array('menu_setting_home', 'setting_home'), array('menu_setting_user', 'setting_permissions'), array('menu_setting_credits', 'setting_credits'), array('menu_setting_sec', 'setting_sec')

(4)修改文件/source/language/lang_admincp_menu.php 第44行 'menu_setting_functions' => '站点功能', 'menu_setting_domain' => '域名设置',

'menu_shmain_domain'=>'域名审核',//添加 'menu_setting_user' => '用户权限', 'menu_setting_credits' => '积分设置',

'menu_setting_mail' => '邮件设置', array('menu_setting_user', 'setting_permissions'),

,(3)修改文件admin.php第33行 分配访问权限

增加,'shmain'

$admincp_actions_normal = array('index', …… 'district', 'diytemplate', 'verify', 'nav', 'domain','shmain');

(4)新建文件/template/default/forum/shmain.htm

parent.$('admincpnav').innerHTML='全局 » 域名审核  

href=\C9è??&url=action%3Ddistrict\域名审核

……

用户名空间名申请的域名

name=\忽略

href=\积分:{$group[credits]}

注册时间:{$group[regdate]}
Email:{$group[email]}

空间名称:{$group[spacename]}
空间简介:{$group[spacedescription]}
最近一次更新:{$group[spacenote]}
最近一次行为记录:{$group[recentnote]}

{$group[domain]}

if($setarr) {

updatecreditbyaction('modifydomain');

DB::update('common_member_field_home', $setarr, array('uid' => $_G['uid'])); /* require_once libfile('function/delete'); deletedomain($_G['uid'], 'home'); if(!empty($setarr['domain'])) {

DB::insert('common_domain', array('domain' => $setarr['domain'], 'domainroot' =>

addslashes($_G['setting']['domain']['root']['home']), 'id' => $_G['uid'], 'idtype' => 'home')); }*/ }

(5)新建/source/admincp/admincp_shmain.php

cpheader();

if($operation == 'domain') { $do = empty($do) ? 'mod' : $do; if($do == 'mod') { if(empty($_POST)){

$query = DB::query(\

m.uid,m.username,m.regdate,m.credits,m.email,h.spacename,h.domain,h.spacedescription,h.spacenote,

h.recentnote FROM \LEFT JOIN \LEFT JOIN \WHERE d.domain IS NULL OR d.domain <> h.domain\while($group = DB::fetch($query)) { foreach($group as $k=>$v){ if(empty($v)){ $group[$k]=\无\} }

if($group[domain]!=\无\$groups[] = $group; } }

include template('forum/shmain'); }else{

$modtype=$_POST[modtype]; $domain=$_POST[domain]; //print_r($domain);

foreach($modtype as $key=>$type){ switch($type){

case 'delete':shmain_del($key,$domain); break;

case 'ignore':

case 'invalidate':shmain_inv($key,$domain); break;

case 'validate':shmain_val($key,$domain); break; } }

include template('forum/shmain'); } } }

function shmain_del($key,$domain){

DB::query(\WHERE uid = {$key}\

$query = DB::query(\

{$key}\

$group = DB::fetch($query); //print_r($group); if(!empty($group)){

DB::query(\} }

function shmain_inv($key,$domain){ }

function shmain_val($key,$domain){ global $_G;

$query = DB::query(\{$key}\

$group = DB::fetch($query); //print_r($group); if(!empty($group)){

DB::query(\}

require_once libfile('function/delete'); deletedomain($domain[$key], 'home');

DB::insert('common_domain', array('domain' => $domain[$key], 'domainroot' => addslashes($_G['setting']['domain']['root']['home']), 'id' => $key, 'idtype' => 'home')); $actives = array('profile' =>' class=\$opactives = array('domain' =>' class=\} ?>

三、 二级域名申请的积分权限

修改/template/default/home/spacecp_profile_nav.htm文件第9行

  • {$key}\

    $group = DB::fetch($query); //print_r($group); if(!empty($group)){

    DB::query(\} }

    function shmain_inv($key,$domain){ }

    function shmain_val($key,$domain){ global $_G;

    $query = DB::query(\{$key}\

    $group = DB::fetch($query); //print_r($group); if(!empty($group)){

    DB::query(\}

    require_once libfile('function/delete'); deletedomain($domain[$key], 'home');

    DB::insert('common_domain', array('domain' => $domain[$key], 'domainroot' => addslashes($_G['setting']['domain']['root']['home']), 'id' => $key, 'idtype' => 'home')); $actives = array('profile' =>' class=\$opactives = array('domain' =>' class=\} ?>

    三、 二级域名申请的积分权限

    修改/template/default/home/spacecp_profile_nav.htm文件第9行

  • 本文来源:https://www.bwwdw.com/article/fjna.html

  • Top