📄 footer.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web.Caching;
using System.Web.UI;
using System.Web.UI.WebControls;
using CommunityServer.Components;
namespace CommunityServer.Controls
{
public class Footer : WebControl
{
private bool IsLicensed()
{
object obj= CSCache.Get("LicenseValidator");
if(obj == null)
{
bool isValid = false;
string path = CSContext.Current.MapPath(Globals.ApplicationPath + "/bin/license.xml");
try
{
Type t = Type.GetType("Telligent.CommunityServer.Registration.LicenseValidator, Telligent.CommunityServer.Registration");
if(t != null)
{
try
{
Activator.CreateInstance(t, new object[]{path});
isValid = true;
}
catch { } // nothing to do
}
}
catch { }
CSCache.Max("LicenseValidator", isValid, new CacheDependency(path));
return isValid;
}
else
return (bool)obj;
}
protected override void Render(HtmlTextWriter writer)
{
writer.WriteLine("<div class=\"copyright\">" + CSContext.Current.SiteSettings.Copyright + "</div>");
if(!IsLicensed())
{
// Removal of copywrite is available also with support options at
// http://www.telligentsystems.com/Solutions/Forums/
//
writer.Write("<p align=\"center\" class=\"txt4\">");
writer.Write( "<a target=\"_blank\" href=\"http://www.communityserver.org/\"><img alt=\"" + string.Format(ResourceManager.GetString("Footer_PoweredBy"), "Community Server") + "\" border=\"0\" src=\"" + Globals.ApplicationPath + "/utility/EULA.GIF" + "\"></a>");
writer.Write( " <a target=\"_blank\" href=\"http://www.cnforums.net/\"><img alt=\"" + string.Format(ResourceManager.GetString("Footer_PoweredBy"), "CnForums.Net") + "\" border=\"0\" src=\"" + Globals.ApplicationPath + "/utility/CnForumsLogo.GIF" + "\"></a>");
//writer.Write( "<a href=\"mailto:" + CSContext.Current.SiteSettings.AdminEmailAddress + "\">" + ResourceManager.GetString("Footer_QuestionsProblems") + "</a> | <a href=\"" + Globals.GetSiteUrls().TermsOfUse +"\">" + ResourceManager.GetString("Footer_TermsOfUse") + "</a>");
writer.Write("</p>");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -