📄 insidestaticlabel.cs
字号:
return "Standard light B";
case "19":
return "Standard light C";
case "20":
return "D55";
case "21":
return "D65";
case "22":
return "D75";
case "23":
return "D50";
case "24":
return "ISO studio tungsten";
}
return "其他照明设备";
}
public string FiltInsideLink(string a1)
{
return WordReplace.ReplaceInsideLink(a1);
}
public string FiltText(string a1)
{
return WordReplace.ReplaceText(a1);
}
public string FormatDate(string a1, string a2)
{
try
{
DateTime time = Convert.ToDateTime(a1);
char paddingChar = Convert.ToChar("0");
a2 = a2.Replace("yyyy", time.Year.ToString());
a2 = a2.Replace("YYYY", this.Int2Chinese(time.Year.ToString()));
a2 = a2.Replace("yy", time.Year.ToString().PadLeft(2));
a2 = a2.Replace("YY", this.Int2Chinese(time.Year.ToString().PadLeft(2)));
a2 = a2.Replace("mm", time.Month.ToString().PadLeft(2, paddingChar));
a2 = a2.Replace("MM", this.Int2Chinese(time.Month.ToString()));
a2 = a2.Replace("dd", time.Day.ToString().PadLeft(2, paddingChar));
a2 = a2.Replace("DD", this.Int2Chinese(time.Day.ToString()));
a2 = a2.Replace("hh", time.Hour.ToString().PadLeft(2, paddingChar));
a2 = a2.Replace("HH", this.Int2Chinese(time.Hour.ToString()));
a2 = a2.Replace("ff", time.Minute.ToString().PadLeft(2, paddingChar));
a2 = a2.Replace("FF", this.Int2Chinese(time.Minute.ToString()));
a2 = a2.Replace("ss", time.Second.ToString().PadLeft(2, paddingChar));
a2 = a2.Replace("SS", this.Int2Chinese(time.Second.ToString()));
}
catch (InvalidCastException)
{
a2 = "日期格式错误";
}
return a2;
}
public string GetCustomContent(int num, string content)
{
string[] strArray = content.Split(new string[] { "{#$$$#}" }, StringSplitOptions.None);
for (int i = 0; i < strArray.Length; i++)
{
if ((i + 1) == num)
{
return strArray[i];
}
}
return "";
}
public string GetFieldList(int modelId, int generalId, string cssTable, string cssKey, string cssValue)
{
IList<FieldInfo> fieldList = Field.GetFieldList(modelId, false);
DataTable contentDataById = ContentManage.GetContentDataById(generalId);
StringBuilder builder = new StringBuilder("<table class='" + cssTable + "'>");
int num = 0;
if ((fieldList.Count > 0) && (contentDataById != null))
{
foreach (FieldInfo info in fieldList)
{
if (info.FieldType != FieldType.Property)
{
builder.Append("<tr><td class='" + cssKey + "'><b>").Append(info.FieldAlias).Append(":</b></td>");
builder.Append("<td class='" + cssValue + "'>").Append(contentDataById.Rows[0][info.FieldName].ToString()).Append("</td></tr>");
num++;
}
}
}
if (num == 0)
{
builder.Append("<tr><td>没有相关内容!</td></tr>");
}
builder.Append("</table>");
return builder.ToString();
}
private static string GetFirstPhotoUrl(string originPath, string uploadfiledir, int ltype)
{
string str = string.Empty;
foreach (string str2 in originPath.Split(new string[] { "$$$" }, StringSplitOptions.RemoveEmptyEntries))
{
string[] strArray2 = str2.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
if (!string.IsNullOrEmpty(strArray2[1]))
{
if (ltype == 0)
{
return strArray2[1];
}
return SplitUrl(str2, uploadfiledir);
}
}
return str;
}
public string GetInfoPath(string id)
{
int num;
IContentManage manage = DataAccess.CreateContentManage();
try
{
num = DataConverter.CLng(id, 0);
}
catch (Exception)
{
return "ID必须为数字";
}
CommonModelInfo commonModelInfoById = manage.GetCommonModelInfoById(DataConverter.CLng(num));
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(commonModelInfoById.NodeId);
ContentChargeInfo contentChargeInfoById = ContentCharge.GetContentChargeInfoById(DataConverter.CLng(num));
if ((!cacheNodeById.IsCreateContentPage || !contentChargeInfoById.IsNull) || (cacheNodeById.PurviewType > 0))
{
return (SiteConfig.SiteInfo.VirtualPath + "Item/" + id + ".aspx");
}
string str = SiteConfig.SiteInfo.VirtualPath + VirtualPathUtility.AppendTrailingSlash(this.SiteOptionInfo.CreateHtmlPath) + cacheNodeById.ContentPageHtmlRule;
if (!string.IsNullOrEmpty(str))
{
str = str.ToLower().Replace("{$categorydir}", cacheNodeById.ParentDir + cacheNodeById.NodeDir).Replace("{$year}", commonModelInfoById.InputTime.Year.ToString("0000")).Replace("{$month}", commonModelInfoById.InputTime.Month.ToString("00")).Replace("{$day}", commonModelInfoById.InputTime.Day.ToString("00")).Replace("{$time}", commonModelInfoById.InputTime.Hour.ToString("00") + commonModelInfoById.InputTime.Minute.ToString("00") + commonModelInfoById.InputTime.Second.ToString("00")).Replace("{$infoid}", commonModelInfoById.GeneralId.ToString());
}
return str.Replace("//", "/");
}
public string GetLinkInfoPic(string infoPicPath, string title, string upLoadDir, string infoPath, int imgwidth, int imgheight)
{
StringBuilder builder = new StringBuilder("");
if (string.IsNullOrEmpty(infoPicPath))
{
builder.Append("<img src=\"");
builder.Append(upLoadDir);
builder.Append("nopic.gif\"");
if (imgwidth > 0)
{
builder.Append("width=\"" + imgwidth.ToString() + "\"");
}
if (imgheight > 0)
{
builder.Append("height=\"" + imgheight.ToString() + "\"");
}
builder.Append(" alt=\"" + title + "\"");
builder.Append("border=\"0\"");
builder.Append(" />");
}
else
{
builder.Append("<a href=\"");
builder.Append(infoPath);
builder.Append("\">");
switch (Path.GetExtension(infoPicPath).ToLower())
{
case ".swf":
builder.Append("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" ");
if (imgwidth > 0)
{
builder.Append(" width=\"" + imgwidth.ToString() + "\"");
}
if (imgheight > 0)
{
builder.Append(" height=\"" + imgheight.ToString() + "\"");
}
builder.Append("><param name=\"movie\" value=\"");
builder.Append(infoPicPath);
builder.Append("\"><param name=\"quality\" value=\"high\"><embed src=\"");
builder.Append(infoPicPath);
builder.Append("\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" ");
if (imgwidth > 0)
{
builder.Append(" width=\"" + imgwidth.ToString() + "\"");
}
if (imgheight > 0)
{
builder.Append(" height=\"" + imgheight.ToString() + "\"");
}
builder.Append("></embed></object>");
break;
case ".gif":
case ".jpg":
case ".jpeg":
case ".jpe":
case ".bmp":
case ".png":
builder.Append("<img class=\"pic2\" src=\"");
builder.Append(infoPicPath);
builder.Append("\" ");
if (imgwidth > 0)
{
builder.Append(" width=\"" + imgwidth.ToString() + "\"");
}
if (imgheight > 0)
{
builder.Append(" height=\"" + imgheight.ToString() + "\"");
}
builder.Append(" alt=\"" + title + "\"");
builder.Append(" border=\"0\" />");
break;
default:
builder.Append("<img class=\"pic2\" src=\"");
builder.Append(infoPicPath);
builder.Append("\" ");
if (imgwidth > 0)
{
builder.Append(" width=\"" + imgwidth.ToString() + "\"");
}
if (imgheight > 0)
{
builder.Append(" height=\"" + imgheight.ToString() + "\"");
}
builder.Append(" alt=\"" + title + "\"");
builder.Append(" border=\"0\" />");
break;
}
builder.Append("</a>");
}
return builder.ToString();
}
public string GetModelItemName(int id)
{
return ModelManager.GetCacheModelById(id).ItemName;
}
public string GetModelName(string tableName)
{
return ModelManager.GetCacheModelByTableName(tableName).ModelName;
}
public string GetNode(string id, string meth)
{
if (string.IsNullOrEmpty(id))
{
return string.Empty;
}
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(id, 0));
if (string.Compare(meth, "dir", true) == 0)
{
return cacheNodeById.NodeDir;
}
if (string.Compare(meth, "aspxname", true) == 0)
{
return cacheNodeById.ItemAspxFileName;
}
return cacheNodeById.NodeName;
}
public string GetNodeCommentNeedCheck(int id)
{
if (PowerEasy.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(id)).Settings.CommentNeedCheck)
{
return "true";
}
return "false";
}
public string GetNodeEnableComment(int id)
{
if (PowerEasy.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(id)).Settings.EnableComment)
{
return "true";
}
return "false";
}
public string GetNodeEnableProtect(int id)
{
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(id));
StringBuilder builder = new StringBuilder("");
if (cacheNodeById.Settings.EnableProtect)
{
builder.Append(" oncontextmenu='return false'");
builder.Append(" ondragstart='return false'");
builder.Append(" onselectstart ='return false'");
builder.Append(" onselect='document.selection.empty()'");
builder.Append(" oncopy='document.selection.empty()'");
builder.Append(" onbeforecopy='return false'");
}
return builder.ToString();
}
public string GetNodeFieldName(string id, string fieldName)
{
if (string.IsNullOrEmpty(id) || string.IsNullOrEmpty(fieldName))
{
return string.Empty;
}
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(id));
Type type = typeof(NodeInfo);
return type.GetProperty(fieldName).GetValue(cacheNodeById, null).ToString();
}
public string GetNodePath(string type, string id)
{
NodeInfo cacheNodeById = PowerEasy.Contents.Nodes.GetCacheNodeById(DataConverter.CLng(id));
if (cacheNodeById.IsCreateListPage && (cacheNodeById.PurviewType == 0))
{
if (DataConverter.CBool(type))
{
return (SiteConfig.SiteInfo.VirtualPath + this.SiteOptionInfo.CreateHtmlPath + cacheNodeById.ListHtmlPageName("1")).Replace("//", "/");
}
return (SiteConfig.SiteInfo.VirtualPath + this.SiteOptionInfo.CreateHtmlPath + cacheNodeById.ListHtmlPageName("0")).Replace("//", "/");
}
if (DataConverter.CBool(type))
{
return (SiteConfig.SiteInfo.VirtualPath + "Category_" + id + "/index_1.aspx");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -