Пример #1
0
        public static string LoadSkin(string code, int p)
        {
            HttpContext       current       = HttpContext.Current;
            StringBuilder     stringBuilder = new StringBuilder();
            DataSet           dataSet       = UpdateData.UpdateBySql("SELECT Skintype_ID,Skintype_Viewtype,Skintype_Vspace,Skintype_Hspace,Skintype_Height,Skintype_Width,Skintype_Limit,Skintype_Target FROM tbl_Skintype WHERE Skintype_Status=1 AND Skintype_Code='" + code + "'");
            DataRowCollection rows          = dataSet.Tables[0].Rows;

            if (rows.Count > 0)
            {
                string text  = rows[0]["Skintype_ID"].ToString();
                bool   flag  = Convert.ToBoolean(rows[0]["Skintype_Viewtype"]);
                string text2 = rows[0]["Skintype_Vspace"].ToString();
                string text3 = rows[0]["Skintype_Hspace"].ToString();
                int    num   = Convert.ToInt32(rows[0]["Skintype_Limit"]);
                string ta    = rows[0]["Skintype_Target"].ToString().Trim();
                string text4 = string.Concat(new object[]
                {
                    "SELECT top ",
                    num,
                    " Mod_ID,Skin_ID,Skin_Name,Skin_Url,Skin_Height,Skin_Width,Skin_Link FROM tbl_Skin WHERE lang=",
                    current.Session["vlang"],
                    " AND Skin_Status=1 AND Skintype_ID=",
                    text
                });
                text4 += " ORDER BY Skin_Pos";
                string            vtype    = flag ? "<br />" : "";
                DataSet           dataSet2 = UpdateData.UpdateBySql(text4);
                DataRowCollection rows2    = dataSet2.Tables[0].Rows;
                for (int i = 0; i < rows2.Count; i++)
                {
                    int    id   = Convert.ToInt32(rows2[0]["Skin_ID"]);
                    int    num2 = Convert.ToInt32(rows2[0]["Mod_ID"]);
                    string n    = rows2[i]["Skin_Name"].ToString();
                    string img  = ApplicationSetting.URLRoot + rows2[i]["Skin_Url"].ToString();
                    string h    = rows2[i]["Skin_Height"].ToString();
                    string w    = rows2[i]["Skin_Width"].ToString();
                    string url  = rows2[i]["Skin_Link"].ToString();
                    if (num2 == -1)
                    {
                        stringBuilder.Append(CMSfunc._adv(ta, img, id, url, vtype, w, h, n));
                    }
                    else if (num2 == p || ModControl.GetOldP(p) == num2)
                    {
                        stringBuilder.Append(CMSfunc._adv(ta, img, id, url, vtype, w, h, n));
                    }
                }
            }
            else
            {
                stringBuilder.Append(CMSfunc.LoadOther(code));
            }
            return(stringBuilder.ToString());
        }
Пример #2
0
        public static string ReWriteUrlMod(object modid)
        {
            string modName = ModControl.GetModName(modid);
            string modUrl  = ModControl.GetModUrl(modid);

            if (modUrl.Length > 0)
            {
                return((CMSfunc.uRoot + "san-pham/" + modUrl + ".htm").Replace("--", "-").ToLower());
            }
            if (modUrl.Trim().Length <= 0)
            {
                return((CMSfunc.uRoot + ApplicationUtil.GetTitle(modName) + ".htm").Replace("--", "-").ToLower());
            }
            if (modUrl.Contains("http://"))
            {
                return(modUrl);
            }
            if (!modUrl.Contains("~/"))
            {
                return(CMSfunc.uRoot + modUrl);
            }
            return(VirtualPathUtility.ToAbsolute(modUrl));
        }
Пример #3
0
        public static string LoadPath(int p, int id)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<ul>");
            int p_From_Code = ModControl.GetP_From_Code("Home");

            stringBuilder.Append(string.Concat(new string[]
            {
                "    <li><a title=\"",
                ModControl.GetModField("Title", p_From_Code),
                "\" href=\"",
                VirtualPathUtility.ToAbsolute("~/"),
                "\">",
                CMSfunc._Title("home"),
                "</a></li>"
            }));
            if (ModControl.GetOldP(ModControl.GetOldP(p)) != 0)
            {
                int    oldP = ModControl.GetOldP(ModControl.GetOldP(p));
                string text = VirtualPathUtility.ToAbsolute("~/" + ModControl.GetModCode(oldP) + ".htm");
                stringBuilder.Append(string.Concat(new string[]
                {
                    "    <li><a title=\"",
                    ModControl.GetModField("Name", oldP),
                    "\" href=\"",
                    text,
                    "\">",
                    ModControl.GetModField("Name", oldP),
                    "</a></li>"
                }));
            }
            if (ModControl.GetOldP(p) != 0)
            {
                int    oldP2 = ModControl.GetOldP(p);
                string text  = VirtualPathUtility.ToAbsolute("~/" + ModControl.GetModCode(oldP2) + ".htm");
                stringBuilder.Append(string.Concat(new string[]
                {
                    "<li><a title=\"",
                    ModControl.GetModField("Name", oldP2),
                    "\" href=\"",
                    text,
                    "\">",
                    ModControl.GetModField("Name", oldP2),
                    "</a></li>"
                }));
            }
            if (p != 0)
            {
                string text = VirtualPathUtility.ToAbsolute("~/" + ModControl.GetModCode(p) + ".htm");
                stringBuilder.Append(string.Concat(new string[]
                {
                    "<li><a title=\"",
                    ModControl.GetModField("Name", p),
                    "\" href=\"",
                    text,
                    "\">",
                    ModControl.GetModField("Name", p),
                    "</a></li>"
                }));
            }
            stringBuilder.Append("</ul>");
            return(stringBuilder.ToString());
        }
Пример #4
0
        public static string LoadSkinP(string code, int p)
        {
            HttpContext       current       = HttpContext.Current;
            StringBuilder     stringBuilder = new StringBuilder();
            DataSet           dataSet       = UpdateData.UpdateBySql("SELECT Skintype_ID,Skintype_Viewtype,Skintype_Vspace,Skintype_Hspace,Skintype_Height,Skintype_Width,Skintype_Limit,Skintype_Target FROM tbl_Skintype WHERE Skintype_Status=1 AND Skintype_Code='" + code + "'");
            DataRowCollection rows          = dataSet.Tables[0].Rows;

            if (rows.Count > 0)
            {
                string text  = rows[0]["Skintype_ID"].ToString();
                bool   flag  = Convert.ToBoolean(rows[0]["Skintype_Viewtype"]);
                string text2 = rows[0]["Skintype_Vspace"].ToString();
                string text3 = rows[0]["Skintype_Hspace"].ToString();
                int    num   = Convert.ToInt32(rows[0]["Skintype_Limit"]);
                string text4 = rows[0]["Skintype_Target"].ToString().Trim();
                string text5 = string.Concat(new object[]
                {
                    "SELECT top ",
                    num,
                    " Skin_ID,Skin_Name,Skin_Url,Skin_Height,Skin_Width,Skin_Link FROM tbl_Skin WHERE Skin_Status=1 AND Skintype_ID=",
                    text
                });
                if (p != 0)
                {
                    if (ModControl.GetLevel(p) == 2)
                    {
                        p = ModControl.GetOldP(p);
                    }
                    if (ModControl.GetLevel(p) == 3)
                    {
                        p = ModControl.GetOldP(ModControl.GetOldP(p));
                    }
                    text5 = text5 + " AND Mod_ID=" + p;
                }
                else
                {
                    text5 += " AND Mod_ID=-1";
                }
                text5 += " ORDER BY Skin_Pos";
                string            text6    = flag ? "<br />" : "";
                DataSet           dataSet2 = UpdateData.UpdateBySql(text5);
                DataRowCollection rows2    = dataSet2.Tables[0].Rows;
                for (int i = 0; i < rows2.Count; i++)
                {
                    string text7  = rows2[0]["Skin_ID"].ToString();
                    string text8  = rows2[i]["Skin_Name"].ToString();
                    string text9  = ApplicationSetting.URLRoot + rows2[i]["Skin_Url"].ToString();
                    string text10 = rows2[i]["Skin_Height"].ToString();
                    string text11 = rows2[i]["Skin_Width"].ToString();
                    string text12 = rows2[i]["Skin_Link"].ToString();
                    if (Path.GetExtension(text9) == ".swf")
                    {
                        stringBuilder.Append(string.Concat(new string[]
                        {
                            "<a target=\"",
                            text4,
                            "\" href=\"",
                            ApplicationSetting.URLRoot,
                            "aspx/SaveProcess.aspx?id=",
                            text7,
                            "&url=",
                            text12,
                            "\"><script type=\"text/javascript\">swf('",
                            text9,
                            "','",
                            text11,
                            "','",
                            text10,
                            "');</script></a>",
                            text6
                        }));
                    }
                    else if (flag)
                    {
                        if (text12 != "")
                        {
                            stringBuilder.Append(string.Concat(new string[]
                            {
                                "<a target=\"",
                                text4,
                                "\" href=\"",
                                ApplicationSetting.URLRoot,
                                "aspx/SaveProcess.aspx?id=",
                                text7,
                                "&url=",
                                text12,
                                "\"><img src=\"",
                                text9,
                                "\" width=\"",
                                text11,
                                "\" height=\"",
                                text10,
                                "\" vspace=\"",
                                text2,
                                "\" border=\"0\" alt=\"",
                                text8,
                                "\"></a>",
                                text6
                            }));
                        }
                        else
                        {
                            stringBuilder.Append(string.Concat(new string[]
                            {
                                "<img src=\"",
                                text9,
                                "\" width=\"",
                                text11,
                                "\" height=\"",
                                text10,
                                "\" border=\"0\" vspace=\"",
                                text2,
                                "\" alt=\"",
                                text8,
                                "\"><br>"
                            }));
                        }
                    }
                    else if (text12 != "")
                    {
                        stringBuilder.Append(string.Concat(new string[]
                        {
                            "<a target=\"",
                            text4,
                            "\" href=\"",
                            ApplicationSetting.URLRoot,
                            "aspx/SaveProcess.aspx?id=",
                            text7,
                            "&url=",
                            text12,
                            "\"><img src=\"",
                            text9,
                            "\" width=\"",
                            text11,
                            "\" hspace=\"",
                            text3,
                            "\" height=\"",
                            text10,
                            "\" border=\"0\" alt=\"",
                            text8,
                            "\"></a>"
                        }));
                    }
                    else
                    {
                        stringBuilder.Append(string.Concat(new string[]
                        {
                            "<img src=\"",
                            text9,
                            "\" width=\"",
                            text11,
                            "\" height=\"",
                            text10,
                            "\" hspace=\"",
                            text3,
                            "\" border=\"0\" alt=\"",
                            text8,
                            "\">"
                        }));
                    }
                }
            }
            return(stringBuilder.ToString());
        }