📄 labelmass_method5.cs
字号:
/// <returns>返回值</returns>
public string Analyse_ChannelContent(int ChID)
{
//判断数据库是否存在
string ChTable = CommonData.DalPublish.GetCHDatable(ChID);
if (ChTable == "#")
{
return "频道数据库找不到";
}
return Analyse_ChRead(this.Param_CurrentCHNewsID, 0, "", "", 1, ChTable, ChID);
}
public string Analyse_ChannelSearch(int ChID)
{
string str_Search = "<div><form id=\"SearchCH_Form_" + ChID + "\" name=\"SearchCH_Form_" + ChID + "\" method=\"get\" action=\"search.html\">";
string str_Type = this.GetParamValue("NT:Type");
string str_Cols = this.GetParamValue("NT:Cols");
string str_RnadNum = NetCMS.Common.Rand.Number(3);
string divPreStr = string.Empty;
string divReStr = " ";
if (str_Cols == "single")
{
divPreStr = "<div>";
divReStr = "</div>";
}
if (str_Type == "normal")
{
str_Search += divPreStr + "<input name=\"tags\" type=\"text\" size=\"10\" maxlength=\"20\" onkeydown=\"javascript:if(event.keyCode==13){SearchCHGo_" + str_RnadNum + "(this.form);}\" />" + divReStr;
str_Search += divPreStr + "<input name=\"buttongo\" type=\"button\" value=\"搜索\" onclick=\"javascript:SearchCHGo_" + str_RnadNum + "(this.form);\">" + divReStr;
}
else
{
str_RnadNum = NetCMS.Common.Rand.Number(4);
str_Search += divPreStr + "<input id=\"tags\" name=\"tags\" type=\"text\" size=\"10\" maxlength=\"20\" onkeydown=\"javascript:if(event.keyCode==13){SearchCHGo_" + str_RnadNum + "(this.form);}\" />" + divReStr;
str_Search += divPreStr + "<select name=\"fieldname\" id=\"fieldname\">";
str_Search += "<option value=\"title\">标题</option>" + newLine;
str_Search += "<option value=\"content\">全文</option>" + newLine;
str_Search += "<option value=\"author\">作者</option>" + newLine;
str_Search += "<option value=\"TAGS\">TAG</option>" + newLine;
IDataReader dr = CommonData.DalPublish.GetFieldName(this.Param_ChID);
while (dr.Read())
{
str_Search += "<option value=\"" + dr["EName"].ToString() + "\">" + dr["CName"].ToString() + "</option>" + newLine;
}
dr.Close();
str_Search += "";
str_Search += "</select >" + divReStr;
str_Search += divPreStr + "<input name=\"buttongo\" type=\"button\" value=\"搜索\" onclick=\"javascript:SearchCHGo_" + str_RnadNum + "(this.form);\">" + divReStr;
}
str_Search += "</form></div>";
str_Search += "<script language=\"javascript\" type=\"text/javascript\">" + newLine;
str_Search += "function SearchCHGo_" + str_RnadNum + "(obj)" + newLine;
str_Search += "{" + newLine;
int minlen = 0;
int maxlen = 20;
string LenSearch = NetCMS.Common.Public.readparamConfig("LenSearch");
minlen = int.Parse(LenSearch.Split('|')[0]);
maxlen = int.Parse(LenSearch.Split('|')[1]);
str_Search += "if(obj.tags.value.length<" + minlen + "||obj.tags.value.length>" + maxlen + ")" + newLine;
str_Search += "{" + newLine;
str_Search += " alert('搜索最小长度" + minlen + "字符,最大长度" + maxlen + "字符。');return false;" + newLine;
str_Search += "}" + newLine;
str_Search += "if(obj.tags.value=='')" + newLine;
str_Search += "{" + newLine;
str_Search += " alert('请填写关键字');return false;" + newLine;
str_Search += "}" + newLine;
if (str_Type == "normal")
{
str_Search += "window.location.href='" + CommonData.SiteDomain + "/Search.html?type=news";
str_Search += "&ChID='+" + ChID + "+'";
str_Search += "&tags='+escape(obj.tags.value)+'';" + newLine;
}
else
{
str_Search += "window.location.href='" + CommonData.SiteDomain + "/Search.html?type=news&ChID='+" + ChID + "+'&tags='+escape(obj.tags.value)+'&fieldname='+obj.fieldname.value+'';" + newLine;
}
str_Search += "}" + newLine;
str_Search += "</script>" + newLine;
return str_Search;
}
public string Analyse_ChannelRSS(int ChID)
{
string str_ClassID = this.GetParamValue("NT:ClassID");
if (str_ClassID == null)
{
str_ClassID = "0";
}
string rsslist = string.Empty;
if (str_ClassID == "0")
{
if (this.Param_CurrentCHClassID == 0)
{
rsslist += CommonData.SiteDomain + "/xml/channel/" + ChID + "_index.xml";
}
else
{
rsslist += CommonData.SiteDomain + "/xml/channel/" + ChID + "_" + this.Param_CurrentCHClassID + ".xml";
}
}
else
{
rsslist += CommonData.SiteDomain + "/xml/channel/" + ChID + "_" + str_ClassID + ".xml";
}
return rsslist;
}
public string Analyse_ChannelFlash(int ChID)
{
string str_FlashFilt = "暂无幻灯新闻";
string ChTable = CommonData.DalPublish.GetCHDatable(ChID);
if (ChTable == "#")
{
return "频道数据库找不到";
}
string str_ClassID = this.GetParamValue("NT:ClassID");
string str_Flashweight = this.GetParamValue("NT:Flashweight");
string str_Flashheight = this.GetParamValue("NT:Flashheight");
string str_FlashBG = this.GetParamValue("NT:FlashBG");
string str_ShowTitle = this.GetParamValue("NT:ShowTitle");
string str_Number = this.GetParamValue("NT:Number");
int IntNumber=5;
if (str_Number != null && NetCMS.Common.Input.IsInteger(str_Number))
{
IntNumber = int.Parse(str_Number);
}
if (str_Flashweight == null && NetCMS.Common.Input.IsInteger(str_Flashweight)==false)
{
str_Flashweight = "200";
}
if (str_Flashheight == null && NetCMS.Common.Input.IsInteger(str_Flashheight) == false)
{
str_Flashheight = "150";
}
if (str_FlashBG == null)
{
str_FlashBG = "FFF";
}
string SqlCondition = " Where [isLock]=0 And [ChID]=" + ChID + " And ContentProperty like '____1%'";
string SqlOrderBy = " Order By [CreatTime] Desc";
#region 对栏目进行判断
DataTable dt = null;
string Sql = string.Empty;
if (str_ClassID != null)
{
switch (str_ClassID)
{
case "0":
if (this._TemplateType == TempType.ChClass)
{
Sql = "select top " + IntNumber + " * from [" + ChTable + "] " + SqlCondition + " And ClassID=" + this.Param_CurrentCHClassID + " " + SqlOrderBy;
}
else
{
Sql = "select top " + IntNumber + " * from [" + ChTable + "] " + SqlCondition + SqlOrderBy;
}
break;
case "-1":
Sql = "select top " + IntNumber + " * from [" + ChTable + "]" + SqlCondition + SqlOrderBy;
break;
default:
if (NetCMS.Common.Input.IsInteger(str_ClassID))
{
Sql = "select top " + IntNumber + " * from [" + ChTable + "] and ClassID=" + int.Parse(str_ClassID) + "" + SqlCondition + SqlOrderBy;
}
break;
}
}
else
{
Sql = "select top " + IntNumber + " * from [" + ChTable + "] " + SqlCondition + SqlOrderBy;
}
dt = CommonData.DalPublish.ExecuteSql(Sql);
#endregion 对栏目进行判断
string Pics_Path = "";
string Link_Str = "";
string Title_Str = "";
if (dt != null)
{
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
PubCHClassInfo ci = CommonData.GetCHClassById(int.Parse(dt.Rows[i]["ClassID"].ToString()));
Pics_Path += dt.Rows[i]["PicURL"].ToString() + "|";
Link_Str += getCHInfoURL(ChID,int.Parse(dt.Rows[i]["isDelPoint"].ToString()), int.Parse(dt.Rows[i]["id"].ToString()), ci.SavePath, dt.Rows[i]["SavePath"].ToString(), dt.Rows[i]["FileName"].ToString()) + "|";
Title_Str += dt.Rows[i]["Title"].ToString() + "|";
}
}
}
dt.Clear(); dt.Dispose();
Pics_Path = NetCMS.Common.Input.CutComma(Pics_Path, "|");
Pics_Path = RelpacePicPath(Pics_Path);
Link_Str = NetCMS.Common.Input.CutComma(Link_Str, "|");
Title_Str = NetCMS.Common.Input.CutComma(Title_Str, "|");
if (Pics_Path != string.Empty && Link_Str != string.Empty && Title_Str != string.Empty)
{
string[] P_Arr = Pics_Path.Split('|');
string[] L_Arr = Link_Str.Split('|');
string[] T_Arr = Title_Str.Split('|');
if (P_Arr.Length == L_Arr.Length && P_Arr.Length == T_Arr.Length)
{
if (P_Arr.Length < 2)
{
str_FlashFilt = "flash幻灯至少要两条以上才可以显示";
}
else
{
string SwfFilePath = CommonData.SiteDomain + "/Flash.swf";
str_FlashFilt = "<script language=\"javascript\" type=\"text/javascript\">" + newLine;
str_FlashFilt += "<!--" + newLine;
str_FlashFilt += "var Flash_Width = " + str_Flashweight + ";" + newLine;
str_FlashFilt += "var Flash_Height = " + str_Flashheight + ";" + newLine;
if (str_ShowTitle == "true")
str_FlashFilt += "var Txt_Height = 20;" + newLine;
else
str_FlashFilt += "var Txt_Height = 0;" + newLine;
str_FlashFilt += "var Swf_Height = parseInt(Flash_Height + Txt_Height);" + newLine;
str_FlashFilt += "var Pics_ = '" + Pics_Path + "';" + newLine;
str_FlashFilt += "var Links_ = '" + Link_Str + "';" + newLine;
str_FlashFilt += "var Texts_ = '" + Title_Str + "';" + newLine;
str_FlashFilt += "document.write('<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"'+ Flash_Width +'\" height=\"'+ Swf_Height +'\">');" + newLine;
str_FlashFilt += "document.write('<param name=\"allowScriptAccess\" value=\"sameDomain\"><param name=\"movie\" value=\"" + SwfFilePath + "\"><param name=\"quality\" value=\"high\"><param name=\"bgcolor\" value=\"#" + str_FlashBG + "\">');" + newLine;
str_FlashFilt += "document.write('<param name=\"menu\" value=\"false\"><param name=\"wmode\" value=\"opaque\">');" + newLine;
str_FlashFilt += "document.write('<param name=\"FlashVars\" value=\"pics='+Pics_+'&links='+Links_+'&texts='+Texts_+'&borderwidth='+Flash_Width+'&borderheight='+Flash_Height+'&textheight='+Txt_Height+'\">');" + newLine;
str_FlashFilt += "document.write('<embed src=\"" + SwfFilePath + "\" wmode=\"opaque\" FlashVars=\"pics='+Pics_+'&links='+Links_+'&texts='+Texts_+'&borderwidth='+Flash_Width+'&borderheight='+Flash_Height+'&textheight='+Txt_Height+'\" menu=\"false\" bgcolor=\"#" + str_FlashBG + "\" quality=\"high\" width=\"'+ Flash_Width +'\" height=\"'+ Swf_Height +'\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />');" + newLine;
str_FlashFilt += "document.write('</object>');" + newLine;
str_FlashFilt += "//-->" + newLine;
str_FlashFilt += "</script>" + newLine;
}
}
}
return str_FlashFilt;
}
public string Analyse_ChRead(int ID, int TitleNumer, string str_Style, string styleid, int NewsTF, string DTable, int ChID)
{
NetCMS.Model.ChContentParam Nci = new NetCMS.Model.ChContentParam();
if (NewsTF == 1)
{
Nci = this.GetCHInfo(this.Param_CurrentCHNewsID, DTable);
}
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -