📄 insidestaticlabel.cs
字号:
return (SiteConfig.SiteInfo.VirtualPath + "Category_" + id + "/index.aspx");
}
private static string GetPathArray(string originPath, string uploadfiledir, int ltype)
{
StringBuilder builder = new StringBuilder();
int num = 0;
builder.Append("<script language='javascript'>\n");
builder.Append("var arrUrlName=new Array();\n");
builder.Append("var arrUrl=new Array();\n");
foreach (string str in originPath.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries))
{
string[] strArray2 = str.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
builder.Append("arrUrlName[");
builder.Append(num);
builder.Append("]='");
builder.Append(strArray2[0]);
builder.Append("';\n");
builder.Append("arrUrl[");
builder.Append(num);
builder.Append("]='");
if (ltype == 0)
{
builder.Append(strArray2[1]);
}
else
{
builder.Append(SplitUrl(str, uploadfiledir));
}
builder.Append("';\n");
num++;
}
builder.Append("</script>\n");
return builder.ToString();
}
public string GetPhotoPathList(int showType, int imgWidth, int imgHeight, int cols, int maxPerPage, string originPath, string uploadfiledir, int ltype)
{
StringBuilder builder = new StringBuilder();
if (string.IsNullOrEmpty(originPath))
{
return string.Empty;
}
if (cols < 1)
{
cols = 1;
}
if (maxPerPage < 1)
{
maxPerPage = 1;
}
string str = string.Empty;
if (ltype == 0)
{
str = GetPathArray(originPath, string.Empty, 0);
}
else
{
str = GetPathArray(originPath, uploadfiledir, 1);
}
builder.Append(str);
builder.Append("<div id='PhotoUrlList'></div>");
builder.Append("<script language='javascript'>\n");
if (showType == 0)
{
builder.Append("for(var i=0;i<arrUrl.length;i++){\n");
builder.Append(" document.write(\"<a href='#Title' onclick=ViewPhoto('\"+arrUrl[i]+\"')>\"+arrUrlName[i]+\"</a> \");\n");
builder.Append(" if((i+1)%" + cols + "==0&&(i+1<arrUrl.length)){document.write('<br />');}\n");
builder.Append("}\n");
}
else
{
string str2 = "";
if (imgWidth > 0)
{
object obj2 = str2;
str2 = string.Concat(new object[] { obj2, " width='", imgWidth, "'" });
}
if (imgHeight > 0)
{
object obj3 = str2;
str2 = string.Concat(new object[] { obj3, " heigth='", imgHeight, "'" });
}
builder.Append("function ShowUrlList(page){\n");
builder.Append(" if(arrUrl.length<=1) return '';\n");
builder.Append(" var dTotalPage=arrUrl.length/" + maxPerPage + ";\n");
builder.Append(" var TotalPage;\n");
builder.Append(" var MaxPerPage=" + maxPerPage + ";\n");
builder.Append(" if(arrUrl.length%MaxPerPage==0){TotalPage=Math.floor(dTotalPage);}else{TotalPage=Math.floor(dTotalPage)+1;}\n");
builder.Append(" if(page<1) page=1;\n");
builder.Append(" if(page>TotalPage) page=TotalPage;\n");
builder.Append(" var strPage='<table><tr>';\n");
builder.Append(" for(var i=(page-1)*MaxPerPage;i<arrUrl.length&&i<page*MaxPerPage;i++){\n");
builder.Append(" strPage+=\"<td><a href='#Title' onclick=ViewPhoto('\"+arrUrl[i]+\"')><img src='\"+arrUrl[i]+\"' border='0' " + str2 + "></a></td>\";\n");
builder.Append(" if((i+1)%" + cols + "==0&&i+1<MaxPerPage){strPage+='</tr><tr>';}\n");
builder.Append(" }\n");
builder.Append(" strPage+=\"</tr></table>\";\n");
builder.Append(" if(TotalPage>1){strPage+=\"<table><tr><td><a href='javascript:ShowUrlList(1)'>首页</a> <a href='javascript:ShowUrlList(\"+(page-1)+\")'>上一页</a> <a href='javascript:ShowUrlList(\"+(page+1)+\")'>下一页</a> <a href='javascript:ShowUrlList(\"+TotalPage+\")'>尾页</a></td></tr></table>\";}\n");
builder.Append(" document.getElementById('PhotoUrlList').innerHTML=strPage;\n");
builder.Append("}\n");
builder.Append("ShowUrlList(1);\n");
}
builder.Append("</script>\n");
return builder.ToString();
}
public void GetRanNum()
{
this.ranNum = new Random().Next(0x270f);
}
public string GetSlidePic(int imgwidth, int imgheight, int titlelen, int timeout, int effectid, int picposition, int piclast, string imgPath, string linkPath, string title)
{
if ((imgwidth < 0) || (imgwidth > 0x3e8))
{
imgwidth = 150;
}
if ((imgheight < 0) || (imgheight > 0x3e8))
{
imgheight = 150;
}
if ((timeout < 0x3e8) || (timeout > 0x186a0))
{
timeout = 0x1388;
}
if ((effectid < 0) || (effectid > 0x17))
{
effectid = 0x17;
}
StringBuilder builder = new StringBuilder("");
if (picposition == 1)
{
builder.Append("<script language='JavaScript'>\n");
builder.Append("<!--\n");
builder.Append(string.Concat(new object[] { "var SlidePic_", this.ranNum, " = new SlidePic_Info(\"SlidePic_", this.ranNum, "\");\n" }));
builder.Append(string.Concat(new object[] { "SlidePic_", this.ranNum, ".Width = ", imgwidth, ";\n" }));
builder.Append(string.Concat(new object[] { "SlidePic_", this.ranNum, ".Height = ", imgheight, ";\n" }));
builder.Append(string.Concat(new object[] { "SlidePic_", this.ranNum, ".TimeOut = ", timeout, ";\n" }));
builder.Append(string.Concat(new object[] { "SlidePic_", this.ranNum, ".Effect = ", effectid, ";\n" }));
builder.Append(string.Concat(new object[] { "SlidePic_", this.ranNum, ".TitleLen = ", titlelen, ";\n" }));
}
builder.Append("var oSP = new objSP_Info();\n");
builder.Append("oSP.ImgUrl = \"" + imgPath + "\";\n");
builder.Append("oSP.LinkUrl = \"" + linkPath + "\";\n");
builder.Append("oSP.Title = \"" + title + "\";\n");
builder.Append("SlidePic_" + this.ranNum + ".Add(oSP);\n");
if (picposition == piclast)
{
builder.Append("SlidePic_" + this.ranNum + ".Show();\n");
builder.Append("//-->\n");
builder.Append("</script>\n");
}
return builder.ToString();
}
public string GetSpecial(string id, string meth)
{
if (string.IsNullOrEmpty(id))
{
return string.Empty;
}
ISpecial special = DataAccess.CreateSpecial();
if (string.Compare(meth, "dir", true) == 0)
{
return special.GetSpecialInfoById(DataConverter.CLng(id)).SpecialDir;
}
if (string.Compare(meth, "categoryid", true) == 0)
{
return special.GetSpecialInfoById(DataConverter.CLng(id)).SpecialCategoryId.ToString();
}
return special.GetSpecialInfoById(DataConverter.CLng(id)).SpecialName;
}
public string GetSpecialCategoryPath(string id)
{
SpecialCategoryInfo specialCategoryInfoById = DataAccess.CreateSpecial().GetSpecialCategoryInfoById(DataConverter.CLng(id));
if (!specialCategoryInfoById.IsCreateHtml)
{
return (SiteConfig.SiteInfo.VirtualPath + "Specialcategory_" + id + "/index.aspx");
}
return (SiteConfig.SiteInfo.VirtualPath + VirtualPathUtility.AppendTrailingSlash(this.SiteOptionInfo.CreateHtmlPath) + specialCategoryInfoById.CategoryHtmlPageName).Replace("//", "/");
}
public string GetSpecialPath(string id)
{
SpecialInfo specialInfoById = DataAccess.CreateSpecial().GetSpecialInfoById(DataConverter.CLng(id));
if (!specialInfoById.IsCreateListPage)
{
return (SiteConfig.SiteInfo.VirtualPath + "Special_" + id + "/index.aspx");
}
return (SiteConfig.SiteInfo.VirtualPath + VirtualPathUtility.AppendTrailingSlash(this.SiteOptionInfo.CreateHtmlPath) + specialInfoById.ListHtmlPagePath("")).Replace("//", "/");
}
public string GetUserFace(string uname)
{
if (Users.Exists(uname))
{
UserInfo usersByUserName = Users.GetUsersByUserName(uname);
StringBuilder builder = new StringBuilder("");
builder.Append("<img src=\"");
builder.Append(usersByUserName.UserFace);
builder.Append("\" width=\"");
builder.Append(usersByUserName.FaceWidth);
builder.Append("\" height=\"");
builder.Append(usersByUserName.FaceHeight);
builder.Append("\" border=\"0");
builder.Append("\" />");
return builder.ToString();
}
return "err";
}
private static string GetValueOfType1(byte[] b)
{
return Encoding.ASCII.GetString(b);
}
private static string GetValueOfType10(byte[] b)
{
StringBuilder builder = new StringBuilder();
for (int i = 0; i < b.Length; i++)
{
builder.Append(((char) b[i]).ToString());
}
return builder.ToString();
}
private static string GetValueOfType3(byte[] b)
{
if (b.Length != 2)
{
return string.Empty;
}
return Convert.ToUInt16((int) ((b[1] << 8) | b[0])).ToString();
}
private static string GetValueOfType4(byte[] b)
{
if (b.Length != 4)
{
return string.Empty;
}
return Convert.ToUInt32((int) ((((b[3] << 0x18) | (b[2] << 0x10)) | (b[1] << 8)) | b[0])).ToString();
}
private static string GetValueOfType5(byte[] b)
{
if (b.Length != 8)
{
return string.Empty;
}
uint num2 = 0;
num2 = Convert.ToUInt32((int) ((((b[7] << 0x18) | (b[6] << 0x10)) | (b[5] << 8)) | b[4]));
return Math.Round((double) (((float) Convert.ToUInt32((int) ((((b[3] << 0x18) | (b[2] << 0x10)) | (b[1] << 8)) | b[0]))) / ((float) num2)), 2).ToString();
}
private static string GetValueOfType7A(byte[] b)
{
StringBuilder builder = new StringBuilder();
for (int i = 0; i < b.Length; i++)
{
builder.Append(((char) b[i]).ToString());
}
return builder.ToString();
}
private static string GetValueOfType7B(byte[] b)
{
StringBuilder builder = new StringBuilder();
for (int i = 0; i < b.Length; i++)
{
builder.Append(b[i].ToString());
}
return builder.ToString();
}
public string GetVoteForm(int id)
{
if (id < 0)
{
return string.Empty;
}
return Votes.GetFormByGeneralId(id);
}
public string GetVoteNum(string ostr)
{
XmlDocument document = new XmlDocument();
try
{
document.LoadXml(ostr);
}
catch (XmlException exception)
{
return exception.Message;
}
int num = 0;
foreach (XmlNode node in document.DocumentElement.ChildNodes)
{
XmlElement element = (XmlElement) node;
if (!string.IsNullOrEmpty(element.GetAttribute("Title")))
{
num += Convert.ToInt32(element.GetAttribute("VoteNumber"));
}
}
return num.ToString();
}
public int HitsOfHot()
{
return this.SiteOptionInfo.HitsOfHot;
}
public string InstallDir()
{
return this.SiteInfo.VirtualPath;
}
public string Int2Chinese(string a1)
{
string str = string.Empty;
if (!string.IsNullOrEmpty(a1))
{
for (int i = 0; i < a1.Length; i++)
{
char ch = a1[i];
switch (ch.ToString())
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -