📄 labelmass_method5.cs
字号:
{
Nci = this.GetCHInfo(ID, DTable);
}
string TmpdimmDir = "";
if (dimmDir.Trim() != string.Empty)
{
TmpdimmDir = "/" + dimmDir;
}
if (NewsTF == 1)
{
str_Style = this.Mass_Inserted;
string styleids = Regex.Match(str_Style, @"\[\#NT:StyleID=(?<sid>[^\]]+)]", RegexOptions.Compiled).Groups["sid"].Value.Trim();
if (styleids != string.Empty)
{
str_Style = LabelStyle.GetCHStyleByID(int.Parse(styleids),ChID);
}
if (str_Style.Trim() == string.Empty)
{
return string.Empty;
}
}
if (Nci != null)
{
if (TitleNumer <= 0)
TitleNumer = 15;
PubCHClassInfo ci = CommonData.GetCHClassById(Nci.ClassID);
if (ci == null)
{
ci = new PubCHClassInfo();
}
PubCHSpecialInfo si = new PubCHSpecialInfo();
if (Nci.SpecialID != "")
{
si = CommonData.GetCHSpecial(int.Parse(Nci.SpecialID));
}
#region 基本
//标题--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Title}") > -1)
{
string str_title = Nci.Title;
if (NewsTF == 0)
{
str_title = getStyle(NetCMS.Common.Input.GetSubString(str_title, TitleNumer), Nci.TitleColor, Nci.TitleITF, Nci.TitleBTF);
}
str_Style = str_Style.Replace("{CH#Title}", str_title);
}
//标题(不可截断)--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#uTitle}") > -1)
{
if (NewsTF == 1)
{
str_Style = str_Style.Replace("{CH#uTitle}", Nci.Title);
}
else
{
string str_Title = Nci.Title;
str_Title = getStyle(Nci.Title, Nci.TitleColor, Nci.TitleITF, Nci.TitleBTF);
str_Style = str_Style.Replace("{CH#uTitle}", str_Title);
}
}
//连接地址--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#URL}") > -1)
{
string urls = getCHInfoURL(ChID,Nci.isDelPoint, Nci.ID, ci.SavePath, Nci.SavePath, Nci.FileName);
str_Style = str_Style.Replace("{CH#URL}", urls);
}
//新闻内容--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Content$") > -1)
{
string str_content = Nci.Content;
string tmpcontent = str_content;
string ContentNumber = string.Empty;
int CHNumber = 0;
string pattern = @"\{CH\#Content\$(?<p>[\s\S]+?)\}";
Regex Greg = new Regex(pattern, RegexOptions.Compiled);
Match mc = Greg.Match(str_Style);
if (mc.Success)
{
ContentNumber = mc.Groups["p"].Value;
}
if (NetCMS.Common.Input.IsInteger(ContentNumber) && ContentNumber.Trim() != "0")
{
CHNumber = int.Parse(ContentNumber);
}
if (NewsTF == 0)
{
string LostResultStr = NetCMS.Common.Input.LostHTML(str_content);
LostResultStr = NetCMS.Common.Input.LostPage(LostResultStr);
if (CHNumber == 0)
{
str_content = NetCMS.Common.Input.GetSubString(LostResultStr, 200) + "...";
}
else
{
str_content = NetCMS.Common.Input.GetSubString(LostResultStr, CHNumber) + "...";
}
str_Style = str_Style.Replace("{CH#Content$" + ContentNumber + "}", str_content.Replace("[NT:PAGE]", "").Replace("[NT:PAGE", "").Replace("$]", ""));
}
else
{
if (str_Style.IndexOf("{CH#PageTitle_select}") > -1 || str_Style.IndexOf("{CH#PageTitle_textdouble}") > -1 || str_Style.IndexOf("{CH#PageTitle_textsinge}") > -1 || str_Style.IndexOf("{CH#PageTitle_textcols}") > -1)
{
string GetPagecontent = tmpcontent;
string Re_Content = string.Empty;
string Pagetitstr = string.Empty;
if (GetPagecontent.IndexOf("[NT:PAGE=") > -1 && GetPagecontent.IndexOf("$]") > -1)
{
string pattern1 = @"\[NT:PAGE=(?<p>[\s\S]+?)\$\]";
Regex reg = new Regex(pattern1, RegexOptions.Compiled);
Match m = reg.Match(GetPagecontent);
while (m.Success)
{
Pagetitstr += m.Groups["p"].Value + "###";
m = m.NextMatch();
}
tmpcontent = reg.Replace(tmpcontent, "[NT:PAGE]");
if (str_Style.IndexOf("{CH#PageTitle_select}") > -1)
{
Re_Content = getPageTitleStyle(Nci.ID.ToString(), Nci.FileName, "", Pagetitstr, 0, Nci.isDelPoint, ChID);
str_Style = str_Style.Replace("{#PageTitle_select}", Re_Content);
}
if (str_Style.IndexOf("{CH#PageTitle_textdouble}") > -1)
{
Re_Content = getPageTitleStyle(Nci.ID.ToString(), Nci.FileName, "", Pagetitstr, 1, Nci.isDelPoint, ChID);
str_Style = str_Style.Replace("{#PageTitle_textdouble}", Re_Content);
}
if (str_Style.IndexOf("{CH#PageTitle_textsinge}") > -1)
{
Re_Content = getPageTitleStyle(Nci.ID.ToString(), Nci.FileName, "", Pagetitstr, 2, Nci.isDelPoint, ChID);
str_Style = str_Style.Replace("{#PageTitle_textsinge}", Re_Content);
}
if (str_Style.IndexOf("{CH#PageTitle_textcols}") > -1)
{
Re_Content = getPageTitleStyle(Nci.ID.ToString(), Nci.FileName, "", Pagetitstr, 3, Nci.isDelPoint, ChID);
str_Style = str_Style.Replace("{CH#PageTitle_textcols}", Re_Content);
}
}
else
{
str_Style = str_Style.Replace("{CH#PageTitle_select}", "");
str_Style = str_Style.Replace("{CH#PageTitle_textdouble}", "");
str_Style = str_Style.Replace("{CH#PageTitle_textsinge}", "");
str_Style = str_Style.Replace("{CH#PageTitle_textcols}", "");
}
}
else
{
str_Style = str_Style.Replace("{CH#PageTitle_select}", "");
str_Style = str_Style.Replace("{CH#PageTitle_textdouble}", "");
str_Style = str_Style.Replace("{CH#PageTitle_textsinge}", "");
str_Style = str_Style.Replace("{CH#PageTitle_textcols}", "");
}
}
if (NetCMS.Common.Public.readparamConfig("collectTF") == "1")
{
tmpcontent = tmpcontent.Replace("<div", "<!--source from " + NetCMS.Common.Public.readparamConfig("siteDomain") + "--><div");
}
str_Style = str_Style.Replace("{CH#Content$" + ContentNumber + "}", "<!-NT:STAR=" + tmpcontent + "NT:END->");
}
#endregion 基本
#region 日期
//录入时间:完整
if (str_Style.IndexOf("{CH#Date}") > -1)
str_Style = str_Style.Replace("{CH#Date}", Nci.CreatTime.ToString() + "");
//录入时间:年-月-日
if (str_Style.IndexOf("{CH#DateShort}") > -1)
str_Style = str_Style.Replace("{CH#DateShort}", Nci.CreatTime.ToShortDateString().ToString() + "");
//录入日期:二位年份--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Year02}") > -1)
str_Style = str_Style.Replace("{CH#Date:Year02}", Nci.CreatTime.Year.ToString().Remove(0, 2));
//录入日期:四位年份--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Year04}") > -1)
str_Style = str_Style.Replace("{CH#Date:Year04}", Nci.CreatTime.Year.ToString());
//录入日期:月份--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Month}") > -1)
str_Style = str_Style.Replace("{CH#Date:Month}", Nci.CreatTime.Month.ToString());
//录入日期:日--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Day}") > -1)
{
str_Style = str_Style.Replace("{CH#Date:Day}", Nci.CreatTime.Day.ToString());
}
//录入日期:时--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Hour}") > -1)
{
str_Style = str_Style.Replace("{CH#Date:Hour}", Nci.CreatTime.Hour.ToString());
}
//录入日期:分--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Minute}") > -1)
{
str_Style = str_Style.Replace("{CH#Date:Minute}", Nci.CreatTime.Minute.ToString());
}
//录入日期:秒--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Date:Second}") > -1)
{
str_Style = str_Style.Replace("{CH#Date:Second}", Nci.CreatTime.Second.ToString());
}
//点击--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Click}") > -1)
{
if (NewsTF == 0)
{
str_Style = str_Style.Replace("{CH#Click}", Nci.Click.ToString());
}
else
{
string str_Click = "<span id=\"click_CH_" + ChID + "_" + Nci.ID + "\"></span><script language=\"javascript\" type=\"text/javascript\">";
str_Click += "pubajax('/click.aspx','id=" + Nci.ID + "&ChID=" + ChID + "','click_CH_" + ChID + "_" + Nci.ID + "');";
str_Click += "</script>";
str_Style = str_Style.Replace("{CH#Click}", str_Click);
}
}
#endregion 日期
#region 其他
//来源--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Source}") > -1)
{
if (Nci.Souce != string.Empty)
str_Style = str_Style.Replace("{CH#Source}", Nci.Souce);
else
str_Style = str_Style.Replace("{CH#Source}", "");
}
//编辑--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Editor}") > -1)
{
if (Nci.Editor != "")
str_Style = str_Style.Replace("{CH#Editor}", "<a href=\"" + CommonData.SiteDomain + "/search.html?type=edit&tags=" + NetCMS.Common.Input.URLEncode(Nci.Editor) + "&ChID=" + ChID + "\" title=\"查看此编辑的所有新闻\" target=\"_blank\">" + Nci.Editor + "</a>");
else
str_Style = str_Style.Replace("{CH#Editor}", "");
}
//作者--------------------------------------------------------------------------------------------------------
if (str_Style.IndexOf("{CH#Author}") > -1)
{
if (Nci.Author != "")
{
if (Nci.isConstr == 1)
{
str_Style = str_Style.Replace("{CH#Author}", "<a href=\"" + CommonData.SiteDomain + "/" + NetCMS.Config.UIConfig.dirUser + "/showuser-" + Nci.Author + ".aspx\" title=\"查看他的资料\">" + Nci.Author + "</a> <a href=\"" + CommonData.SiteDomain + "/search.html?type=author&tags=" + Nci.Author + "\" title=\"此看此作者所有的文章\" target=\"_blank\">发表的文章</a>");
}
else
{
str_Style = str_Style.Replace("{CH#Author}", "<a href=\"" + CommonData.SiteDomain + "/search.html?type=author&tags=" + Nci.Author + "&ChID=" + ChID + "\" title=\"此看此作者所有的文章\" target=\"_blank\">" + Nci.Author + "</a>");
}
}
else
{
str_Style = str_Style.Replace("{CH#Author}", "");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -