//protected string LoadTitle(int p, int id) //{ // StringBuilder str = new StringBuilder(); // if (p != 0) // { // if (id != 0) // str.Append(ContentControl.GetContentField("Title", id)); // else // { // str.Append(ModControl.GetModField("Title", p)); // int cm = ConvertUtil.ReplaceInt(Request["cm"]); // int ck = ConvertUtil.ReplaceInt(Request["ck"]); // if (cm != 0) // str.Append(" - " + ModControl.GetModField("Name", cm)); // if (ck != 0) // str.Append(" - " + ModControl.GetModField("Name", ck)); // } // } // else // { // str.Append(ModControl.GetModField("Title", ModControl.GetP_From_Code("Home"))); // } // return str.ToString(); //} //protected string LoadKey(int p, int id) //{ // StringBuilder str = new StringBuilder(); // str.Append("<meta name=\"keywords\" content=\""); // if (p != 0) // { // if (id != 0) // str.Append(ContentControl.GetContentField("Key", id)); // else // str.Append(ModControl.GetModField("Key", p)); // int cm = ConvertUtil.ReplaceInt(Request["cm"]); // int ck = ConvertUtil.ReplaceInt(Request["ck"]); // if (cm != 0) // str.Append(" - " + ModControl.GetModField("Name", cm)); // if (ck != 0) // str.Append(" - " + ModControl.GetModField("Name", ck)); // } // else // str.Append(ModControl.GetModField("Key", ModControl.GetP_From_Code("Home"))); // str.Append("\" />"); // return str.ToString(); //} //protected string LoadDes(int p, int id) //{ // StringBuilder str = new StringBuilder(); // str.Append("<meta name=\"description\" content=\""); // if (p != 0) // { // if (id != 0) // str.Append(ContentControl.GetContentField("Meta", id)); // else // str.Append(ModControl.GetModField("Meta", p)); // int cm = ConvertUtil.ReplaceInt(Request["cm"]); // int ck = ConvertUtil.ReplaceInt(Request["ck"]); // if (cm != 0) // str.Append(" - " + ModControl.GetModField("Name", cm)); // if (ck != 0) // str.Append(" - " + ModControl.GetModField("Name", ck)); // } // else // str.Append(ModControl.GetModField("Meta", ModControl.GetP_From_Code("Home"))); // str.Append("\" />"); // return str.ToString(); //} protected string LoadSocial() { StringBuilder str = new StringBuilder(); string uRoot = ApplicationSetting.URLRoot; str.Append("<span>Follow us</span>"); str.Append("<span><a target=\"_blank\" href=\"" + CMSfunc._Title("urlFacebook") + "\"><img border=\"0\" align=\"absmiddle\" title=\"Facebook\" src=\"" + uRoot + "templates/sj_tech/images/icon-fb.png\"></a></span> "); str.Append("<span><a target=\"_blank\" href=\"" + CMSfunc._Title("urlTwitter") + "\"><img border=\"0\" align=\"absmiddle\" title=\"Twitter\" src=\"" + uRoot + "templates/sj_tech/images/icon-tw.png\"></a></span> "); str.Append("<span><a target=\"_blank\" href=\"" + CMSfunc._Title("urlGoogle") + "\"><img border=\"0\" align=\"absmiddle\" title=\"google plus\" src=\"" + uRoot + "templates/sj_tech/images/icon-gg.png\"></a></span> "); str.Append("<span><a target=\"_blank\" href=\"" + CMSfunc._Title("urlYoutube") + "\"><img border=\"0\" align=\"absmiddle\" title=\"Youtube\" src=\"" + uRoot + "templates/sj_tech/images/icon-yt.png\"></a></span> "); return(str.ToString()); }
public void LoadHeadTag(int p, int id) { StringBuilder str = new StringBuilder(); string CurrentURL = "http://apec.com.vn" + System.Web.HttpContext.Current.Request.CurrentExecutionFilePath.Replace("Default.aspx", string.Empty); string sql = ""; if (p != 0) { if (id != 0) { sql += "SELECT Content_Name,Content_Title,Content_Key,Content_Des,Content_Img FROM tbl_Content Where Mod_ID=" + p + " AND Content_ID=" + id + " AND Content_Status=1"; } else { sql += "SELECT Mod_Name,Mod_Title,Mod_Key,Mod_Des,Mod_Img FROM tbl_Mod Where Mod_ID=" + p + " AND Mod_Status=1"; } DataTable ds = UpdateData.UpdateBySql(sql).Tables[0]; DataRowCollection rows = ds.Rows; if (rows.Count > 0) { int cm = ConvertUtil.ReplaceInt(Request["cm"]); int ck = ConvertUtil.ReplaceInt(Request["ck"]); string str1 = (cm != 0) ? " - " + ModControl.GetModField("Name", cm) : ""; string str2 = (ck != 0) ? " - " + ModControl.GetModField("Name", ck) : ""; ltrTitle.Text = rows[0][1].ToString() + str1 + str2; this.ltrHeadTags.Text += string.Format("<meta name='keywords' content='{0}' />", rows[0][2] + str1 + str2); this.ltrHeadTags.Text += string.Format("<meta name='description' content='{0}' />", rows[0][3] + str1 + str2); this.ltrHeadTags.Text += string.Format("<meta property='og:image' content='{0}' />", rows[0][4]); this.ltrHeadTags.Text += string.Format("<meta property='og:title' content='{0}' />", rows[0][1]); this.ltrHeadTags.Text += string.Format("<meta property='og:description' content='{0}' />", rows[0][3]); this.ltrHeadTags.Text += string.Format("<meta property='og:site_name' content='{0}' />", rows[0][0]); this.ltrHeadTags.Text += string.Format("<meta property='og:url' content='{0}' />", CurrentURL); } } else { this.ltrHeadTags.Text += CMSfunc.LoadOther("Head-Tag-Home"); ltrTitle.Text = CMSfunc._Title("title-home"); } this.ltrHeadTags.Text += "<link rel=\"canonical\" href=\"" + CurrentURL + "\" />"; //this.ltrHeadTags.Text += CMSfunc.LoadOther("HeadContent"); }
public string pagelinkNews(int tongsotrang, int pagecurrent, string pagelinkfull) { if (pagelinkfull.Contains("/page/")) { pagelinkfull = pagelinkfull.Substring(0, pagelinkfull.LastIndexOf("page/")); } string text = "<ul class=\"pagination\">"; string text2 = CMSfunc._Title("First"); string text3 = CMSfunc._Title("Preview"); string text4 = CMSfunc._Title("Next"); string text5 = CMSfunc._Title("Last"); if (pagecurrent <= 1) { string text6 = text; text = string.Concat(new string[] { text6, "<li><a title=\"", text2, "\">", text2, "</a></li><li class=\"first2_end\"><a title=\"", text3, "\">‹</a></li>" }); } else { string text6 = text; text = string.Concat(new string[] { text6, "<li><a title=\"", text2, "\" href=\"", pagelinkfull, "\">", text2, "</a></li><li class=\"first2\"><a title=\"", text3, "\" href=\"", pagelinkfull, "page/", (pagecurrent - 1).ToString(), "/\">‹</a></li>" }); } if (tongsotrang <= 5) { for (int i = 1; i <= tongsotrang; i++) { string text7 = (i == 1) ? pagelinkfull : string.Concat(new object[] { pagelinkfull, "page/", i, "/" }); if (i == pagecurrent) { object obj = text; text = string.Concat(new object[] { obj, "<li><a>", i, "</a></li>" }); } else { object obj = text; text = string.Concat(new object[] { obj, "<li><a href=\"", text7, "\">", i, "</a></li>" }); } } } else if (pagecurrent < tongsotrang - 2) { int num = pagecurrent - 2; if (num < 1) { num = 1; } for (int i = num; i <= pagecurrent + 2; i++) { string text7 = (i == 1) ? pagelinkfull : string.Concat(new object[] { pagelinkfull, "page/", i, "/" }); if (i == pagecurrent) { text = text + "<li><a>" + i.ToString() + "</a></li>"; } else { object obj = text; text = string.Concat(new object[] { obj, "<li><a href=\"", text7, "\">", i, "</a></li>" }); } } } else { for (int i = tongsotrang - 5; i <= tongsotrang; i++) { string text7 = (i == 1) ? pagelinkfull : string.Concat(new object[] { pagelinkfull, "page/", i, "/" }); if (i == pagecurrent) { text = text + "<li><a>" + i.ToString() + "</a></li>"; } else { string text6 = text; text = string.Concat(new string[] { text6, "<li><a href=\"", text7, "\">", i.ToString(), "</a></li>" }); } } } if (pagecurrent == tongsotrang) { string text6 = text; text = string.Concat(new string[] { text6, "<li><a title=\"", text4, "\">›</a></li><li><a title=\"", text5, "\">", text5, "</a></li>" }); } else { string text6 = text; text = string.Concat(new string[] { text6, "<li><a title=\"", text4, "\" href=\"", pagelinkfull, "page/", (pagecurrent + 1).ToString(), "/\">›</a></li><li class=\"end2\"><a title=\"", text5, "\" href=\"", pagelinkfull, "page/", tongsotrang.ToString(), "/\">", text5, "</a></li>" }); } return(text + "</ul>"); }
public string pagelinkNews0(int tongsotrang, int pagecurrent, string pagelinkfull) { if (pagelinkfull.Contains("&page=")) { string[] separator = new string[] { "&" }; string[] array = pagelinkfull.Split(separator, StringSplitOptions.RemoveEmptyEntries); pagelinkfull = ""; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; if (!text.Contains("page=")) { pagelinkfull = pagelinkfull + text + "&"; } } if (pagelinkfull != "") { pagelinkfull = pagelinkfull.Substring(0, pagelinkfull.Length - 1); } } if (pagelinkfull.Contains("?page=")) { string[] separator = new string[] { "?" }; string[] array = pagelinkfull.Split(separator, StringSplitOptions.RemoveEmptyEntries); pagelinkfull = ""; string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text = array2[i]; if (!text.Contains("page=")) { pagelinkfull = pagelinkfull + text + "?"; } } if (pagelinkfull != "") { pagelinkfull = pagelinkfull.Substring(0, pagelinkfull.Length - 1); } } string str = pagelinkfull.Contains("?") ? "&page=" : "?page="; pagelinkfull += str; string text2 = "<ul class=\"phantrang0 clearfix\">"; string text3 = CMSfunc._Title("First"); string text4 = CMSfunc._Title("Preview"); string text5 = CMSfunc._Title("Next"); string text6 = CMSfunc._Title("Last"); if (pagecurrent <= 1) { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li class=\"first_end\"><a title=\"", text3, "\">", text3, "</a></li><li class=\"first2_end\"><a title=\"", text4, "\">‹</a></li>" }); } else { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li class=\"first\"><a title=\"", text3, "\" href=\"", pagelinkfull, "\">", text3, "</a></li><li class=\"first2\"><a title=\"", text4, "\" href=\"", pagelinkfull, (pagecurrent - 1).ToString(), "\">‹</a></li>" }); } if (tongsotrang <= 5) { for (int j = 1; j <= tongsotrang; j++) { if (j == pagecurrent) { text2 = text2 + "<li class=\"act\"><a>" + j.ToString() + "</a></li>"; } else { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li><a href=\"", pagelinkfull, j.ToString(), "\">", j.ToString(), "</a></li>" }); } } } else if (pagecurrent < tongsotrang - 2) { int num = pagecurrent - 2; if (num < 1) { num = 1; } for (int j = num; j <= pagecurrent + 2; j++) { if (j == pagecurrent) { text2 = text2 + "<li class=\"act\"><a>" + j.ToString() + "</a></li>"; } else { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li><a href=\"", pagelinkfull, j.ToString(), "\">", j.ToString(), "</a></li>" }); } } } else { for (int j = tongsotrang - 5; j <= tongsotrang; j++) { if (j == pagecurrent) { text2 = text2 + "<li class=\"act\"><a>" + j.ToString() + "</a></li>"; } else { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li><a href=\"", pagelinkfull, j.ToString(), "\">", j.ToString(), "</a></li>" }); } } } if (pagecurrent == tongsotrang) { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li class=\"end_end\"><a title=\"", text5, "\">›</a></li><li class=\"end2_end\"><a title=\"", text6, "\">", text6, "</a></li>" }); } else { string text7 = text2; text2 = string.Concat(new string[] { text7, "<li class=\"end\"><a title=\"", text5, "\" href=\"", pagelinkfull, (pagecurrent + 1).ToString(), "\">›</a></li><li class=\"end2\"><a title=\"", text6, "\" href=\"", pagelinkfull, tongsotrang.ToString(), "\">", text6, "</a></li>" }); } return(text2 + "</ul>"); }