highlight.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. class highlight_c extends Control
  3. {
  4. function __construct()
  5. {
  6. parent::Control();
  7. $this->load_model("module");
  8. $this->load_model("cate");
  9. $this->load_model("list");
  10. }
  11. function highlight_c()
  12. {
  13. $this->__construct();
  14. }
  15. //读取列表
  16. function index_f()
  17. {
  18. exit("ERROR!");
  19. }
  20. function module_f()
  21. {
  22. $condition = array();
  23. $condition["langid"] = $_SESSION["sys_lang_id"];
  24. $condition["ctrl_init"] = "list";
  25. $condition["array"]["if_list"] = 1;
  26. $condition["array"]["if_msg"] = 1;
  27. $pageid = $this->trans_lib->int(SYS_PAGEID);
  28. $rslist = $this->module_m->get_list($pageid,$condition);
  29. $this->tpl->assign("rslist",$rslist);
  30. $total = $this->module_m->get_count();//读取模块总数
  31. $page_url = $this->url("highlight,module");
  32. $pagelist = $this->page_lib->page($page_url,$total);
  33. $this->tpl->assign("pagelist",$pagelist);
  34. $this->tpl->assign("type","module");
  35. $id = $this->trans_lib->int("id");
  36. $this->tpl->assign("id",$id);
  37. $this->tpl->display("highlight/module.html");
  38. }
  39. function cate_f()
  40. {
  41. $this->cate_m->langid($_SESSION["sys_lang_id"]);
  42. $this->cate_m->get_all();
  43. $this->cate_m->format_list(0,0);
  44. $catelist = $this->cate_m->flist();
  45. if(!is_array($catelist)) $catelist = array();
  46. foreach($catelist AS $key=>$value)
  47. {
  48. $value["space"] = "";
  49. for($i=0;$i<$value["level"];$i++)
  50. {
  51. $value["space"] .= "  ";
  52. }
  53. $catelist[$key] = $value;
  54. }
  55. $this->tpl->assign("catelist",$catelist);
  56. $id = $this->trans_lib->safe("id");
  57. $idlist = array();
  58. if($id)
  59. {
  60. $idlist = sys_id_list($id);
  61. }
  62. $this->tpl->assign("idlist",$idlist);
  63. $this->tpl->display("highlight/cate.html");
  64. }
  65. function subject_f()
  66. {
  67. $page_url = $this->url("highlight,subject");
  68. $pageid = $this->trans_lib->int(SYS_PAGEID);
  69. $condition = "l.langid='".$_SESSION["sys_lang_id"]."' ";
  70. $condition.= " AND m.ctrl_init='list' AND m.if_msg='1' ";
  71. $keywords = $this->trans_lib->safe("keywords");
  72. if($keywords)
  73. {
  74. $condition .= " AND l.title LIKE '%".$keywords."%' ";
  75. $page_url .= "keywords=".rawurlencode($keywords)."&";
  76. }
  77. $rslist = $this->list_m->get_link($pageid,$condition);
  78. $this->tpl->assign("rslist",$rslist);
  79. $total_count = $this->list_m->get_link_count($condition);//取得总数
  80. $pagelist = $this->page_lib->page($page_url,$total_count);
  81. $this->tpl->assign("pagelist",$pagelist);
  82. $id = $this->trans_lib->int("id");
  83. $this->tpl->assign("id",$id);
  84. $this->tpl->display("highlight/subject.html");
  85. }
  86. }
  87. ?>