📄 list.aspx.cs
字号:
case 3:
if (dyNews.getUserNote(UserNum, ClassID, 1))
{
getContent = getContentRuslt(ChID, strClassTemplet, ClassID, strPage, TmpPath, 1);
}
else
{
if (iuserPoint < iPoint || Guserpoint < Gpoint || getGroup(userGroupNumber, GroupNumber) == false)
{
PageError("您的积分和G币不足,需要积分:" + iPoint + ",G币:" + Gpoint + "<li>或者您所在的组不能浏览</li>", "");
}
else
{
if (dyNews.UpdateHistory(1, ClassID, iPoint, Gpoint, UserNum, IP) == 1)
{
getContent = getContentRuslt(ChID, strClassTemplet, ClassID, strPage, TmpPath, 1);
}
}
}
break;
case 4:
if (Guserpoint < Gpoint || getGroup(userGroupNumber, GroupNumber) == false)
{
PageError("您的G币没达到:" + Gpoint + "<li>或者您所在的组不能浏览</li>", "");
}
else
{
getContent = getContentRuslt(ChID, strClassTemplet, ClassID, strPage, TmpPath, 1);
}
break;
case 5:
if (iuserPoint < iPoint || getGroup(userGroupNumber, GroupNumber) == false)
{
PageError("您的G币没达到:" + iPoint + "<li>或者您所在的组不能浏览</li>", "");
}
else
{
getContent = getContentRuslt(ChID, strClassTemplet, ClassID, strPage, TmpPath, 1);
}
break;
case 6:
if (iuserPoint < iPoint || Guserpoint < Gpoint || getGroup(userGroupNumber, GroupNumber) == false)
{
PageError("您的积分或G币不足,需要达到积分:" + iPoint + ",G币:" + Gpoint + "<li>或者您所在的组不能浏览</li>", "");
}
else
{
getContent = getContentRuslt(ChID, strClassTemplet, ClassID, strPage, TmpPath, 1);
}
break;
}
}
#endregion 扣点
return getContent;
}
protected static string getContentRuslt(int ChID,string ClassTemplet, string ClassID, int strPage, string TmpPath, int isPop)
{
string TempletPath = string.Empty;
string strTempletDir = TempletDir;
string gConenent = string.Empty;
TempletPath = ClassTemplet;
TempletPath = TempletPath.Replace("/", "\\");
TempletPath = TempletPath.ToLower().Replace("{@dirtemplet}", strTempletDir);
TempletPath = SiteRootPath.Trim('\\') + TempletPath;
Template classTemplate = null;
if (ChID != 0)
{
classTemplate = new Template(TempletPath, TempType.ChClass);
classTemplate.CHClassID = int.Parse(ClassID);
classTemplate.ChID = ChID;
}
else
{
classTemplate = new Template(TempletPath, TempType.Class);
classTemplate.ClassID = ClassID;
}
classTemplate.GetHTML();
gConenent = replaceTemplate(classTemplate, ClassID, strPage, TmpPath, isPop);
return gConenent;
}
protected bool getGroup(string uGroup, string nGroup)
{
return NetCMS.Common.Public.CommgetGroup(uGroup, nGroup);
}
/// <summary>
/// 处理模板
/// </summary>
/// <param name="tempRe">模板实例</param>
public static string replaceTemplate(Template tempRe, string ClassID, int strPage, string sTmpPath,int isPop)
{
tempRe.ReplaceLabels();
tempRe.ReplaceIMLabels();
string getPageContent = string.Empty;
string getPageStr = string.Empty;
bool getRight = false;
string FinlContent = string.Empty;
if (tempRe.MyTempType == TempType.Class || tempRe.MyTempType == TempType.ChClass)
{
FinlContent = tempRe.FinallyContent;
int pos1 = FinlContent.IndexOf("{NT:NewsLIST}");
int pos2 = FinlContent.IndexOf("{/NT:NewsLIST}");
if (pos2 > pos1 && pos1 > -1)
{
#region 处理分页
int getFiledot = sTmpPath.LastIndexOf(".");
int getFileg = sTmpPath.LastIndexOf("\\");
string getFileName = sTmpPath.Substring((getFileg + 1), ((getFiledot - getFileg) - 1));
string getFileEXName = sTmpPath.Substring(getFiledot);
string PageHead = FinlContent.Substring(0, pos1);
string PageEnd = FinlContent.Substring(pos2 + 18);
string PageMid = FinlContent.Substring(pos1 + 17, pos2 - pos1 - 17);
string pattern = @"\{\$NT\:P[01]\}\{Page\:\d\$[^\$]{0,6}\$\}";
Regex reg = new Regex(pattern, RegexOptions.Compiled);
Match match = reg.Match(PageMid);
if (match.Success)
{
if (NetCMS.Config.verConfig.PublicType == "0" || tempRe.MyTempType == TempType.ChClass)
{
string PageStr = match.Value;
int posPage = PageStr.IndexOf("}{Page:");
string postResult = PageStr.Substring(posPage + 7);
postResult = postResult.TrimEnd('}');
string[] postResultARR = postResult.Split('$');
string postResult_style = postResultARR[0];
string postResult_color = postResultARR[1];
string postResult_css = postResultARR[2];
string postResult_css1 = "";
if (postResult_css.Trim() != string.Empty)
{
postResult_css1 = " class=\"" + postResult_css + "\"";
}
string[] ArrayCon = reg.Split(PageMid);
int n = ArrayCon.Length;
if (ArrayCon[n - 1] == null || ArrayCon[n - 1].Trim() == string.Empty)
n--;
for (int i = 0; i < n; i++)
{
if (i == (strPage - 1))
{
UltiPublish gpl = new UltiPublish(true);
getPageStr = gpl.getPagelist(postResult_style, i, getFileName, getFileEXName, postResult_color, postResult_css1, n, ClassID, "class", isPop);
getPageContent = PageHead + ArrayCon[i] + getPageStr + PageEnd;
getRight = true;
}
if (getRight)
{
break;
}
}
}
FinlContent = getPageContent;
}
else
{
string p1js = "<span style=\"text-align:center;\" id=\"gPtypenowdiv" + DateTime.Now.ToShortDateString() + "\">加载中...</span>";
p1js += "<script language=\"javascript\" type=\"text/javascript\">";
p1js += "pubajax('/configuration/system/public.aspx','NowStr=" + DateTime.Now.ToShortDateString() + "&ruleStr=1','gPtypenowdiv" + DateTime.Now.ToShortDateString() + "');";
p1js += "</script>";
FinlContent = tempRe.FinallyContent.Replace("{NT:NewsLIST}", "").Replace("{/NT:NewsLIST}", "").Replace("{$NT:P1}", p1js);
}
#endregion
}
}
return FinlContent;
}
protected static string getjs()
{
string getajaxJS = "<script language=\"javascript\" type=\"text/javascript\" src=\"" + NetCMS.Publish.CommonData.getUrl() + "/configuration/js/Prototype.js\"></script>\r\n";
getajaxJS += "<script language=\"javascript\" type=\"text/javascript\" src=\"" + NetCMS.Publish.CommonData.getUrl() + "/configuration/js/jspublic.js\"></script>\r\n";
getajaxJS += "<!--Created by NetCMS v1.0 at " + DateTime.Now + "-->\r\n";
return getajaxJS;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -