📄 labelmass_method3.cs
字号:
#endregion
string str_LoginP = this.GetParamValue("NT:LoginP");
string str_FormCSS = this.GetParamValue("NT:FormCSS");
string str_LoginCSS = this.GetParamValue("NT:LoginCSS");
string str_RegCSS = this.GetParamValue("NT:RegCSS");
string str_PassCSS = this.GetParamValue("NT:PassCSS");
string str_ShowStyle = this.GetParamValue("NT:ShowStyle");
string str_ImagePath = this.GetParamValue("NT:ImagePath");
string str_CancelImage = this.GetParamValue("NT:CancelImagePath");
string str_ShowPwd = this.GetParamValue("NT:ShowPwd");
string str_ShowRest = this.GetParamValue("NT:ShowBtnRest");
string str_RandNum = NetCMS.Common.Rand.Number(5);
string str_UserLogin = "<div id=\"Div_UserInfo" + str_RandNum + "\">正在加载中..." + newLine;
str_UserLogin += "</div>" + newLine;
if (str_LoginP == null)
str_LoginP = "true";
str_UserLogin += "<script language=\"javascript\" type=\"text/javascript\">" + newLine;
str_UserLogin += "function getLoginForm()" + newLine;
str_UserLogin += "{" + newLine;
str_UserLogin += " var Action='Type=getLoginForm&RandNum=" + str_RandNum + "&LoginP=" + str_LoginP + "&ShowStyle=" + str_ShowStyle + "&ImagePath=" + str_ImagePath + "&CancelImage=" + str_CancelImage + "&FormCSS=" + str_FormCSS + "&LoginCSS=" + str_LoginCSS + "&ShowRest="+str_ShowRest+"&ShowPwd="+str_ShowPwd+"&RegCSS=" + NetCMS.Common.Input.URLEncode(str_RegCSS) + "&PassCSS=" + NetCMS.Common.Input.URLEncode(str_PassCSS) + "';" + newLine;
str_UserLogin += " var options={ " + newLine;
str_UserLogin += " method:'get', " + newLine;
str_UserLogin += " parameters:Action, " + newLine;
str_UserLogin += " onComplete:function(transport) " + newLine;
str_UserLogin += " { " + newLine;
str_UserLogin += " var returnvalue=transport.responseText; " + newLine;
str_UserLogin += " if (returnvalue.indexOf(\"??\")>-1) " + newLine;
str_UserLogin += " alert('未知错误!请联系系统管理员'); " + newLine;
str_UserLogin += " else " + newLine;
str_UserLogin += " document.getElementById(\"Div_UserInfo" + str_RandNum + "\").innerHTML=returnvalue; " + newLine;
str_UserLogin += " } " + newLine;
str_UserLogin += " }; " + newLine;
str_UserLogin += " new Ajax.Request('/" + NetCMS.Config.UIConfig.dirUser + "/UserLoginajax.aspx?no-cache='+Math.random(),options);" + newLine;
str_UserLogin += "}" + newLine;
str_UserLogin += "function LoginSubmit(obj)" + newLine;
str_UserLogin += "{" + newLine;
str_UserLogin += " if(document.getElementById('UserNum').value==\"\"){alert('帐号不能为空');return false;}" + newLine;
str_UserLogin += " if(document.getElementById('UserPwd').value==\"\"){alert('密码不能为空');return false;}" + newLine;
#region 整合,同步登录
if (adaptConfig.isAdapt)
{
str_UserLogin += " var adaptAction='username='+document.getElementById('UserNum').value+'&password='+document.getElementById('UserPwd').value+'&tag=login';" + newLine;
str_UserLogin += " var adaptOptions={" + newLine;
str_UserLogin += " method:'get'," + newLine;
str_UserLogin += " parameters:adaptAction" + newLine;
str_UserLogin += " }; " + newLine;
str_UserLogin += " new Ajax.Request('" + adaptConfig.adaptPath + "?',adaptOptions);" + newLine;
}
#endregion
str_UserLogin += " var Action='UserNum='+document.getElementById('UserNum').value+'&UserPwd='+document.getElementById('UserPwd').value+'&Type=Login&RandNum=" + str_RandNum + "&LoginP=" + str_LoginP + "';" + newLine;
str_UserLogin += " var options={ " + newLine;
str_UserLogin += " method:'get', " + newLine;
str_UserLogin += " parameters:Action, " + newLine;
str_UserLogin += " onComplete:function(transport) " + newLine;
str_UserLogin += " { " + newLine;
str_UserLogin += " var returnvalue=transport.responseText; " + newLine;
str_UserLogin += " var returnvaluearr=returnvalue.split('$$$'); " + newLine;
str_UserLogin += " if (returnvaluearr[0]==\"ERR\") " + newLine;
str_UserLogin += " alert(returnvaluearr[1]); " + newLine;
str_UserLogin += " else " + newLine;
str_UserLogin += " document.getElementById(\"Div_UserInfo" + str_RandNum + "\").innerHTML=returnvaluearr[1]; " + newLine;
str_UserLogin += " } " + newLine;
str_UserLogin += " }; " + newLine;
str_UserLogin += " new Ajax.Request('/" + NetCMS.Config.UIConfig.dirUser + "/UserLoginajax.aspx?no-cache='+Math.random(),options);" + newLine;
str_UserLogin += "}" + newLine;
str_UserLogin += "function LoginOut()" + newLine;
str_UserLogin += "{" + newLine;
#region 整合,同步退出
if (adaptConfig.isAdapt)
{
str_UserLogin += " var adaptAction='tag=logout';" + newLine;
str_UserLogin += " var adaptOptions={" + newLine;
str_UserLogin += " method:'get'," + newLine;
str_UserLogin += " parameters:adaptAction" + newLine;
str_UserLogin += " }; " + newLine;
str_UserLogin += " new Ajax.Request('" + adaptConfig.adaptPath + "?',adaptOptions);" + newLine;
}
#endregion
str_UserLogin += " var Action='Type=LoginOut&LoginP=" + str_LoginP + "';" + newLine;
str_UserLogin += " var options={ " + newLine;
str_UserLogin += " method:'get', " + newLine;
str_UserLogin += " parameters:Action, " + newLine;
str_UserLogin += " onComplete:function(transport) " + newLine;
str_UserLogin += " { " + newLine;
str_UserLogin += " var returnvalue=transport.responseText; " + newLine;
str_UserLogin += " if (returnvalue.indexOf(\"??\")>-1) " + newLine;
str_UserLogin += " alert('未知错误!请联系管理员'); " + newLine;
str_UserLogin += " else " + newLine;
str_UserLogin += " document.getElementById(\"Div_UserInfo" + str_RandNum + "\").innerHTML=returnvalue; " + newLine;
str_UserLogin += " } " + newLine;
str_UserLogin += " }; " + newLine;
str_UserLogin += " new Ajax.Request('/" + NetCMS.Config.UIConfig.dirUser + "/UserLoginajax.aspx?no-cache='+Math.random(),options);" + newLine;
str_UserLogin += "}" + newLine;
str_UserLogin += "getLoginForm();" + newLine;
str_UserLogin += "</script>" + newLine;
return str_UserLogin;
}
/// <summary>
/// 最新评论
/// </summary>
/// <returns></returns>
public string Analyse_LastComm()
{
string str_TopComm = "";
string str_ShowNavi = this.GetParamValue("NT:ShowNavi");
string str_CSS = this.GetParamValue("NT:CSS");
string str_ShowDate = this.GetParamValue("NT:ShowDate");
string str_NaviPic = this.GetParamValue("NT:NaviPic");
string str_NaviCSS = this.GetParamValue("NT:NaviCSS");
string str_TitleNumer = this.GetParamValue("NT:TitleNumer");
if (str_CSS != null)
str_CSS += " class=\"" + str_CSS + "\"";
int i_tnumber = 20;
if (str_TitleNumer != null)
i_tnumber = Convert.ToInt32(str_TitleNumer);
DataTable dt = CommonData.DalPublish.GetApiComm(this.Param_Loop);
str_TopComm = "<ul>" + newLine;
if (dt != null)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
string str_Title = NetCMS.Common.Input.GetSubString(dt.Rows[i]["Content"].ToString(), i_tnumber);
string GUrls = "/Comment.aspx?CommentType=getlist&id=" + dt.Rows[i]["InfoID"].ToString();
if (str_ShowDate == "right")
{
str_TopComm += "<li style=\"list-style:none;\"><span style=\"float:left\">" + getNavi(str_ShowNavi, str_NaviCSS, str_NaviPic, i) + " <a href=\"" + GUrls + "\" " + str_CSS + ">" + str_Title + "</a></span> <span style=\"float:right\">" + dt.Rows[i]["creatTime"].ToString() + "</span></li>" + newLine;
}
else if (str_ShowDate == "left")
{
str_TopComm += "<li style=\"list-style:none;\"><span style=\"float:left\">" + getNavi(str_ShowNavi, str_NaviCSS, str_NaviPic, i) + " <a href=\"" + GUrls + "\" " + str_CSS + ">" + str_Title + "</a></span> <span>" + dt.Rows[i]["creatTime"].ToString() + "</span></li>" + newLine;
}
else
{
str_TopComm += "<li style=\"list-style:none;\"><span style=\"float:left\">" + getNavi(str_ShowNavi, str_NaviCSS, str_NaviPic, i) + " <a href=\"" + GUrls + "\" " + str_CSS + ">" + str_Title + "</a></span></li>" + newLine;
}
}
}
str_TopComm += "</ul>" + newLine;
return str_TopComm;
}
/// <summary>
/// 新闻排行
/// </summary>
/// <returns></returns>
public string Analyse_TopNews()
{
string mystyle = this.Mass_Inserted;
string styleid = Regex.Match(mystyle, @"\[\#NT:StyleID=(?<sid>[^\]]+)]", RegexOptions.Compiled).Groups["sid"].Value.Trim();
if (!styleid.Equals(string.Empty))
{
mystyle = LabelStyle.GetStyleByID(styleid);
}
if (mystyle.Trim().Equals(string.Empty))
return string.Empty;
string str_TopNewsType = this.GetParamValue("NT:TopNewsType");
string str_SubNews = this.GetParamValue("NT:SubNews");
string str_ClassID = this.GetParamValue("NT:ClassID");
int n_Cols;
if (!int.TryParse(this.GetParamValue("NT:Cols"), out n_Cols))
n_Cols = 1;
if (n_Cols < 1)
n_Cols = 1;
string str_isDiv = this.GetParamValue("NT:isDiv");
string str_ulID = this.GetParamValue("NT:ulID");
string str_ulClass = this.GetParamValue("NT:ulClass");
string str_isPic = this.GetParamValue("NT:isPic");
string str_TitleNumer = this.GetParamValue("NT:TitleNumer");
string str_ContentNumber = this.GetParamValue("NT:ContentNumber");
string str_NaviNumber = this.GetParamValue("NT:NaviNumber");
string str_isSub = this.GetParamValue("NT:isSub");
bool subTF = false;
if (str_SubNews != null)
{
if (str_SubNews == "true")
{
subTF = true;
}
}
string SqlCondition = " Where [isRecyle]=0 And [isLock]=0 And [SiteID]='" + this.Param_SiteID + "'";
//-------判断是否调用图片
if (str_isPic == "true")
SqlCondition += " And [NewsType]=1";
else if (str_isPic == "false")
SqlCondition += " (And [NewsType]=0 Or [NewsType]=2)";
//-------排序
string SqlOrderBy = string.Empty;
switch (str_TopNewsType)
{
case "Hour":
SqlOrderBy += " And DateDiff(Day,[CreatTime] ,Getdate())=0 Order By [CreatTime]";
break;
case "YesDay":
SqlOrderBy += " And DateDiff(Day,[CreatTime] ,Getdate())=1 Order By [CreatTime]";
break;
case "Week":
SqlOrderBy += " And DateDiff(Week,[CreatTime] ,Getdate())=0 Order By [CreatTime]";
break;
case "Month":
SqlOrderBy += " And DateDiff(Month,[CreatTime] ,Getdate())=0 Order By [CreatTime]";
break;
case "Comm":
SqlOrderBy += " Order By (Select Count(ID) From [" + DBConfig.TableNamePrefix + "api_commentary] Where [" + DBConfig.TableNamePrefix + "api_commentary].[InfoID]=[" + DBConfig.TableNamePrefix + "News].[NewsID])";
break;
case "disc":
SqlOrderBy += " Order By [CreatTime]";
break;
default:
SqlOrderBy += " Order By [CreatTime]";
break;
}
SqlOrderBy += " Desc,[ID] Desc";
#region 对栏目进行判断
string Sql = string.Empty;
if (str_ClassID == null || str_ClassID == "0")
{
if (this._TemplateType == TempType.Class)
{
if (str_isSub == "true")
SqlCondition += " And [ClassID] In('" + getChildClassID(this.Param_CurrentClassID) + "')";
Sql = "select top " + Param_Loop + " * from [" + DBConfig.TableNamePrefix + "News] " + SqlCondition + SqlOrderBy;
}
else
{
Sql = "select top " + Param_Loop + " * from [" + DBConfig.TableNamePrefix + "News] " + SqlCondition + SqlOrderBy;
}
}
else if (str_ClassID == "-1")
{
Sql = "select top " + Param_Loop + " * from [" + DBConfig.TableNamePrefix + "News] " + SqlCondition + SqlOrderBy;
}
else
{
//-------判断是否调用子类
if (str_isSub == "true")
SqlCondition += " And [ClassID] In('" + getChildClassID(str_ClassID) + "')";
Sql = "select top " + Param_Loop + " * from [" + DBConfig.TableNamePrefix + "News] " + SqlCondition + SqlOrderBy;
}
#endregion 对栏目进行判断
int nTitleNum = 30, nContentNum = 200, nNaviNumber = 200;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -