private string Module_List() { string tmpstr = ""; string tmpastr, tmprstr, tmptstr; int tpage = cls.getNum(request.querystring("page")); string tfield = cls.getSafeString(request.querystring("field")); string tkeyword = cls.getSafeString(request.querystring("keyword")); string tnav = cls.getSafeString(request.querystring("hspan")); tmpstr = jt.itake("manage.list", "tpl"); tmprstr = ""; tmpastr = cls.ctemplate(ref tmpstr, "{@}"); string tdatabase = cls.getString(jt.itake("global.config.sys->upload-ndatabase", "cfg")); string tfpre = cls.getString(jt.itake("global.config.sys->upload-nfpre", "cfg")); string tsqlstr = "select * from " + tdatabase + " where " + cls.cfnames(tfpre, "id") + ">0"; if (tfield == "filename") tsqlstr += " and " + cls.cfnames(tfpre, "filename") + " like '%" + tkeyword + "%'"; if (tfield == "genre") tsqlstr += " and " + cls.cfnames(tfpre, "genre") + " like '%" + tkeyword + "%'"; if (tfield == "valid") tsqlstr += " and " + cls.cfnames(tfpre, "valid") + "=" + cls.getNum(tkeyword); if (tfield == "id") tsqlstr += " and " + cls.cfnames(tfpre, "id") + "=" + cls.getNum(tkeyword); tsqlstr += " order by " + cls.cfnames(tfpre, "time") + " desc"; pagi pagi; pagi = new pagi(); pagi.db = db; pagi.sqlstr = tsqlstr; pagi.pagenum = tpage; pagi.rslimit = cls.getNum(jt.itake("config.nlisttopx", "cfg")); pagi.pagesize = cls.getNum(jt.itake("config.npagesize", "cfg")); pagi.Init(); object[] tArys = pagi.getDataAry(); if (tArys != null) { for (int tis = 0; tis < tArys.Length; tis++) { tmptstr = tmpastr; object[,] tAry = (object[,])tArys[tis]; for (int ti = 0; ti < tAry.GetLength(0); ti++) { tAry[ti, 0] = (object)cls.getLRStr((string)tAry[ti, 0], tfpre, "rightr"); tmptstr = tmptstr.Replace("{$" + cls.toString(tAry[ti, 0]) + "}", encode.htmlencode(cls.toString(tAry[ti, 1]))); } string tFileType = (string)db.getValue(tAry, "filename"); tFileType = cls.getLRStr(tFileType, ".", "right"); tFileType = tFileType.ToLower(); tmptstr = tmptstr.Replace("{$-filetype}", tFileType); tmptstr = tmptstr.Replace("{$-vlreason}", PP_GetVLReason((int)db.getValue(tAry, "valid"), (int)db.getValue(tAry, "vlreason"))); tmprstr += tmptstr; } } tmpstr = tmpstr.Replace(config.jtbccinfo, tmprstr); tmpstr = jt.creplace(tmpstr); #region �������˷�ҳ pagi_plus pagi_plus = new pagi_plus(pagi); string pagerUrl = config.nuri + "?"; if (!cls.isEmpty(tfield)) pagerUrl += string.Format("{0}field={1}", pagerUrl.EndsWith("?") ? "" : "&", tfield); if (!cls.isEmpty(tkeyword)) pagerUrl += string.Format("{0}keyword={1}", pagerUrl.EndsWith("?") ? "" : "&", tkeyword); if (!cls.isEmpty(tnav)) pagerUrl += string.Format("{0}hspan={1}", pagerUrl.EndsWith("?") ? "" : "&", tnav); pagerUrl += pagerUrl.EndsWith("?") ? "page=[$page]" : "&page=[$page]"; string pager = pagi_plus.pager(pagerUrl, 9); tmpstr = tmpstr.Replace("{$pager}", pager); tmpstr = tmpstr.Replace("{$page}", cls.toString(pagi.pagenum)); #endregion string tmpstrp = jt.itake("manage.public", "tpl"); tmpstr = tmpstrp.Replace("{$content}", tmpstr); tmpstr = jt_plus.creplace(tmpstr); return tmpstr; }
private string Module_List() { //���ղ��� string tgenre = cls.getSafeString(request.querystring("genre")); if (cls.isEmpty(tgenre)) tgenre = Sub_GetDefaultGenre(); int tfid = cls.getNum(request.querystring("fid"), 0); int tpage = cls.getNum(request.querystring("page")); string tnav = cls.getSafeString(request.querystring("hspan")); //��ȡģ�������������HTML string tmpstr = ""; string tmpastr, tmprstr, tmptstr; tmpstr = jt.itake("manage.list", "tpl"); tmprstr = ""; tmpastr = cls.ctemplate(ref tmpstr, "{@}"); string tdatabase = cls.getString(jt.itake("global.config.sys->category-ndatabase", "cfg")); string tfpre = cls.getString(jt.itake("global.config.sys->category-nfpre", "cfg")); string tsqlstr = "select * from " + tdatabase + " where " + cls.cfnames(tfpre, "lng") + "=" + admin.slng + " and " + cls.cfnames(tfpre, "genre") + "='" + tgenre + "' and " + cls.cfnames(tfpre, "fid") + "=" + tfid + " order by " + cls.cfnames(tfpre, "order") + " asc"; pagi pagi; pagi = new pagi(); pagi.db = db; pagi.sqlstr = tsqlstr; pagi.pagenum = tpage; pagi.rslimit = cls.getNum(jt.itake("config.nlisttopx", "cfg")); pagi.pagesize = cls.getNum(jt.itake("config.npagesize", "cfg")); pagi.Init(); object[] tArys = pagi.getDataAry(); if (tArys != null) { for (int tis = 0; tis < tArys.Length; tis++) { tmptstr = tmpastr; object[,] tAry = (object[,])tArys[tis]; for (int ti = 0; ti < tAry.GetLength(0); ti++) { tAry[ti, 0] = (object)cls.getLRStr((string)tAry[ti, 0], tfpre, "rightr"); tmptstr = tmptstr.Replace("{$" + cls.toString(tAry[ti, 0]) + "}", encode.htmlencode(cls.toString(tAry[ti, 1]))); } tmprstr += tmptstr; } } tmpstr = tmpstr.Replace(config.jtbccinfo, tmprstr); #region ��ҳ pagi_plus pagi_plus = new pagi_plus(pagi); string pagerUrl = config.nuri + "?"; if (!cls.isEmpty(tgenre)) pagerUrl += string.Format("{0}genre={1}", pagerUrl.EndsWith("?") ? "" : "&", tgenre); if (tfid != 0) pagerUrl += string.Format("{0}fid={1}", pagerUrl.EndsWith("?") ? "" : "&", tfid); if (!cls.isEmpty(tnav)) pagerUrl += string.Format("{0}hspan={1}", pagerUrl.EndsWith("?") ? "" : "&", tnav); pagerUrl += pagerUrl.EndsWith("?") ? "page=[$page]" : "&page=[$page]"; string pager = pagi_plus.pager(pagerUrl, 9); tmpstr = tmpstr.Replace("{$pager}", pager); tmpstr = tmpstr.Replace("{$page}", cls.toString(pagi.pagenum)); #endregion tmpstr = tmpstr.Replace("{$category.FaCatHtml}", category.getFaCatHtml(jt.itake("manage.data_fa_category", "tpl"), tgenre, admin.slng, tfid)); tmpstr = jt.creplace(tmpstr); string tmpstrp = jt.itake("manage.public", "tpl"); tmpstrp = tmpstrp.Replace("{$content}", tmpstr); tmpstr = jt_plus.creplace(tmpstrp); tmpstr = tmpstr.Replace("{$selcolumn}", Sub_Selcolumn(tgenre)); tmpstr = tmpstr.Replace("{$genre}", tgenre); tmpstr = tmpstr.Replace("{$fid}", tfid.ToString()); return tmpstr; }