您当前的位置:首页 > CMS常见问题 > 帝国cms常见问题 >

帝国cms /e/memberconnect/index.php文件代码注释

来源:网站程序网0
<?php
require('../class/connect.php');
require('../class/db_sql.php');
require('../class/q_functions.php');
require('../member/class/user.php');
eCheckCloseMods('member');//验证是否关闭前台会员模块
eCheckCloseMods('mconnect');//验证是否关闭前台外部登录模块
$link=db_connect();
$empire=new mysqlquery();
eCheckCloseMemberConnect();//验证外部登录是否开启
require('memberconnectfun.php');
$apptype=RepPostVar($_GET['apptype']);
$appr=$empire->fetch1("select * from {$dbtbpre}enewsmember_connect_app where apptype='$apptype' and isclose=0 limit 1");
if(!$appr['id'])
{
	printerror2("请选择登录方式","");
}
$ReturnUrlQz=eReturnDomainSiteUrl();
$file=$appr['apptype'].'/to_login.php';
//如果单击的是QQ登录, 则包含qq/to_login.php文件
//如果单击的是微信登录, 则包含weixin/to_login.php文件
@include($file);
db_close();
$empire=null;
?>

<?php
//以上涉及调用的函数如下
//函数eCheckCloseMods在/e/class/connect.php
function eCheckCloseMods($mod){
	global $public_r;
	if(strstr($public_r["closemods"],",".$mod.",")){
		echo $mod." is close";
		exit();
	}
}
//函数eCheckCloseMemberConnect在/e/class/connect.php
function eCheckCloseMemberConnect(){
	global $public_r;
	if(!$public_r["memberconnectnum"]){
		printerror("NotOpenMemberConnect","history.go(-1)",1);
	}
}
//错误提示2直接文字
function printerror2($error="",$gotourl="",$ecms=0,$noautourl=0){
	global $empire,$public_r;
	if(strstr($gotourl,"(")||empty($gotourl))
	{
		if(strstr($gotourl,"(-2"))
		{
			$gotourl_js="history.go(-2)";
			$gotourl="javascript:history.go(-2)";
		}
		else
		{
			$gotourl_js="history.go(-1)";
			$gotourl="javascript:history.go(-1)";
		}
	}
	else
	{
		$gotourl_js='self.location.href="'.$gotourl.'";';
	}
	
	if($ecms==9){
		//弹出对话框
		echo'<script>alert("'.$error.'");'.$gotourl_js."</script>";
	}elseif($ecms==7){
		//弹出对话框并关闭窗口
		echo'<script>alert("'.$error.'");window.close();</script>';
	}else{
		@include(ECMS_PATH."e/message/index.php");
	}
	db_close();
	exit();
}
//返回域名网站地址
function eReturnDomainSiteUrl(){
	global $public_r;
	//网站地址,结尾需加/
	$PayReturnUrlQz=$public_r['newsurl'];
//string stristr(string $haystack, $mixed $needle [,bool $before_needle=false])
//返回haystack字符串从needle第一次出现的位置开始到结尾的字符串。
//haystack 在该字符串中查找。
//needle 如果needle不是一个字符串, 那么它将被转换为整型并被视为字符顺序值。
//before_needle 若为TRUE, 将返回needle在haystack中的位置之前的部分(不包括needle)。
//参数needle和haystack将以不区分大小写的方式对待。
//返回匹配的子字符串, 如果needle未找到, 返回FALSE。
	if(!stristr($public_r['newsurl'],'://'))
	{
		$PayReturnUrlQz=eReturnDomain().$public_r['newsurl'];
	}
	return $PayReturnUrlQz;
}
//返回当前域名
function eReturnDomain(){
	//HTTP_HOST 主机名称(它可以是localhost或www.example.com)
	$domain=RepPostStr($_SERVER["HTTP_HOST"],1);
	if(empty($domain))
	{
		return "";
	}
	return "http://".$domain;
}
?>

下一步转向分析/e/memberconnect/qq/to_login.php或/e/memberconnect/weixin/to_login.php

建站咨询

在线咨询真诚为您提供专业解答服务

咨询热线

137 1731 25507×24小时服务热线

微信交流

二维码终于等到你,还好我没放弃
返回顶部