<commit_before>/* Yet Another Forum.NET
 * Copyright (C) 2006-2007 <NAME>
 * http://www.yetanotherforum.net/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
using System;
using System.Text;
using System.Web;
using System.Web.Security;
using YAF.Classes.Data;
using YAF.Classes.Utils;

namespace YAF.Controls
{
	/// <summary>
	/// Summary description for Footer.
	/// </summary>
	public class Footer : BaseControl
	{
		private bool _simpleRender = false;
		private System.Diagnostics.Stopwatch _stopWatch = new System.Diagnostics.Stopwatch();

		/// <summary>
		/// SimpleRender is used for for admin pages
		/// </summary>
		public bool SimpleRender
		{
			get
			{
				return _simpleRender;
			}
			set
			{
				_simpleRender = value;
			}
		}

		public System.Diagnostics.Stopwatch StopWatch
		{
			get
			{
				return _stopWatch;
			}
		}

		public void Reset()
		{
			StopWatch.Reset();
			SimpleRender = false;
		}

		protected override void Render( System.Web.UI.HtmlTextWriter writer )
		{
			if ( !SimpleRender ) RenderRegular( ref writer );
			else RenderSimple( ref writer );
		}

		protected void WriteOnLoadString( ref System.Web.UI.HtmlTextWriter writer )
		{
			if ( PageContext.LoadString.Length > 0 )
			{
				writer.WriteLine( String.Format( "<script language='javascript'>\nonload=function(){1}\nalert(\"{0}\")\n{2}\n</script>\n", PageContext.LoadString, '{', '}' ) );
			}
		}

		protected void RenderSimple( ref System.Web.UI.HtmlTextWriter writer )
		{
			WriteOnLoadString( ref writer );

			writer.WriteLine( "</body>" );
			writer.WriteLine( "</html>" );
		}

		protected void RenderRegular( ref System.Web.UI.HtmlTextWriter writer )
		{
			// BEGIN FOOTER
			StringBuilder footer = new StringBuilder();
			footer.AppendFormat( "<p style=\"text-align:center;font-size:7pt\">" );

			if ( PageContext.BoardSettings.ShowRSSLink )
			{
				footer.AppendFormat( "{2} : <a href=\"{0}\"><img valign=\"absmiddle\" src=\"{1}images/rss.gif\" alt=\"RSS\" /></a><br /><br />", YafBuildLink.GetLink( ForumPages.rsstopic, "pg=forum" ), YafForumInfo.ForumRoot, PageContext.Localization.GetText( "DEFAULT", "MAIN_FORUM_RSS" ) );
				// footer.AppendFormat("Main Forum Rss Feed : <a href=\"{0}rsstopic.aspx?pg=forum\"><img valign=\"absmiddle\" src=\"{1}images/rss.gif\" alt=\"RSS\" /></a><br /><br />", Data.ForumRoot, Data.ForumRoot);
			}

			// get the theme credit info from the theme file
			// it's not really an error if it doesn't exist
			string themeCredit = PageContext.Theme.GetItem( "THEME", "CREDIT", null );

			if ( themeCredit != null && themeCredit.Length > 0 )
			{
				themeCredit = @"<span id=""themecredit"" style=""color:#999999"">" + themeCredit + @"</span><br />";
			}

			StopWatch.Stop();
			double duration = ( double ) StopWatch.ElapsedMilliseconds / 1000.0;

			if ( YAF.Classes.Config.IsDotNetNuke )
			{
				if ( themeCredit != null && themeCredit.Length > 0 ) footer.Append( themeCredit );<commit_msg>Moving to "Standardized" RSS Feed Icon<commit_after>/* Yet Another Forum.NET
 * Copyright (C) 2006-2007 <NAME>
 * http://www.yetanotherforum.net/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
using System;
using System.Text;
using System.Web;
using System.Web.Security;
using YAF.Classes.Data;
using YAF.Classes.Utils;

namespace YAF.Controls
{
	/// <summary>
	/// Summary description for Footer.
	/// </summary>
	public class Footer : BaseControl
	{
		private bool _simpleRender = false;
		private System.Diagnostics.Stopwatch _stopWatch = new System.Diagnostics.Stopwatch();

		/// <summary>
		/// SimpleRender is used for for admin pages
		/// </summary>
		public bool SimpleRender
		{
			get
			{
				return _simpleRender;
			}
			set
			{
				_simpleRender = value;
			}
		}

		public System.Diagnostics.Stopwatch StopWatch
		{
			get
			{
				return _stopWatch;
			}
		}

		public void Reset()
		{
			StopWatch.Reset();
			SimpleRender = false;
		}

		protected override void Render( System.Web.UI.HtmlTextWriter writer )
		{
			if ( !SimpleRender ) RenderRegular( ref writer );
			else RenderSimple( ref writer );
		}

		protected void WriteOnLoadString( ref System.Web.UI.HtmlTextWriter writer )
		{
			if ( PageContext.LoadString.Length > 0 )
			{
				writer.WriteLine( String.Format( "<script language='javascript'>\nonload=function(){1}\nalert(\"{0}\")\n{2}\n</script>\n", PageContext.LoadString, '{', '}' ) );
			}
		}

		protected void RenderSimple( ref System.Web.UI.HtmlTextWriter writer )
		{
			WriteOnLoadString( ref writer );

			writer.WriteLine( "</body>" );
			writer.WriteLine( "</html>" );
		}

		protected void RenderRegular( ref System.Web.UI.HtmlTextWriter writer )
		{
			// BEGIN FOOTER
			StringBuilder footer = new StringBuilder();
			footer.AppendFormat( "<p style=\"text-align:center;font-size:7pt\">" );

			if ( PageContext.BoardSettings.ShowRSSLink )
			{
				footer.AppendFormat( "{2} : <a href=\"{0}\"><img style=\"vertical-align: middle\" src=\"{1}images/RssFeed.png\" alt=\"RSS Feed\" /></a><br /><br />", YafBuildLink.GetLink( ForumPages.rsstopic, "pg=forum" ), YafForumInfo.ForumRoot, PageContext.Localization.GetText( "DEFAULT", "MAIN_FORUM_RSS" ) );
				// footer.AppendFormat("Main Forum Rss Feed : <a href=\"{0}rsstopic.aspx?pg=forum\"><img valign=\"absmiddle\" src=\"{1}images/rss.gif\" alt=\"RSS\" /></a><br /><br />", Data.ForumRoot, Data.ForumRoot);
			}

			// get the theme credit info from the theme file
			// it's not really an error if it doesn't exist
			string themeCredit = PageContext.Theme.GetItem( "THEME", "CREDIT", null );

			if ( themeCredit != null && themeCredit.Length > 0 )
			{
				themeCredit = @"<span id=""themecredit"" style=""color:#999999"">" + themeCredit + @"</span><br />";
			}

			StopWatch.Stop();
			double duration = ( double ) StopWatch.ElapsedMilliseconds / 1000.0;

			if ( YAF.Classes.Config.IsDotNetNuke )
			{
				if ( themeCredit != null && themeCredit.Length > 0 ) footer.Append( themeCredit );
{'fraction_non_alphanumeric': 0.13615152346966786, 'fraction_numerical': 0.01262695580565468, 'mean_word_length': 3.456880733944954, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2243084', 'n_tokens_mistral': 2603, 'n_tokens_neox': 2217, 'n_words': 653}