⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 labelmass_method4.cs

📁 最好用的站点内容管理系统 全部源代码都有
💻 CS
📖 第 1 页 / 共 5 页
字号:
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Text.RegularExpressions;
using NetCMS.Config;
using NetCMS.Model;

namespace NetCMS.Publish
{
    public partial class LabelMass
    {

        public static string dimmDir = NetCMS.Config.UIConfig.dirDumm;

        /// <summary>
        /// 友情连接
        /// </summary>
        /// <returns></returns>
        public string Analyse_FrindList()
        {
            int int_Number = this.Param_Loop;
            string str_Cols = this.GetParamValue("NT:Cols");
            string str_FType = this.GetParamValue("NT:FType");
            string str_isAdmin = this.GetParamValue("NT:isAdmin");
            string str_isDiv = this.GetParamValue("NT:isDiv");
            if (str_Cols == null || !NetCMS.Common.Input.IsInteger(str_Cols))
            {
                str_Cols = "10";
            }
            if (str_FType == null || !NetCMS.Common.Input.IsInteger(str_FType))
            {
                str_FType = "0";
            }
            if (str_isDiv == null)
            {
                str_isDiv = "true";
            }
            if (str_isAdmin == null || !NetCMS.Common.Input.IsInteger(str_isAdmin))
            {
                str_isAdmin = "3";
            }
            string list = string.Empty;
            if (str_isDiv != "true")
            {
                list += "<table style=\"width:100%\" border=\"0\"><tr>";
            }
            int i = 0;
            IDataReader dr = CommonData.DalPublish.GetFriend(int.Parse(str_FType), int_Number, int.Parse(str_isAdmin));
            while (dr.Read())
            {
                if (str_isDiv == "true")
                {
                    if (str_FType == "0")
                    {
                        list += "<li><a href=\"" + dr["Url"] + "\" target=\"_blank\"><img src=\"" + (dr["PicURL"].ToString().ToLower()).Replace("{@dirfile}", NetCMS.Config.UIConfig.dirFile) + "\" alt=\"" + dr["Content"].ToString() + "\" border=\"0\" /></a></li>";
                    }
                    else
                    {
                        list += "<li><a href=\"" + dr["Url"] + "\" title=\"" + dr["Content"].ToString() + "\" target=\"_blank\">" + dr["Name"].ToString() + "</a></li>";
                    }
                }
                else
                {
                    if (str_FType == "0")
                    {
                        list += "<td><a href=\"" + dr["Url"] + "\" target=\"_blank\"><img src=\"" + (dr["PicURL"].ToString().ToLower()).Replace("{@dirfile}", NetCMS.Config.UIConfig.dirFile) + "\" alt=\"" + dr["Content"].ToString() + "\" border=\"0\" /></a></td>";
                    }
                    else
                    {
                        list += "<td><a href=\"" + dr["Url"] + "\" title=\"" + dr["Content"].ToString() + "\" target=\"_blank\">" + dr["Name"].ToString() + "</a></td>";
                    }
                    if ((i + 1) % int.Parse(str_Cols) == 0)
                    {
                        list += "</tr><tr>";
                    }
                }
                i++;
            }
            dr.Close();
            if (str_isDiv != "true")
            {
                list += "</tr></table>";
            }
            return list;
        }


        /// <summary>
        /// 归档
        /// </summary>
        /// <returns>返回列表</returns>
        public string Analyse_History()
        {
            ///返回一个日期选择器
            string s_IsDate = this.GetParamValue("NT:IsDate");
            string s_ShowDate = this.GetParamValue("NT:ShowDate");
            string SaveIndexPage = "";
            IDataReader rd = CommonData.DalPublish.GetSysParam();
            if (rd.Read())
            {
                if (rd["SaveIndexPage"] != DBNull.Value)
                    SaveIndexPage = rd["SaveIndexPage"].ToString();
            }
            rd.Close();
            string hlist = "";
            if (s_ShowDate == "true") { hlist = getDateForm(SaveIndexPage); }
            else { hlist = getDateJs(SaveIndexPage); }
            return hlist;
        }

        /// <summary>
        /// 热点关键字
        /// </summary>
        /// <returns></returns>
        public string Analyse_HotTag()
        {
            return string.Empty;
        }

        /// <summary>
        /// 版权信息
        /// </summary>
        /// <returns>返回列表</returns>
        public string Analyse_CopyRight()
        {
            string CopyRight = string.Empty;
            IDataReader rd = CommonData.DalPublish.GetSysParam();
            if (rd.Read())
            {
                CopyRight = rd["CopyRight"].ToString();
            }
            rd.Close();
            return CopyRight;
        }
        /// <summary>
        /// 历史首页查询
        /// </summary>
        /// <returns></returns>
        public string Analyse_HistoryIndex()
        {
            string hstr = string.Empty;
            string h_year = string.Empty;
            string h_month = string.Empty;
            string h_day = string.Empty;
            for (int i = 2005; i <= DateTime.Now.Year; i++)
            {
                if (i == DateTime.Now.Year)
                {
                    h_year += "<option selected value=\"" + i + "\">" + i + "</option>\r";
                }
                else
                {
                    h_year += "<option value=\"" + i + "\">" + i + "</option>\r";
                }
            }
            for (int i1 = 1; i1 <= 12; i1++)
            {
                if (i1 == DateTime.Now.Month)
                {
                    h_month += "<option selected value=\"" + i1 + "\">" + i1 + "</option>\r";
                }
                else
                {
                    h_month += "<option value=\"" + i1 + "\">" + i1 + "</option>\r";
                }
            }
            for (int i2 = 1; i2 <= 31; i2++)
            {
                if (i2 == (DateTime.Now.Day - 1))
                {
                    h_day += "<option selected value=\"" + i2 + "\">" + i2 + "</option>\r";
                }
                else
                {
                    h_day += "<option value=\"" + i2 + "\">" + i2 + "</option>\r";
                }
            }
            hstr += "<div id=\"index_historyindexdiv\"><form method=\"POST\" id=\"index_historyindex1\"><select name=\"h_year\" id=\"h_year1\">" + h_year + "</select>年&nbsp;";
            hstr += "<select name=\"h_month\" id=\"h_month1\">" + h_month + "</select>月&nbsp;";
            hstr += "<select name=\"h_day\" id=\"h_day1\">" + h_day + "</select>日&nbsp;";
            hstr += "<input type=\"image\" name=\"imageFields\" src=\"" + CommonData.SiteDomain + "/sysimages/folder/buttonreview.gif\" onclick=\"s_getHistoryindex();return false;\" /></form></div>" + newLine;
            hstr += "<script language=\"javascript\">" + newLine;
            hstr += "function s_getHistoryindex()" + newLine;
            hstr += "{" + newLine;
            hstr += "   var syear = index_historyindex1.h_year.options[index_historyindex1.h_year.selectedIndex].value;;" + newLine;
            hstr += "   var smonth = index_historyindex1.h_month.options[index_historyindex1.h_month.selectedIndex].value;" + newLine;
            hstr += "   var sday = index_historyindex1.h_day.options[index_historyindex1.h_day.selectedIndex].value;" + newLine;
            hstr += "   window.open('" + CommonData.SiteDomain + "/" + NetCMS.Config.UIConfig.dirPige + "/index/\'+syear+smonth+sday+\'.shtml\','_blank');return false;" + newLine;
            hstr += "}" + newLine;
            hstr += "</script>";
            return hstr;
        }

        /// <summary>
        /// 得到归档类型,JS日期列表
        /// </summary>
        /// <returns>得到显示样式</returns>
        public string getDateJs(string SaveIndexPage)
        {
            return "<iframe src=\"" + CommonData.SiteDomain + "/configuration/historyjs.html?dirpigs=" + CommonData.SiteDomain + "/" + NetCMS.Config.UIConfig.dirPige + "&startDate=" + NetCMS.Config.UIConfig.dirPigeDate + "&param=" + SaveIndexPage + "\" width=\"143px\" height=\"165px\" frameborder=\"0\" scrolling=\"no\" />";
        }

        /// <summary>
        /// 得到日期查询,表单类
        /// </summary>
        /// <returns>得到显示样式</returns>
        public string getDateForm(string SaveIndexPage)
        {
            string hstr = "";
            string h_year = "";
            string h_month = "";
            string h_day = "";
            for (int i = 2002; i <= DateTime.Now.Year; i++)
            {
                if (i == DateTime.Now.Year)
                {
                    h_year += "<option selected value=\"" + i + "\">" + i + "</option>\r";
                }
                else
                {
                    h_year += "<option value=\"" + i + "\">" + i + "</option>\r";
                }
            }
            for (int i1 = 1; i1 <= 12; i1++)
            {
                if (i1 == DateTime.Now.Month)
                {
                    h_month += "<option selected value=\"" + i1 + "\">" + i1 + "</option>\r";
                }
                else
                {
                    h_month += "<option value=\"" + i1 + "\">" + i1 + "</option>\r";
                }
            }
            for (int i2 = 1; i2 <= 31; i2++)
            {
                if (i2 == DateTime.Now.Day)
                {
                    h_day += "<option selected value=\"" + i2 + "\">" + i2 + "</option>\r";
                }
                else
                {
                    h_day += "<option value=\"" + i2 + "\">" + i2 + "</option>\r";
                }
            }
            hstr += "<div id=\"index_historydiv\"><form method=\"POST\" id=\"index_history1\"><select name=\"h_year\" id=\"h_year1\">" + h_year + "</select>年&nbsp;";
            hstr += "<select name=\"h_month\" id=\"h_month1\">" + h_month + "</select>月&nbsp;";
            hstr += "<select name=\"h_day\" id=\"h_day1\">" + h_day + "</select>日&nbsp;";
            hstr += "<input type=\"image\" name=\"imageFields\" src=\"" + CommonData.SiteDomain + "/sysimages/folder/buttonreview.gif\" onclick=\"s_getHistory();return false;\" /></form></div>" + newLine;
            hstr += "<script language=\"javascript\">" + newLine;
            hstr += "function s_getHistory()" + newLine;
            hstr += "{" + newLine;
            hstr += "   var syear = index_history1.h_year.options[index_history1.h_year.selectedIndex].value;;" + newLine;
            hstr += "   var smonth = index_history1.h_month.options[index_history1.h_month.selectedIndex].value;" + newLine;
            hstr += "   var sday = index_history1.h_day.options[index_history1.h_day.selectedIndex].value;" + newLine;
            hstr += "" + newLine;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -