public static bool CreateArticleHtml_Wap(int art_id, string title, string title1, string source, int articleType, string articleTypeName, string content, string keyword, string imgUrl, string article_html, string tag, string tagId, string tagIdHtml, string search_keyword) { Hashtable artHt = new Hashtable(); artHt.Add("$title", title); // artHt.Add("$titl_e1", title1); // artHt.Add("$source", source); // artHt.Add("$articleType", articleType); // artHt.Add("$article_TypeName", articleTypeName); // artHt.Add("$content", content); // artHt.Add("$keyword", keyword); // if (imgUrl.Trim() != "" && !content.Contains("<img")) { artHt.Add("$imgStr", "<img src='/Article_File/af/" + imgUrl + "'/>");// } else { artHt.Add("$imgStr", "");// } if (tag.Trim() != "") { string tagStr = ""; string[] array = tag.Split(' '); string[] arrayId = CommonMethod.GetArrayNoEmpty(tagId.Split(',')); for (int i = 0; i < array.Length; i++) { if (array[i].Trim() != "") { tagStr += "<a href='/wap/list.aspx?tag=" + arrayId[i] + "'>" + array[i] + "</a> ";//<a href="#" target="_blank">温州人</a> } } artHt.Add("$tag", "<div class='div_tag'>标签:" + tagStr + "</div>"); //<div class="div_tag">标签:<a href="#">妈咪日记</a> <a href="#">青岛母婴用品</a></div> artHt.Add("$xiangguanShow", ""); //显示相关文章 } else { artHt.Add("$tag", ""); artHt.Add("$xiangguanShow", "none");////隐藏相关文章 } if (tagIdHtml.Trim() != "") { artHt.Add("$_tagUrl", "/tag/" + tagIdHtml + ".html");//<!--#include file="$_tagUrl"--> "<!--#include file='/tag/" + tagIdHtml + ".html'-->" } else { artHt.Add("$_tagUrl", "/tag/0.html");//无相关文章,引用页为无内容 } //模版文件 存放路径 string sourceFilePath = HttpRuntime.AppDomainAppPath.ToString() + "/wap/article/content1.html"; //生成后文件 存放的 路径 string spanFilePath = HttpRuntime.AppDomainAppPath.ToString() + "\\wap"; CommonMethod cm = new CommonMethod(); return(cm.WriteHTML(artHt, sourceFilePath, spanFilePath, article_html)); //生成wap静态页 }
public static bool CreateArticleHtml(int art_id, string title, string title1, string source, int articleType, string articleTypeName, string content, string keyword, string imgUrl, string article_html, string tag, string tagId, string tagIdHtml, string update_date, string last_html, string last_title, string next_html, string next_title, string search_keyword) { Hashtable artHt = new Hashtable(); artHt.Add("$title", title); // artHt.Add("$titl_e1", title1); // if (source.Trim() == "") { //source = "<a href='http://www.up927.com/' target='_blank' title='好宝宝早教网_" + articleTypeName + "'>好宝宝早教网</a>"; source = "毛豆妈咪"; } artHt.Add("$source", source); // artHt.Add("$articleType", articleType); // artHt.Add("$article_TypeName", articleTypeName); //articleTypeName artHt.Add("$content", content); // artHt.Add("$keyword", keyword); // //artHt.Add("$tag", tag); artHt.Add("$update_date", update_date); artHt.Add("$last_html", last_html); artHt.Add("$last_title", last_title); artHt.Add("$next_html", next_html); artHt.Add("$next_title", next_title); if (search_keyword.Trim() != "") { string tagStr = ""; string[] array = search_keyword.Split(' '); for (int i = 0; i < array.Length; i++) { if (array[i].Trim() != "") { tagStr += "<a href='/list.aspx?title=" + System.Web.HttpUtility.UrlEncode(array[i]) + "' target='_blank'>" + array[i] + "</a> ";//<a href="#" target="_blank">温州人</a> } } artHt.Add("$search_keyword", "<div class='zx_tag' align='left'>相关搜索:" + tagStr + "</div>"); //artHt.Add("$search_keyword", search_keyword); } else { artHt.Add("$search_keyword", ""); } if (tag.Trim() != "") { string tagStr = ""; string[] array = tag.Split(' '); string[] arrayId = CommonMethod.GetArrayNoEmpty(tagId.Split(',')); for (int i = 0; i < array.Length; i++) { if (array[i].Trim() != "") { tagStr += "<a href='/list.aspx?tag=" + arrayId[i] + "' target='_blank'>" + array[i] + "</a> ";//<a href="#" target="_blank">温州人</a> } } artHt.Add("$tag", "<div class='zx_tag' align='left'>标签:" + tagStr + "</div>"); artHt.Add("$xiangguanShow", "");//显示相关文章 } else { artHt.Add("$tag", ""); artHt.Add("$xiangguanShow", "none");////隐藏相关文章 } if (tagIdHtml.Trim() != "") { artHt.Add("$_tagUrl", "/tag/" + tagIdHtml + ".html");//<!--#include file="$_tagUrl"--> "<!--#include file='/tag/" + tagIdHtml + ".html'-->" } else { artHt.Add("$_tagUrl", "/tag/0.html");//无相关文章,引用页为无内容 } //if (imgUrl.Trim() != "") //{ // artHt.Add("$imgStr", "<img src='/Article_File/" + imgUrl + "'/>");// //} //else //{ // artHt.Add("$imgStr", "");// //} //模版文件 存放路径 string sourceFilePath = HttpRuntime.AppDomainAppPath.ToString() + "/template/detail_2.html"; //生成后文件 存放的 路径 string spanFilePath = HttpRuntime.AppDomainAppPath.ToString(); CommonMethod cm = new CommonMethod(); return(cm.WriteHTML(artHt, sourceFilePath, spanFilePath, article_html)); //生成静态页 }