Esempio n. 1
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["media"]["browse"]) && !$this->is_super) {
         return array("alert" => "x070301");
     }
     if (!is_array($this->mimeRows)) {
         return array("alert" => "x070405");
     }
     $_arr_search = array("box" => fn_getSafe(fn_get("box"), "txt", "normal"), "key" => fn_getSafe(fn_get("key"), "txt", ""), "year" => fn_getSafe(fn_get("year"), "txt", ""), "month" => fn_getSafe(fn_get("month"), "txt", ""), "ext" => fn_getSafe(fn_get("ext"), "txt", ""), "admin_id" => fn_getSafe(fn_get("admin_id"), "int", 0));
     //搜索设置
     $_num_mediaCount = $this->mdl_media->mdl_count($_arr_search);
     $_arr_page = fn_page($_num_mediaCount);
     $_str_query = http_build_query($_arr_search);
     $_arr_yearRows = $this->mdl_media->mdl_year(100);
     $_arr_extRows = $this->mdl_media->mdl_ext();
     $_arr_mediaRows = $this->mdl_media->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_arr_search);
     $_arr_searchAll = array("box" => "normal");
     //搜索设置
     $_arr_searchRecycle = array("box" => "recycle");
     //搜索设置
     $_arr_mediaCount["all"] = $this->mdl_media->mdl_count($_arr_searchAll);
     $_arr_mediaCount["recycle"] = $this->mdl_media->mdl_count($_arr_searchRecycle);
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "mediaCount" => $_arr_mediaCount, "mediaRows" => $_arr_mediaRows, "yearRows" => $_arr_yearRows, "extRows" => $_arr_extRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("media_list.tpl", $_arr_tplData);
     return array("alert" => "y070301");
 }
Esempio n. 2
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["attach"]["mime"])) {
         return array("alert" => "x080301");
         exit;
     }
     $_num_mimeId = fn_getSafe(fn_get("mime_id"), "int", 0);
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "mime_id" => $_num_mimeId);
     $_num_mimeCount = $this->mdl_mime->mdl_count();
     $_arr_page = fn_page($_num_mimeCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_mimeRows = $this->mdl_mime->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"]);
     foreach ($_arr_mimeRows as $_key => $_value) {
         unset($this->mime[$_value["mime_name"]]);
     }
     if ($_num_mimeId > 0) {
         $_arr_mimeRow = $this->mdl_mime->mdl_read($_num_mimeId);
         if ($_arr_mimeRow["alert"] != "y080102") {
             return $_arr_mimeRow;
             exit;
         }
     } else {
         $_arr_mimeRow = array("mime_id" => 0, "mime_name" => "", "mime_ext" => "", "mime_note" => "");
     }
     $_arr_tpl = array("query" => $_str_query, "search" => $_arr_search, "mimeJson" => json_encode($this->mime), "mimeOften" => $this->mime, "pageRow" => $_arr_page, "mimeRows" => $_arr_mimeRows, "mimeRow" => $_arr_mimeRow);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("mime_list.tpl", $_arr_tplData);
     return array("alert" => "y080301");
 }
Esempio n. 3
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     $_num_userId = fn_getSafe(fn_get("user_id"), "int", 0);
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "status" => $_str_status);
     if ($_num_userId > 0) {
         if (!isset($this->adminLogged["admin_allow"]["user"]["edit"])) {
             return array("alert" => "x010303");
             exit;
         }
         $_arr_userRow = $this->mdl_user->mdl_read($_num_userId);
         if ($_arr_userRow["alert"] != "y010102") {
             return $_arr_userRow;
             exit;
         }
     } else {
         if (!isset($this->adminLogged["admin_allow"]["user"]["browse"])) {
             return array("alert" => "x010301");
             exit;
         }
         $_arr_userRow = array("user_id" => 0, "user_mail" => "", "user_nick" => "", "user_note" => "", "user_status" => "enable");
     }
     $_num_userCount = $this->mdl_user->mdl_count($_str_key, $_str_status);
     $_arr_page = fn_page($_num_userCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_userRows = $this->mdl_user->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_status);
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "userRow" => $_arr_userRow, "userRows" => $_arr_userRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("user_list.tpl", $_arr_tplData);
     return array("alert" => "y010302");
 }
Esempio n. 4
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["attach"]["thumb"])) {
         return array("alert" => "x090301");
         exit;
     }
     $_num_thumbId = fn_getSafe(fn_get("thumb_id"), "int", 0);
     $_arr_search = array("act_get" => $GLOBALS["act_get"]);
     $_num_thumbCount = $this->mdl_thumb->mdl_count();
     $_arr_page = fn_page($_num_thumbCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_thumbRows = $this->mdl_thumb->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"]);
     if ($_num_thumbId > 0) {
         $_arr_thumbRow = $this->mdl_thumb->mdl_read($_num_thumbId);
         if ($_arr_thumbRow["alert"] != "y090102") {
             return $_arr_thumbRow;
             exit;
         }
     } else {
         $_arr_thumbRow = array("thumb_id" => 0, "thumb_type" => "ratio", "thumb_width" => "", "thumb_height" => "");
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "thumbRows" => $_arr_thumbRows, "thumbRow" => $_arr_thumbRow);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("thumb_list.tpl", $_arr_tplData);
     return array("alert" => "y090301");
 }
Esempio n. 5
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["article"]["tag"])) {
         return array("alert" => "x130301");
         exit;
     }
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_num_tagId = fn_getSafe(fn_get("tag_id"), "int", 0);
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "status" => $_str_status);
     $_num_tagCount = $this->mdl_tag->mdl_count($_str_key, $_str_status);
     $_arr_page = fn_page($_num_tagCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_tagRows = $this->mdl_tag->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_status);
     if ($_num_tagId > 0) {
         $_arr_tagRow = $this->mdl_tag->mdl_read($_num_tagId);
         if ($_arr_tagRow["alert"] != "y130102") {
             return $_arr_tagRow;
             exit;
         }
     } else {
         $_arr_tagRow = array("tag_id" => 0, "tag_name" => "", "tag_status" => "show");
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "tagRow" => $_arr_tagRow, "tagRows" => $_arr_tagRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("tag_list.tpl", $_arr_tplData);
     return array("alert" => "y130301");
 }
Esempio n. 6
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["opt"]["custom"])) {
         return array("alert" => "x200301");
         exit;
     }
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_str_type = fn_getSafe(fn_get("type"), "txt", "");
     $_num_customId = fn_getSafe(fn_get("custom_id"), "int", 0);
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "status" => $_str_status, "type" => $_str_type);
     $_num_customCount = $this->mdl_custom->mdl_count($_str_key, $_str_type, $_str_status);
     $_arr_page = fn_page($_num_customCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_customRows = $this->mdl_custom->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_type, $_str_status);
     //print_r($_arr_customRows);
     if ($_num_customId > 0) {
         $_arr_customRow = $this->mdl_custom->mdl_read($_num_customId);
         if ($_arr_customRow["alert"] != "y200102") {
             return $_arr_customRow;
             exit;
         }
     } else {
         $_arr_customRow = array("custom_id" => 0, "custom_name" => "", "custom_target" => "", "custom_type" => "", "custom_opt" => "", "custom_status" => "enable");
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "customRow" => $_arr_customRow, "customRows" => $_arr_customRows, "fields" => $this->fields, "fieldsJson" => fn_jsonEncode($this->fields, "no"));
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("custom_list.tpl", $_arr_tplData);
     return array("alert" => "y200301");
 }
Esempio n. 7
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_show()
 {
     $_str_tagName = urldecode(fn_getSafe(fn_get("tag_name"), "txt", ""));
     if (!$_str_tagName) {
         return array("alert" => "x130201");
         exit;
     }
     $_arr_tagRow = $this->mdl_tag->mdl_read($_str_tagName, "tag_name");
     if ($_arr_tagRow["alert"] != "y130102") {
         return $_arr_tagRow;
         exit;
     }
     if ($_arr_tagRow["tag_status"] != "show") {
         return array("alert" => "x130102");
     }
     $_arr_tagIds = array($_arr_tagRow["tag_id"]);
     $this->search["tag_name"] = $_str_tagName;
     $_num_articleCount = $this->mdl_articlePub->mdl_count("", "", "", false, false, false, $_arr_tagIds);
     $_arr_page = fn_page($_num_articleCount, BG_SITE_PERPAGE);
     //取得分页数据
     $_str_query = http_build_query($this->search);
     $_arr_articleRows = $this->mdl_articlePub->mdl_list(BG_SITE_PERPAGE, $_arr_page["except"], "", "", "", false, false, false, $_arr_tagIds);
     if (!file_exists(BG_PATH_CACHE . "sys/thumb_list.php")) {
         $this->mdl_thumb->mdl_cache();
     }
     $this->mdl_attach->thumbRows = (include BG_PATH_CACHE . "sys/thumb_list.php");
     foreach ($_arr_articleRows as $_key => $_value) {
         $_arr_articleRows[$_key]["tagRows"] = $this->mdl_tag->mdl_list(10, 0, "", "show", "tag_id", $_value["article_id"]);
         if ($_value["article_attach_id"] > 0) {
             $_arr_attachRow = $this->mdl_attach->mdl_url($_value["article_attach_id"]);
             if ($_arr_attachRow["alert"] == "y070102") {
                 if ($_arr_attachRow["attach_box"] != "normal") {
                     $_arr_attachRow = array("alert" => "x070102");
                 }
             }
             $_arr_articleRows[$_key]["attachRow"] = $_arr_attachRow;
         }
         if (!file_exists(BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php")) {
             $this->mdl_cate->mdl_cache();
         }
         $_arr_cateRow = (include BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php");
         $_arr_articleRows[$_key]["cateRow"] = $_arr_cateRow;
         if ($_arr_cateRow["cate_trees"][0]["cate_domain"]) {
             $_arr_articleRows[$_key]["article_url"] = $_arr_cateRow["cate_trees"][0]["cate_domain"] . "/" . $_value["article_url"];
         }
     }
     //统计 tag 文章数
     $this->mdl_tag->mdl_countDo($_arr_tagRow["tag_id"], $_num_articleCount);
     //更新
     $_arr_tplData = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $this->search, "tagRow" => $_arr_tagRow, "articleRows" => $_arr_articleRows, "cateRows" => $this->cateRows, "customRows" => $this->customRows["custom_list"]);
     $this->obj_tpl->tplDisplay("tag_show.tpl", $_arr_tplData);
     return array("alert" => "y130102");
 }
Esempio n. 8
0
 function ctl_show()
 {
     $_str_query = "";
     $_arr_page = array();
     $_arr_articleRows = array();
     $_arr_customSearch = array();
     if ($this->search["key"] || $this->search["customs"]) {
         $_str_customs = urldecode($this->search["customs"]);
         $_str_customs = base64_decode($_str_customs);
         $_str_customs = urldecode($_str_customs);
         $_arr_customs = explode("&", $_str_customs);
         if ($_arr_customs) {
             foreach ($_arr_customs as $_key => $_value) {
                 $_arr_customRow = explode("=", $_value);
                 if ($_arr_customRow && isset($_arr_customRow[1])) {
                     $_arr_customSearch[$_arr_customRow[0]] = $_arr_customRow[1];
                 }
             }
         }
         $_num_articleCount = $this->mdl_articlePub->mdl_count($this->search["key"], "", "", $this->cateIds, false, 0, false, $_arr_customSearch);
         $_arr_page = fn_page($_num_articleCount, BG_SITE_PERPAGE);
         //取得分页数据
         $_str_query = http_build_query($this->search);
         $_arr_articleRows = $this->mdl_articlePub->mdl_list(BG_SITE_PERPAGE, $_arr_page["except"], $this->search["key"], "", "", $this->cateIds, false, 0, false, $_arr_customSearch);
         foreach ($_arr_articleRows as $_key => $_value) {
             $_arr_articleRows[$_key]["tagRows"] = $this->mdl_tag->mdl_list(10, 0, "", "show", "tag_id", $_value["article_id"]);
             if ($_value["article_attach_id"] > 0) {
                 $_arr_attachRow = $this->mdl_attach->mdl_url($_value["article_attach_id"]);
                 if ($_arr_attachRow["alert"] == "y070102") {
                     if ($_arr_attachRow["attach_box"] != "normal") {
                         $_arr_attachRow = array("alert" => "x070102");
                     }
                 }
                 $_arr_articleRows[$_key]["attachRow"] = $_arr_attachRow;
             }
             if (!file_exists(BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php")) {
                 $this->mdl_cate->mdl_cache();
             }
             $_arr_cateRow = (include BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php");
             $_arr_articleRows[$_key]["cateRow"] = $_arr_cateRow;
             if ($_arr_cateRow["cate_trees"][0]["cate_domain"]) {
                 $_arr_articleRows[$_key]["article_url"] = $_arr_cateRow["cate_trees"][0]["cate_domain"] . "/" . $_value["article_url"];
             }
         }
     }
     $_arr_tpl = array("query" => $_str_query, "search" => $this->search, "pageRow" => $_arr_page, "customs" => $_arr_customSearch, "articleRows" => $_arr_articleRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("search_show.tpl", $_arr_tplData);
     return array("alert" => "y130102");
 }
Esempio n. 9
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function api_list()
 {
     $this->app_check("get");
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_num_perPage = fn_getSafe(fn_get("per_page"), "int", BG_SITE_PERPAGE);
     $_num_specCount = $this->mdl_spec->mdl_count($_str_key, "show");
     $_arr_page = fn_page($_num_specCount, $_num_perPage);
     //取得分页数据
     $_arr_specRows = $this->mdl_spec->mdl_list($_num_perPage, $_arr_page["except"], $_str_key, "show");
     foreach ($_arr_specRows as $_key => $_value) {
         unset($_arr_specRows[$_key]["urlRow"]);
     }
     $_arr_return = array("pageRow" => $_arr_page, "specRows" => $_arr_specRows);
     //print_r($_arr_return);
     $this->obj_api->halt_re($_arr_return, true);
 }
Esempio n. 10
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["log"]["verify"]) && !$this->is_super) {
         return array("alert" => "x120301");
     }
     $_num_verifyCount = $this->mdl_verify->mdl_count();
     $_arr_page = fn_page($_num_verifyCount);
     //取得分页数据
     $_arr_verifyRows = $this->mdl_verify->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"]);
     foreach ($_arr_verifyRows as $_key => $_value) {
         $_arr_verifyRows[$_key]["userRow"] = $this->mdl_user->mdl_read($_value["verify_user_id"]);
     }
     $_arr_tpl = array("pageRow" => $_arr_page, "verifyRows" => $_arr_verifyRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("verify_list.tpl", $_arr_tplData);
     return array("alert" => "y120302");
 }
Esempio n. 11
0
 function ctl_posi()
 {
     if (!isset($this->adminLogged["admin_allow"]["posi"]["stat"]) && !$this->is_super) {
         return array("alert" => "x040305");
     }
     $_arr_search = array("posi_id" => fn_getSafe(fn_get("posi_id"), "int", 0), "type" => fn_getSafe(fn_get("type"), "txt", "year"), "year" => fn_getSafe(fn_get("year"), "txt", ""), "month" => fn_getSafe(fn_get("month"), "txt", ""), "target" => "posi");
     $_arr_posiRow = $this->mdl_posi->mdl_read($_arr_search["posi_id"]);
     if ($_arr_posiRow["alert"] != "y040102") {
         return $_arr_posiRow;
     }
     $_num_statCount = $this->mdl_stat->mdl_count($_arr_search);
     $_arr_page = fn_page($_num_statCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_yearRows = $this->mdl_stat->mdl_year(100);
     $_arr_statRows = $this->mdl_stat->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_arr_search);
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "posiRow" => $_arr_posiRow, "yearRows" => $_arr_yearRows, "statRows" => $_arr_statRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("stat_posi.tpl", $_arr_tplData);
     return array("alert" => "y040305");
 }
Esempio n. 12
0
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["pm"]["browse"]) && !$this->is_super) {
         return array("alert" => "x110301");
     }
     $_arr_search = array("key" => fn_getSafe(fn_get("key"), "txt", ""), "type" => fn_getSafe(fn_get("type"), "txt", ""), "status" => fn_getSafe(fn_get("status"), "txt", ""), "pm_from" => fn_getSafe(fn_get("pm_from"), "int", 0), "pm_to" => fn_getSafe(fn_get("pm_to"), "int", 0));
     $_num_pmCount = $this->mdl_pm->mdl_count($_arr_search);
     $_arr_page = fn_page($_num_pmCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_pmRows = $this->mdl_pm->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_arr_search);
     foreach ($_arr_pmRows as $_key => $_value) {
         $_arr_pmRows[$_key]["toUser"] = $this->mdl_user->mdl_read($_value["pm_to"]);
         $_arr_pmRows[$_key]["fromUser"] = $this->mdl_user->mdl_read($_value["pm_from"]);
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "pmRows" => $_arr_pmRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("pm_list.tpl", $_arr_tplData);
     return array("alert" => "y110302");
 }
Esempio n. 13
0
 /** 列出管理员
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["admin"]["browse"])) {
         return array("alert" => "x020301");
         exit;
     }
     //print_r($this->adminLogged);
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_num_groupId = fn_getSafe(fn_get("group_id"), "int", 0);
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "status" => $_str_status, "group_id" => $_num_groupId);
     $_num_adminCount = $this->mdl_admin->mdl_count($_str_key, $_str_status, $_num_groupId);
     $_arr_page = fn_page($_num_adminCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_adminRows = $this->mdl_admin->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_status, $_num_groupId);
     foreach ($_arr_adminRows as $_key => $_value) {
         /*$_arr_ssoRow                        = $this->obj_sso->sso_get($_value["admin_id"]); //取得用户组信息
         		if ($_arr_ssoRow["alert"] != "y010102" && $_value["article_status"] != "disable") {
         			$_arr_unknownAdmin[] = $_value["admin_id"];
         			$_arr_adminRows[$_key]["admin_name"] = "";
         		}*/
         //$_arr_groupRow                       = $this->mdl_group->mdl_read($_value["admin_group_id"]); //取得用户组信息
         $_arr_adminRows[$_key]["groupRow"] = $this->mdl_group->mdl_read($_value["admin_group_id"]);
     }
     /*if ($_arr_unknownAdmin) {
     			$this->mdl_admin->mdl_status($_arr_unknownAdmin, "disable");
     		}*/
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "adminRows" => $_arr_adminRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("admin_list.tpl", $_arr_tplData);
     return array("alert" => "y020301");
 }
Esempio n. 14
0
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["advert"]["browse"])) {
         return array("alert" => "x080301");
         exit;
     }
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_num_posiId = fn_getSafe(fn_get("posi_id"), "int", 0);
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_arr_search = array("key" => $_str_key, "posi_id" => $_num_posiId, "status" => $_str_status);
     $_num_advertCount = $this->mdl_advert->mdl_count($_str_key, $_str_status, $_num_posiId);
     $_arr_page = fn_page($_num_advertCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_advertRows = $this->mdl_advert->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_status, $_num_posiId);
     $_arr_posiRows = $this->mdl_posi->mdl_list(1000, 0, "", "enable");
     foreach ($_arr_advertRows as $_key => $_value) {
         $_arr_advertRows[$_key]["posiRow"] = $this->mdl_posi->mdl_read($_value["advert_posi_id"]);
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "advertRows" => $_arr_advertRows, "posiRows" => $_arr_posiRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("advert_list.tpl", $_arr_tplData);
     return array("alert" => "y080302");
 }
Esempio n. 15
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["admin"]["browse"]) && !$this->is_super) {
         //判断权限
         return array("alert" => "x020301");
     }
     $_arr_search = array("key" => fn_getSafe(fn_get("key"), "txt", ""), "status" => fn_getSafe(fn_get("status"), "txt", ""), "type" => fn_getSafe(fn_get("type"), "txt", ""));
     $_num_adminCount = $this->mdl_admin->mdl_count($_arr_search);
     //统计记录数
     $_arr_page = fn_page($_num_adminCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     //将搜索参数拼合成查询串
     $_arr_adminRows = $this->mdl_admin->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_arr_search);
     //列出
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "adminRows" => $_arr_adminRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("admin_list.tpl", $_arr_tplData);
     return array("alert" => "y020302");
 }
Esempio n. 16
0
 /**
  * ajax_list function.
  *
  * @access public
  * @return void
  */
 function ajax_list()
 {
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_num_perPage = 10;
     $_num_specCount = $this->mdl_spec->mdl_count($_str_key);
     $_arr_page = fn_page($_num_specCount, $_num_perPage);
     //取得分页数据
     $_arr_specRows = $this->mdl_spec->mdl_list($_num_perPage, $_arr_page["except"], $_str_key);
     $_arr_tpl = array("pageRow" => $_arr_page, "specRows" => $_arr_specRows);
     exit(json_encode($_arr_tpl));
 }
Esempio n. 17
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     $_num_specCount = $this->mdl_spec->mdl_count("", "show");
     $_arr_page = fn_page($_num_specCount);
     //取得分页数据
     $_str_query = http_build_query($this->search);
     $_arr_specRows = $this->mdl_spec->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], "", "show");
     $_arr_tplData = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $this->search, "specRows" => $_arr_specRows, "cateRows" => $this->cateRows, "customRows" => $this->customRows["custom_list"]);
     $this->obj_tpl->tplDisplay("spec_list.tpl", $_arr_tplData);
 }
Esempio n. 18
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["call"]["browse"])) {
         return array("alert" => "x170301");
         exit;
     }
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_type = fn_getSafe(fn_get("type"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "type" => $_str_type, "status" => $_str_status);
     $_num_callCount = $this->mdl_call->mdl_count($_str_key, $_str_type, $_str_status);
     $_arr_page = fn_page($_num_callCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_callRows = $this->mdl_call->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_type, $_str_status);
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "callRows" => $_arr_callRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("call_list.tpl", $_arr_tplData);
     return array("alert" => "y170301");
 }
Esempio n. 19
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["log"]["browse"])) {
         return array("alert" => "x060301");
         exit;
     }
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_type = fn_getSafe(fn_get("type"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_str_level = fn_getSafe(fn_get("level"), "txt", "");
     $_num_operatorId = fn_getSafe(fn_get("operator_id"), "int", 0);
     $_arr_search = array("key" => $_str_key, "type" => $_str_type, "status" => $_str_status, "level" => $_str_level, "operator_id" => $_num_operatorId);
     $_num_logCount = $this->mdl_log->mdl_count($_str_key, $_str_type, $_str_status, $_str_level, $_num_operatorId);
     $_arr_page = fn_page($_num_logCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_logRows = $this->mdl_log->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_type, $_str_status, $_str_level, $_num_operatorId);
     foreach ($_arr_logRows as $_key => $_value) {
         switch ($_value["log_type"]) {
             case "admin":
                 $_arr_adminRow = $this->mdl_admin->mdl_read($_value["log_operator_id"]);
                 if ($_arr_adminRow["alert"] == "y020102") {
                     $_arr_logRows[$_key]["log_operator_name"] = $_arr_adminRow["admin_name"];
                 }
                 break;
             case "app":
                 $_arr_appRow = $this->mdl_app->mdl_read($_value["log_operator_id"]);
                 if ($_arr_appRow["alert"] == "y050102") {
                     $_arr_logRows[$_key]["log_operator_name"] = $_arr_appRow["app_name"];
                 }
                 break;
         }
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "logRows" => $_arr_logRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("log_list.tpl", $_arr_tplData);
     return array("alert" => "y060302");
 }
Esempio n. 20
0
 function ajax_article()
 {
     if ($this->adminLogged["alert"] != "y020102") {
         //未登录,抛出错误信息
         $this->obj_ajax->halt_alert($this->adminLogged["alert"]);
     }
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["attach"]["browse"])) {
         $this->obj_ajax->halt_alert("x070301");
     }
     $_num_articleId = fn_getSafe(fn_get("article_id"), "int", 0);
     if ($_num_articleId == 0) {
         $this->obj_ajax->halt_alert("x120212");
     }
     $_arr_articleRow = $this->mdl_article->mdl_read($_num_articleId);
     //读取文章
     if ($_arr_articleRow["alert"] != "y120102") {
         $this->obj_ajax->halt_alert($_arr_articleRow["alert"]);
     }
     $_num_perPage = 8;
     $_arr_attachIds = fn_getAttach($_arr_articleRow["article_content"]);
     $_arr_attachRows = array();
     if ($_arr_attachIds) {
         $_num_attachCount = $this->mdl_attach->mdl_count("", "", "", "", 0, "normal", $_arr_attachIds);
         $_arr_page = fn_page($_num_attachCount, $_num_perPage);
         $_arr_attachRows = $this->mdl_attach->mdl_list($_num_perPage, $_arr_page["except"], "", "", "", "", 0, "normal", $_arr_attachIds);
         foreach ($_arr_attachRows as $_key => $_value) {
             if ($_value["attach_type"] == "image") {
                 $_arr_attachRows[$_key]["attach_thumb"] = $this->mdl_attach->thumb_process($_value["attach_id"], $_value["attach_time"], $_value["attach_ext"]);
             }
             $_arr_attachRows[$_key]["adminRow"] = $this->mdl_admin->mdl_read($_value["attach_admin_id"]);
         }
     }
     //print_r($_arr_page);
     $_arr_tpl = array("pageRow" => $_arr_page, "attachRows" => $_arr_attachRows);
     exit(json_encode($_arr_tpl));
 }
Esempio n. 21
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     if (!isset($this->adminLogged["groupRow"]["group_allow"]["attach"]["browse"])) {
         return array("alert" => "x070301");
         exit;
     }
     if (!is_array($this->mimeRows)) {
         return array("alert" => "x070405");
         exit;
     }
     $_str_box = fn_getSafe(fn_get("box"), "txt", "normal");
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_year = fn_getSafe(fn_get("year"), "txt", "");
     $_str_month = fn_getSafe(fn_get("month"), "txt", "");
     $_str_ext = fn_getSafe(fn_get("ext"), "txt", "");
     $_num_adminId = fn_getSafe(fn_get("admin_id"), "int", 0);
     $_str_attachIds = fn_getSafe(fn_get("attach_ids"), "txt", "");
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "box" => $_str_box, "key" => $_str_key, "year" => $_str_year, "month" => $_str_month, "ext" => $_str_ext, "admin_id" => $_num_adminId, "attach_ids" => $_str_attachIds);
     //搜索设置
     if ($_str_attachIds) {
         $_arr_attachIds = explode("|", $_str_attachIds);
     } else {
         $_arr_attachIds = false;
     }
     $_num_attachCount = $this->mdl_attach->mdl_count($_str_key, $_str_year, $_str_month, $_str_ext, $_num_adminId, $_str_box, $_arr_attachIds);
     $_arr_page = fn_page($_num_attachCount);
     $_str_query = http_build_query($_arr_search);
     $_arr_pathRows = $this->mdl_attach->mdl_year(100);
     $_arr_extRows = $this->mdl_attach->mdl_ext();
     $_arr_attachRows = $this->mdl_attach->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_year, $_str_month, $_str_ext, $_num_adminId, $_str_box, $_arr_attachIds);
     foreach ($_arr_attachRows as $_key => $_value) {
         if ($_value["attach_type"] == "image") {
             //print_r($_arr_url);
             $_arr_attachRows[$_key]["attach_thumb"] = $this->mdl_attach->thumb_process($_value["attach_id"], $_value["attach_time"], $_value["attach_ext"]);
         }
         $_arr_attachRows[$_key]["adminRow"] = $this->mdl_admin->mdl_read($_value["attach_admin_id"]);
     }
     //print_r($_arr_attachRows);
     $_arr_attachCount["all"] = $this->mdl_attach->mdl_count("", "", "", "", 0, "normal");
     $_arr_attachCount["recycle"] = $this->mdl_attach->mdl_count("", "", "", "", 0, "recycle");
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "attachCount" => $_arr_attachCount, "attachRows" => $_arr_attachRows, "pathRows" => $_arr_pathRows, "extRows" => $_arr_extRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("attach_list.tpl", $_arr_tplData);
     return array("alert" => "y070301");
 }
Esempio n. 22
0
 /**
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_show()
 {
     if ($this->search["cate_id"] == 0) {
         return array("alert" => "x110217");
         exit;
     }
     if ($this->cateRow["alert"] != "y110102") {
         return $this->cateRow;
         exit;
     }
     if ($this->cateRow["cate_status"] != "show") {
         return array("alert" => "x110102");
         exit;
     }
     if ($this->cateRow["cate_type"] == "link" && $this->cateRow["cate_link"]) {
         return array("alert" => "x110218", "cate_link" => $this->cateRow["cate_link"]);
         exit;
     }
     if ($this->cateRow["cate_perpage"] <= BG_SITE_PERPAGE) {
         $_num_perpage = BG_SITE_PERPAGE;
     } else {
         $_num_perpage = $this->cateRow["cate_perpage"];
     }
     $_str_customs = urldecode($this->search["customs"]);
     $_str_customs = base64_decode($_str_customs);
     $_str_customs = urldecode($_str_customs);
     $_arr_customs = explode("&", $_str_customs);
     $_arr_customSearch = array();
     if ($_arr_customs) {
         foreach ($_arr_customs as $_key => $_value) {
             $_arr_customRow = explode("=", $_value);
             if ($_arr_customRow && isset($_arr_customRow[1])) {
                 $_arr_customSearch[$_arr_customRow[0]] = $_arr_customRow[1];
             }
         }
     }
     $_num_articleCount = $this->mdl_articlePub->mdl_count($this->search["key"], "", "", $this->cateRow["cate_ids"], false, 0, false, $_arr_customSearch);
     $_arr_page = fn_page($_num_articleCount, $_num_perpage);
     //取得分页数据
     $_str_query = http_build_query($this->search);
     $_arr_articleRows = $this->mdl_articlePub->mdl_list($_num_perpage, $_arr_page["except"], $this->search["key"], "", "", $this->cateRow["cate_ids"], false, 0, false, $_arr_customSearch);
     if (!file_exists(BG_PATH_CACHE . "sys/thumb_list.php")) {
         $this->mdl_thumb->mdl_cache();
     }
     $this->mdl_attach->thumbRows = (include BG_PATH_CACHE . "sys/thumb_list.php");
     foreach ($_arr_articleRows as $_key => $_value) {
         $_arr_articleRows[$_key]["tagRows"] = $this->mdl_tag->mdl_list(10, 0, "", "show", "tag_id", $_value["article_id"]);
         if ($_value["article_attach_id"] > 0) {
             $_arr_attachRow = $this->mdl_attach->mdl_url($_value["article_attach_id"]);
             if ($_arr_attachRow["alert"] == "y070102") {
                 if ($_arr_attachRow["attach_box"] != "normal") {
                     $_arr_attachRow = array("alert" => "x070102");
                 }
             }
             $_arr_articleRows[$_key]["attachRow"] = $_arr_attachRow;
         }
         if (!file_exists(BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php")) {
             $this->mdl_cate->mdl_cache();
         }
         $_arr_cateRow = (include BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php");
         $_arr_articleRows[$_key]["cateRow"] = $_arr_cateRow;
         if ($_arr_cateRow["cate_trees"][0]["cate_domain"]) {
             $_arr_articleRows[$_key]["article_url"] = $_arr_cateRow["cate_trees"][0]["cate_domain"] . "/" . $_value["article_url"];
         }
     }
     //print_r($_arr_articleRows);
     $_arr_tplData = array("query" => $_str_query, "search" => $this->search, "pageRow" => $_arr_page, "customs" => $_arr_customSearch, "articleRows" => $_arr_articleRows);
     $_arr_tpl = array_merge($this->tplData, $_arr_tplData);
     switch ($this->cateRow["cate_type"]) {
         case "single":
             $_str_tplFile = "single";
             break;
         default:
             $_str_tplFile = "show";
             break;
     }
     $this->obj_tpl->tplDisplay("cate_" . $_str_tplFile . ".tpl", $_arr_tpl);
     return array("alert" => "y110102");
 }
Esempio n. 23
0
 function ctl_list()
 {
     if (!isset($this->adminLogged["admin_allow"]["app"]["browse"])) {
         return array("alert" => "x050301");
         exit;
     }
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_arr_search = array("key" => $_str_key, "status" => $_str_status);
     $_num_appCount = $this->mdl_app->mdl_count($_str_key, $_str_status);
     $_arr_page = fn_page($_num_appCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_appRows = $this->mdl_app->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_status);
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "appRows" => $_arr_appRows);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("app_list.tpl", $_arr_tplData);
     return array("alert" => "y050302");
 }
Esempio n. 24
0
 function api_list()
 {
     $this->app_check("get");
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_year = fn_getSafe(fn_get("year"), "txt", "");
     $_str_month = fn_getSafe(fn_get("month"), "txt", "");
     $_str_markIds = fn_getSafe(fn_get("mark_ids"), "txt", "");
     $_str_tagIds = fn_getSafe(fn_get("tag_ids"), "txt", "");
     $_num_cateId = fn_getSafe(fn_get("cate_id"), "int", 0);
     $_num_specId = fn_getSafe(fn_get("spec_id"), "int", 0);
     $_str_customs = fn_getSafe(fn_get("customs"), "txt", "");
     $_num_perPage = fn_getSafe(fn_get("per_page"), "int", BG_SITE_PERPAGE);
     $_arr_markIds = array();
     $_arr_tagIds = array();
     $_arr_customs = array();
     if ($_str_markIds) {
         $_arr_markIds = explode("|", $_str_markIds);
     }
     if ($_str_markIds) {
         $_arr_tagIds = explode("|", $_str_tagIds);
     }
     if ($_str_markIds) {
         $_arr_customs = explode("|", $_str_customs);
     }
     $_arr_customSearch = array();
     if ($_arr_customs) {
         foreach ($_arr_customs as $_key => $_value) {
             $_arr_customRow = explode(":", $_value);
             $_arr_customSearch[$_arr_customRow[0]] = $_arr_customRow[1];
         }
     }
     if ($_num_cateId > 0) {
         if (!file_exists(BG_PATH_CACHE . "sys/cate_" . $_num_cateId . ".php")) {
             $this->mdl_cate->mdl_cache();
         }
         $_arr_cateRow = (include BG_PATH_CACHE . "sys/cate_" . $_num_cateId . ".php");
         if ($_arr_cateRow["alert"] == "y110102" && $_arr_cateRow["cate_status"] == "show") {
             $_arr_cateIds = $_arr_cateRow["cate_ids"];
         }
     } else {
         $_arr_cateIds = false;
     }
     $_num_articleCount = $this->mdl_articlePub->mdl_count($_str_key, $_str_year, $_str_month, $_arr_cateIds, $_arr_markIds, $_num_specId, $_arr_tagIds, $_arr_customSearch);
     $_arr_page = fn_page($_num_articleCount, $_num_perPage);
     //取得分页数据
     $_arr_articleRows = $this->mdl_articlePub->mdl_list($_num_perPage, $_arr_page["except"], $_str_key, $_str_year, $_str_month, $_arr_cateIds, $_arr_markIds, $_num_specId, $_arr_tagIds, $_arr_customSearch);
     foreach ($_arr_articleRows as $_key => $_value) {
         unset($_arr_articleRows[$_key]["article_url"]);
         $_arr_articleRows[$_key]["tagRows"][$_key] = $this->mdl_tag->mdl_list(10, 0, "", "show", "tag_id", $_value["article_id"]);
         if ($_value["article_attach_id"] > 0) {
             $_arr_attachRow = $this->mdl_attach->mdl_url($_value["article_attach_id"]);
             if ($_arr_attachRow["alert"] == "y070102") {
                 if ($_arr_attachRow["attach_box"] != "normal") {
                     $_arr_attachRow = array("alert" => "x070102");
                 }
             }
             $_arr_articleRows[$_key]["attachRow"] = $_arr_attachRow;
         }
         if (!file_exists(BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php")) {
             $this->mdl_cate->mdl_cache();
         }
         $_arr_cateRow = (include BG_PATH_CACHE . "sys/cate_" . $_value["article_cate_id"] . ".php");
         if ($_arr_cateRow["alert"] == "y110102" && $_arr_cateRow["cate_status"] == "show") {
             unset($_arr_cateRow["urlRow"]);
             $_arr_articleRows[$_key]["cateRow"] = $_arr_cateRow;
         }
     }
     $_arr_return = array("pageRow" => $_arr_page, "articleRows" => $_arr_articleRows);
     //print_r($_arr_return);
     $this->obj_api->halt_re($_arr_return, true);
 }
Esempio n. 25
0
 /** 列出文章
  * ctl_list function.
  *
  * @access public
  * @return void
  */
 function ctl_list()
 {
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_str_year = fn_getSafe(fn_get("year"), "txt", "");
     $_str_month = fn_getSafe(fn_get("month"), "txt", "");
     $_str_status = fn_getSafe(fn_get("status"), "txt", "");
     $_str_box = fn_getSafe(fn_get("box"), "txt", "");
     $_num_cateId = fn_getSafe(fn_get("cate_id"), "int", 0);
     $_num_markId = fn_getSafe(fn_get("mark_id"), "int", 0);
     $_num_adminId = fn_getSafe(fn_get("admin_id"), "int", 0);
     $_arr_search = array("act_get" => $GLOBALS["act_get"], "key" => $_str_key, "year" => $_str_year, "month" => $_str_month, "status" => $_str_status, "box" => $_str_box, "cate_id" => $_num_cateId, "mark_id" => $_num_markId, "admin_id" => $_num_adminId);
     if ($_num_cateId != 0) {
         $_arr_cateIds = $this->mdl_cate->mdl_ids($_num_cateId);
         $_arr_cateIds[] = $_num_cateId;
         $_arr_cateIds = array_unique($_arr_cateIds);
     } else {
         $_arr_cateIds = false;
     }
     /*if ($_arr_search["admin_id"] == 0) {
     			if (isset($this->adminLogged["groupRow"]["group_allow"]["article"]["del"])) {
     				$_num_adminId = 0;
     			} else {
     				$_num_adminId = $this->adminLogged["admin_id"];
     			}
     		}*/
     if ($_str_box == "draft" || $_str_box == "recycle") {
         $_num_adminId = $this->adminLogged["admin_id"];
     }
     $_num_articleCount = $this->mdl_article->mdl_count($_str_key, $_str_year, $_str_month, $_str_status, $_str_box, $_arr_cateIds, $_num_markId, 0, $_num_adminId);
     $_arr_page = fn_page($_num_articleCount);
     //取得分页数据
     $_str_query = http_build_query($_arr_search);
     $_arr_articleRows = $this->mdl_article->mdl_list(BG_DEFAULT_PERPAGE, $_arr_page["except"], $_str_key, $_str_year, $_str_month, $_str_status, $_str_box, $_arr_cateIds, $_num_markId, 0, $_num_adminId);
     $_arr_articleCount["all"] = $this->mdl_article->mdl_count();
     $_arr_articleCount["draft"] = $this->mdl_article->mdl_count("", "", "", "", "draft", false, 0, $this->adminLogged["admin_id"]);
     $_arr_articleCount["recycle"] = $this->mdl_article->mdl_count("", "", "", "", "recycle", false, 0, $this->adminLogged["admin_id"]);
     $_arr_articleYear = $this->mdl_article->mdl_year();
     $_arr_cateRows = $this->mdl_cate->mdl_list(1000, 0, "show");
     $_arr_markRows = $this->mdl_mark->mdl_list(100);
     foreach ($_arr_articleRows as $_key => $_value) {
         $_arr_cateRow = $this->mdl_cate->mdl_read($_value["article_cate_id"]);
         if ($_arr_cateRow["alert"] != "y110102" && $_value["article_cate_id"] > 0) {
             $_arr_unknownCate[] = $_value["article_id"];
         }
         $_arr_articleRows[$_key]["cateRow"] = $_arr_cateRow;
         $_arr_articleRows[$_key]["markRow"] = $this->mdl_mark->mdl_read($_value["article_mark_id"]);
         $_arr_articleRows[$_key]["adminRow"] = $this->mdl_admin->mdl_read($_value["article_admin_id"]);
     }
     if (isset($_arr_unknownCate)) {
         $this->mdl_article->mdl_unknownCate($_arr_unknownCate);
     }
     $_arr_tpl = array("query" => $_str_query, "pageRow" => $_arr_page, "search" => $_arr_search, "cateRows" => $_arr_cateRows, "markRows" => $_arr_markRows, "articleRows" => $_arr_articleRows, "articleCount" => $_arr_articleCount, "articleYear" => $_arr_articleYear);
     $_arr_tplData = array_merge($this->tplData, $_arr_tpl);
     $this->obj_tpl->tplDisplay("article_list.tpl", $_arr_tplData);
     return array("alert" => "y120301");
 }
Esempio n. 26
0
 /**
  * ajax_list function.
  *
  * @access public
  * @return void
  */
 function ajax_list()
 {
     if ($this->adminLogged["alert"] != "y020102") {
         //未登录,抛出错误信息
         $this->obj_ajax->halt_alert($this->adminLogged["alert"]);
     }
     if (!isset($this->adminLogged["admin_allow"]["media"]["browse"]) && !$this->is_super) {
         $this->obj_ajax->halt_alert("x070301");
     }
     $_arr_search = array("key" => fn_getSafe(fn_get("key"), "txt", ""), "year" => fn_getSafe(fn_get("year"), "txt", ""), "month" => fn_getSafe(fn_get("month"), "txt", ""), "ext" => fn_getSafe(fn_get("ext"), "txt", ""), "admin_id" => fn_getSafe(fn_get("admin_id"), "int", 0), "status" => "normal");
     $_num_perPage = 8;
     $_num_mediaCount = $this->mdl_media->mdl_count($_arr_search);
     $_arr_page = fn_page($_num_mediaCount, $_num_perPage);
     $_arr_mediaRows = $this->mdl_media->mdl_list($_num_perPage, $_arr_page["except"], $_arr_search);
     foreach ($_arr_mediaRows as $_key => $_value) {
         $_arr_mediaRows[$_key]["adminRow"] = $this->mdl_admin->mdl_read($_value["media_admin_id"]);
     }
     //print_r($_arr_page);
     $_arr_tpl = array("pageRow" => $_arr_page, "mediaRows" => $_arr_mediaRows);
     exit(json_encode($_arr_tpl));
 }
Esempio n. 27
0
 /**
  * api_chkname function.
  *
  * @access public
  * @return void
  */
 function api_list()
 {
     $this->app_check("get");
     if (!isset($this->appAllow["pm"]["list"])) {
         $_arr_return = array("alert" => "x050319");
         $_arr_logTarget[] = array("app_id" => $this->appRequest["app_id"]);
         $_arr_logType = array("pm", "list");
         $this->log_do($_arr_logTarget, "app", $_arr_return, $_arr_logType);
         $this->obj_api->halt_re($_arr_return);
     }
     $_arr_userRow = $this->user_check("get");
     $_num_perPage = fn_getSafe(fn_get("per_page"), "int", BG_SITE_PERPAGE);
     $_str_pmIds = fn_getSafe(fn_get("pm_ids"), "txt", "");
     $_str_type = fn_getSafe(fn_get("pm_type"), "txt", "");
     $_str_status = fn_getSafe(fn_get("pm_status"), "txt", "");
     $_str_key = fn_getSafe(fn_get("key"), "txt", "");
     $_arr_sign = array("act_get" => $GLOBALS["act_get"], $this->userRequest["user_by"] => $this->userRequest["user_str"], "user_access_token" => $this->userRequest["user_access_token"], "pm_ids" => $_str_pmIds, "pm_type" => $_str_type, "pm_status" => $_str_status, "key" => $_str_key);
     if (!fn_isEmpty(fn_get("per_page"))) {
         $_arr_sign["per_page"] = $_num_perPage;
     }
     //file_put_contents(BG_PATH_ROOT . "debug.txt", json_encode($_arr_sign), FILE_APPEND);
     if (!$this->obj_sign->sign_check(array_merge($this->appRequest, $_arr_sign), $this->appRequest["signature"])) {
         $_arr_return = array("alert" => "x050403");
         $this->obj_api->halt_re($_arr_return);
     }
     $_arr_pmIds = array();
     if (!fn_isEmpty($_str_pmIds)) {
         if (stristr($_str_pmIds, "|")) {
             $_arr_pmIds = explode("|", $_str_pmIds);
         } else {
             $_arr_pmIds = array($_str_pmIds);
         }
     }
     if (fn_isEmpty($_str_type)) {
         $_arr_return = array("alert" => "x110218");
         $this->obj_api->halt_re($_arr_return);
     }
     $_arr_search = array("type" => $_str_type, "status" => $_str_status, "key" => $_str_key, "pm_ids" => $_arr_pmIds);
     switch ($_str_type) {
         case "in":
             $_arr_search["pm_to"] = $_arr_userRow["user_id"];
             break;
         case "out":
             $_arr_search["pm_from"] = $_arr_userRow["user_id"];
             break;
     }
     $_num_pmCount = $this->mdl_pm->mdl_count($_arr_search);
     $_arr_page = fn_page($_num_pmCount);
     $_arr_pmRows = $this->mdl_pm->mdl_list($_num_perPage, $_arr_page["except"], $_arr_search);
     foreach ($_arr_pmRows as $_key => $_value) {
         $_arr_pmRows[$_key]["fromUser"] = $this->mdl_user->mdl_read_api($_value["pm_from"]);
         $_arr_pmRows[$_key]["toUser"] = $this->mdl_user->mdl_read_api($_value["pm_to"]);
         if ($_str_type == "out") {
             $_arr_sendRow = $this->mdl_pm->mdl_read($_value["pm_send_id"]);
             if ($_arr_sendRow["alert"] != "y110102") {
                 $_arr_pmRows[$_key]["pm_send_status"] = "revoke";
             } else {
                 $_arr_pmRows[$_key]["pm_send_status"] = $_arr_sendRow["pm_status"];
             }
         }
     }
     //print_r($_arr_pmRows);
     $_arr_return = array("pmRows" => $_arr_pmRows, "pageRow" => $_arr_page);
     $_str_src = fn_jsonEncode($_arr_return, "encode");
     $_str_code = $this->obj_crypt->encrypt($_str_src, $this->appRow["app_key"]);
     $_arr_return = array("code" => $_str_code, "alert" => "y110402");
     $this->obj_api->halt_re($_arr_return);
 }