爱采购

发产品

  • 发布供应
  • 管理供应
DESTOON系统设置普通会员不自动绑定二级域名DESTOON系统设置普通会员不自动绑定二级域名_destoon教程_PHP 教程_软件编程_教程资讯_大秦朝旭-码农学习站

DESTOON系统设置普通会员不自动绑定二级域名

   2023-10-06 24 0
导读

首先这个二级域名要开通,按照官方教程来做就行了,这里就不多说了。修改以下两处:1.是修改 include\global.func.php中的userurl函数function userurl($username

首先这个二级域名要开通,按照官方教程来做就行了,这里就不多说了。


修改以下两处:


1.是修改 include\global.func.php中的userurl函数


 


function userurl($username, $qstring = ’’, $domain = ’’) {


global $CFG, $DT, $MODULE;


$URL = ’’;


if($username) {


$UserInfo = userinfo($username);//获得用户信息


if(($CFG[’com_domain’] && $UserInfo[’vip’]) || $domain) {//添加VIP判断


$URL = $domain ? ’https://’.$domain.’/’ : ’https://’.($DT[’com_www’] ? ’www.’ : ’’).$username.$CFG[’com_domain’].’/’;


if($qstring) {


parse_str($qstring, $q);


if(isset($q[’file’])) {


$URL .= $CFG[’com_dir’] ? $q[’file’].’/’ : ’company/’.$q[’file’].’/’;


unset($q[’file’]);


}


if($q) {


if($DT[’rewrite’]) {


//$URL .= ’home-’;


foreach($q as $k=>$v) {


$v = urlencode($v);


$URL .= $k.’-’.$v.’-’;


}


$URL = substr($URL, 0, -1).’.shtml’;


} else {


$URL .= ’index.php?’;


$i = 0;


foreach($q as $k=>$v) {


$v = urlencode($v);


$URL .= ($i  == 0 ? ’’ : ’&’).$k.’=’.$v;


}


}


}


}


} else if($DT[’rewrite’]) {


$URL = DT_URL.’com/’.$username.’/’;


if($qstring) {


parse_str($qstring, $q);


if(isset($q[’file’])) {


$URL .= $CFG[’com_dir’] ? $q[’file’].’/’ : ’company/’.$q[’file’].’/’;


unset($q[’file’]);


}


if($q) {


foreach($q as $k=>$v) {


$v = urlencode($v);


$URL .= $k.’-’.$v.’-’;


}


$URL = substr($URL, 0, -1).’.html’;


}


}


} else {


$URL = DT_URL.’index.php?homepage=’.$username;


if($qstring) $URL = $URL.’&’.$qstring;


}


} else {


$URL = linkurl($MODULE[4][’linkurl’], 1).’guest.php’;


}


return $URL;


}


 


第二步,是修改module\company\index.inc.php文件,在注释处添加个判断


 


defined(’IN_DESTOON’) or exit(’Access Denied’);


require DT_ROOT.’/module/’.$module.’/common.inc.php’;


$username = $domain = ’’;


if(isset($homepage) && check_name($homepage)) {


$username = $homepage;


} else {


$host = $_SERVER[’HTTP_HOST’];


if(substr($host, 0, 4) == ’www.’) {


$whost = $host;


$host = substr($host, 4);


} else {


$whost = $host;


}


if(strpos($MODULE[4][’linkurl’], $host) === false) {


$www = str_replace($CFG[’com_domain’], ’’, $host);


if(check_name($www)) {


$vip = userinfo($www);//获得用户信息


if($vip[’vip’]){//添加VIP判断


$username = $homepage = $www;


}


} else {


$c = $db->get_one("SELECT username,domain FROM {$DT_PRE}company WHERe domain=’$whost’".($host == $whost ? ’’ : " OR domain=’$host’"));


if($c) {


$username = $homepage = $c[’username’];


$domain = $c[’domain’];


}


}


}


}


 


if($username) {


include DT_ROOT.’/module/’.$module.’/init.inc.php’;


} else {


if($DT[’safe_domain’]) {


$safe_domain = explode(’|’, $DT[’safe_domain’]);


$pass_domain = false;


foreach($safe_domain as $v) {


if(strpos($DT_URL, $v) !== false) { $pass_domain = true; break; }


}


$pass_domain or exit(header("HTTP/1.1 404 Not Found"));


}


if(!check_group($_groupid, $MOD[’group_index’])) {


$head_title = lang(’message->without_permission’);


exit(include template(’noright’, ’message’));


}


if($MOD[’index_html’]) {


$html_file = DT_ROOT.’/’.$MOD[’moduledir’].’/index.inc.html’;


if(!is_file($html_file)) tohtml(’index’, $module);


exit(include($html_file));


}


include DT_ROOT.’/include/seo.inc.php’;


if($MOD[’seo_index’]) {


eval("\$seo_title = \"$MOD[seo_index]\";");


} else {


$seo_title = $seo_modulename.$seo_delimiter.$seo_sitename;


}


$taomodi_task = "moduleid=$moduleid&html=index";


include template(’index’, $module);


}


?>


 
反对 0举报 0 收藏 0 打赏 0评论 0
免责声明
• 
本文为会员destoon8发布,欢迎转载,转载请注明原文出处:http://52419.net/news/show-328.html 。本文仅代表作者个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,作者需自行承担相应责任。涉及到版权或其他问题,请及时联系我们。
 
更多>同类destoon教程

入驻

企业入驻成功 可尊享多重特权

入驻热线:17792038992

请手机扫码访问

客服

客服热线:17792038992

小程序

小程序更便捷的查找产品

为您提供专业帮买咨询服务

请用微信扫码

公众号

微信公众号,收获商机

微信扫码关注

顶部