/** * 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"); }
/** * 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"); }
function ctl_show() { $_str_alert = fn_getSafe(fn_get("alert"), "txt", ""); //$_str_view = fn_getSafe(fn_get("view"), "txt", ""); $arr_data = array("alert" => $_str_alert, "status" => substr($_str_alert, 0, 1)); $this->obj_tpl->tplDisplay("alert.tpl", $arr_data); }
function ctl_url() { $_num_advertId = fn_getSafe(fn_get("advert_id"), "int", 0); if ($_num_advertId == 0) { return array("alert" => "x080228"); exit; } $_arr_advertRow = $this->mdl_advert->mdl_read($_num_advertId); if ($_arr_advertRow["alert"] != "y080102") { return $_arr_advertRow; exit; } if ($_arr_advertRow["advert_status"] != "enable") { return array("alert" => "x080229"); exit; } if ($_arr_advertRow["advert_put_type"] == "date" && $_arr_advertRow["advert_put_opt"] < time() || $_arr_advertRow["advert_put_type"] == "show" && $_arr_advertRow["advert_put_opt"] < $_arr_advertRow["advert_count_show"] || $_arr_advertRow["advert_put_type"] == "hit" && $_arr_advertRow["advert_put_opt"] < $_arr_advertRow["advert_count_hit"]) { $str_alert = "x080229"; return array("alert" => "x080229"); exit; } $this->mdl_advert->mdl_stat($_num_advertId, true); $this->mdl_stat->mdl_stat("posi", $_arr_advertRow["advert_posi_id"], time(), true); $this->mdl_stat->mdl_stat("advert", $_num_advertId, time(), true); return $_arr_advertRow; }
/** * 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"); }
/** * 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"); }
function ctl_display() { $_str_alert = fn_getSafe(fn_get("alert"), "txt", ""); //$_str_view = fn_getSafe(fn_get("view"), "txt", ""); $arr_data = array("adminLogged" => $this->adminLogged, "alert" => $_str_alert, "status" => substr($_str_alert, 0, 1), "view" => $GLOBALS["view"]); $this->obj_tpl->tplDisplay("alert.tpl", $arr_data); }
/** * 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"); }
/** * 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"); }
function ctl_posi() { if (!isset($this->adminLogged["admin_allow"]["posi"]["stat"])) { return array("alert" => "x040305"); exit; } $_num_posiId = fn_getSafe(fn_get("posi_id"), "int", 0); $_str_type = fn_getSafe(fn_get("type"), "txt", "year"); $_str_year = fn_getSafe(fn_get("year"), "txt", ""); $_str_month = fn_getSafe(fn_get("month"), "txt", ""); $_arr_search = array("act_get" => $GLOBALS["act_get"], "posi_id" => $_num_posiId, "type" => $_str_type, "year" => $_str_year, "month" => $_str_month); $_arr_posiRow = $this->mdl_posi->mdl_read($_num_posiId); if ($_arr_posiRow["alert"] != "y040102") { return $_arr_posiRow; exit; } $_num_statCount = $this->mdl_stat->mdl_count($_str_type, "posi", $_num_posiId, $_str_year, $_str_month); $_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"], $_str_type, "posi", $_num_posiId, $_str_year, $_str_month); $_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"); }
function halt_re($arr_re) { $_str_callback = fn_getSafe(fn_get("callback"), "txt", "callback"); $_str_return = json_encode($arr_re); $_str_return = $_str_callback . "(" . $_str_return . ")"; exit($_str_return); //输出错误信息 }
function api_list() { $this->app_check("get"); $_str_type = fn_getSafe(fn_get("type"), "txt", ""); $_num_parentId = fn_getSafe(fn_get("parent_id"), "int", 0); $_arr_cateRows = $this->mdl_cate->mdl_list(1000, 0, "show", $_str_type, false, $_num_parentId); $this->obj_api->halt_re($_arr_cateRows, true); }
function ctl_logon() { $this->obj_tpl = new CLASS_TPL(BG_PATH_TPL . "admin/" . $this->config["ui"]); $_str_forward = fn_getSafe(fn_get("forward"), "txt", ""); $_str_alert = fn_getSafe(fn_get("alert"), "txt", ""); $_arr_tplData = array("forward" => $_str_forward, "alert" => $_str_alert); $this->obj_tpl->tplDisplay("logon.tpl", $_arr_tplData); }
function ctl_logout() { $_str_forward = fn_getSafe(fn_get("forward"), "txt", ""); if (!$_str_forward) { $_str_forward = fn_forward(BG_URL_ADMIN . "ctl.php"); } fn_ssin_end(); return array("forward" => fn_forward($_str_forward)); }
function ajax_chk() { $_str_seccode = strtolower(fn_get("seccode")); if ($_str_seccode != fn_session("seccode")) { $this->obj_ajax->halt_re("x030101"); } $arr_re = array("re" => "ok"); exit(json_encode($arr_re)); }
function ctl_form() { $_act_get = fn_getSafe(fn_get("act_get"), "txt", "base"); if (!isset($this->adminLogged["admin_allow"]["opt"][$_act_get]) && !$this->is_super) { return array("alert" => "x060301"); } $this->tplData["act_get"] = $_act_get; $this->obj_tpl->tplDisplay("opt_form.tpl", $this->tplData); return array("alert" => "y060301"); }
/** * ajax_chkname function. * * @access public * @return void */ function ajax_chkname() { $_str_mimeName = fn_getSafe(fn_get("mime_name"), "txt", ""); $_num_mimeId = fn_getSafe(fn_get("mime_id"), "int", 0); $_arr_mimeRow = $this->mdl_mime->mdl_read($_str_mimeName, "mime_name", $_num_mimeId); if ($_arr_mimeRow["alert"] == "y080102") { $this->obj_ajax->halt_re("x080206"); } $arr_re = array("re" => "ok"); exit(json_encode($arr_re)); }
/** * ajax_check function. * * @access public * @return void */ function ajax_check() { $seccode = fn_getSafe(fn_get("seccode"), "txt", ""); if (strtolower($seccode) == fn_session("seccode")) { $_str_alert = "ok"; } else { $_str_alert = $this->alert["x030101"]; } $arr_re = array("re" => $_str_alert); exit(json_encode($arr_re)); }
/** * ajax_chkname function. * * @access public * @return void */ function ajax_chkname() { $_str_markName = fn_getSafe(fn_get("mark_name"), "txt", ""); $_num_markId = fn_getSafe(fn_get("mark_id"), "int", 0); $_arr_markRow = $this->mdl_mark->mdl_read($_str_markName, "mark_name", $_num_markId); if ($_arr_markRow["alert"] == "y140102") { $this->obj_ajax->halt_re("x140203"); } $arr_re = array("re" => "ok"); exit(json_encode($arr_re)); }
/** * 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"); }
function ctl_show() { $_str_alert = fn_getSafe(fn_get("alert"), "txt", ""); if (!file_exists(BG_PATH_CACHE . "cate_trees.php")) { $this->mdl_cate->mdl_cache(); } $_arr_cateRows = (include BG_PATH_CACHE . "cate_trees.php"); if (!file_exists(BG_PATH_CACHE . "custom_list.php")) { $this->mdl_custom->mdl_cache(); } $_arr_customRows = (include BG_PATH_CACHE . "custom_list.php"); $arr_data = array("alert" => $_str_alert, "status" => substr($_str_alert, 0, 1), "cateRows" => $_arr_cateRows, "customRows" => $_arr_customRows["custom_list"]); $this->obj_tpl->tplDisplay("alert.tpl", $arr_data, false); }
function ctl_show() { $this->mod = fn_getSafe(fn_get("mod"), "txt", "intro"); $this->act_get = fn_getSafe($GLOBALS["act_get"], "txt", "outline"); if (file_exists(BG_PATH_LANG . $this->config["lang"] . "/help/" . $this->mod . "/config.php")) { $_arr_config = (include_once BG_PATH_LANG . $this->config["lang"] . "/help/" . $this->mod . "/config.php"); } else { $_arr_config = array(); } if ($this->config["ui"] != "default") { $_arr_config = str_replace("baigo", $this->config["ui"], $_arr_config); } $this->tplData = array("helpConfig" => $this->helpConfig, "config" => $_arr_config, "mod" => $this->mod, "act_get" => $this->act_get, "content" => $this->str_process()); $this->obj_tpl->tplDisplay("help.tpl", $this->tplData); }
/** 读取 app 信息 * app_get function. * * @access public * @param bool $chk_token (default: false) * @return void */ function notify_input($str_method = "get", $chk_token = false) { switch ($str_method) { case "post": $_str_time = fn_post("time"); $_str_signature = fn_post("signature"); $_str_code = fn_post("code"); $this->jsonp_callback = fn_post("callback"); $_arr_notifyInput["act_post"] = fn_post("act_post"); break; default: $_str_time = fn_get("time"); $_str_signature = fn_get("signature"); $_str_code = fn_get("code"); $this->jsonp_callback = fn_get("callback"); $_arr_notifyInput["act_get"] = fn_get("act_get"); break; } $_arr_time = validateStr($_str_time, 1, 0); switch ($_arr_time["status"]) { case "too_short": return array("alert" => "x220201"); break; case "ok": $_arr_notifyInput["time"] = $_arr_time["str"]; break; } $_arr_signature = validateStr($_str_signature, 1, 0); switch ($_arr_signature["status"]) { case "too_short": return array("alert" => "x220203"); break; case "ok": $_arr_notifyInput["signature"] = $_arr_signature["str"]; break; } $_arr_code = validateStr($_str_code, 1, 0); switch ($_arr_code["status"]) { case "too_short": return array("alert" => "x220204"); break; case "ok": $_arr_notifyInput["code"] = $_arr_code["str"]; break; } $_arr_notifyInput["alert"] = "ok"; return $_arr_notifyInput; }
/** * 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); }
function api_list() { $_num_posiId = fn_getSafe(fn_get("posi_id"), "int", 0); if ($_num_posiId == 0) { $this->obj_ajax->halt_alert("x040206"); } if (!file_exists(BG_PATH_CACHE . "sys/posi_" . $_num_posiId . ".php")) { $this->mdl_posi->mdl_cache(); } if (!file_exists(BG_PATH_CACHE . "sys/posi_" . $_num_posiId . ".php")) { $this->obj_ajax->halt_alert("x040102"); } $_arr_posiRow = (include_once BG_PATH_CACHE . "sys/posi_" . $_num_posiId . ".php"); if ($_arr_posiRow["alert"] != "y040102") { $this->obj_ajax->halt_alert($_arr_posiRow["alert"]); } $this->mdl_stat->mdl_stat("posi", $_num_posiId, time()); $_arr_adverts = array(); $_arr_advertRows = $this->mdl_advert->mdl_listPub($_num_posiId); if ($_arr_advertRows) { if ($_arr_posiRow["posi_is_percent"] == "enable") { foreach ($_arr_advertRows as $_key => $_value) { $arr_adverts[$_value["advert_id"]] = $_value["advert_percent"]; } for ($_iii = 1; $_iii <= $_arr_posiRow["posi_count"]; $_iii++) { $arr_ids[] = $this->mdl_advert->get_rand($arr_adverts); //根据概率获取奖项id } foreach ($arr_ids as $_key => $_value) { $_arr_adverts[$_key] = $this->mdl_advert->mdl_read($_value); } } else { $_arr_adverts = $_arr_advertRows; } } foreach ($_arr_adverts as $_key => $_value) { $this->mdl_advert->mdl_stat($_value["advert_id"]); $this->mdl_stat->mdl_stat("advert", $_value["advert_id"], time()); $_arr_mediaRow = $this->mdl_media->mdl_read($_value["advert_media_id"]); unset($_arr_mediaRow["media_time"], $_arr_mediaRow["media_box"], $_arr_mediaRow["media_path"], $_arr_adverts[$_key]["advert_count_show"], $_arr_adverts[$_key]["advert_count_hit"], $_arr_adverts[$_key]["advert_put_type"], $_arr_adverts[$_key]["advert_put_opt"], $_arr_adverts[$_key]["advert_url"], $_arr_adverts[$_key]["advert_percent"], $_arr_adverts[$_key]["advert_status"], $_arr_adverts[$_key]["advert_begin"], $_arr_adverts[$_key]["advert_note"], $_arr_adverts[$_key]["advert_time"], $_arr_adverts[$_key]["advert_admin_id"], $_arr_adverts[$_key]["advert_approve_id"], $_arr_adverts[$_key]["advert_approve_id"]); $_arr_adverts[$_key]["mediaRow"] = $_arr_mediaRow; } //print_r($_arr_adverts); $_arr_tplData = array("posiRow" => $_arr_posiRow, "advertRows" => $_arr_adverts); $this->halt_re($_arr_tplData); }
function getUi() { if (BG_SWITCH_UI == true) { //界面开关为开 $str_ui = fn_getSafe(fn_get("ui"), "txt", ""); if ($str_ui) { //查询串指定 $_str_return = $str_ui; } else { /*if (fn_cookie("cookie_ui")) { //cookie 指定 $_str_return = fn_cookie("cookie_ui"); } else { //系统识别*/ if (fn_server("HTTP_USER_AGENT")) { $_str_agentUser = strtolower(fn_server("HTTP_USER_AGENT")); //客户端信息 $_str_agentMobile = "/(symbian|symbos|phone|mobile|320x320|240x320|176x220|android|MicroMessenger)/i"; //移动设备界定串 $_str_agentPad = "/(ipad|honeycomb)/i"; //平板电脑界定串 if (preg_match($_str_agentMobile, $_str_agentUser)) { if (preg_match($_str_agentPad, $_str_agentUser)) { //客户端是平板 $_str_return = BG_DEFAULT_UI; } else { $_str_return = "mobile"; //客户端是移动设备 } } else { $_str_return = BG_DEFAULT_UI; //客户端是 pc } } else { $_str_return = BG_DEFAULT_UI; //客户端是 pc } //} } } else { //界面开关为关 $_str_return = BG_DEFAULT_UI; //默认界面 } //setcookie("cookie_ui", $_str_return); //客户端是移动设备 $this->config["ui"] = $_str_return; }
/** 读取 app 信息 * app_get function. * * @access public * @param bool $chk_token (default: false) * @return void */ function app_get($str_method = "get", $chk_token = false) { if ($str_method == "post") { $num_appId = fn_post("app_id"); $str_appKey = fn_post("app_key"); } else { $num_appId = fn_get("app_id"); $str_appKey = fn_get("app_key"); } $_arr_appId = validateStr($num_appId, 1, 0, "str", "int"); switch ($_arr_appId["status"]) { case "too_short": return array("alert" => "x190203"); exit; break; case "format_err": return array("alert" => "x190204"); exit; break; case "ok": $_arr_appGet["app_id"] = $_arr_appId["str"]; break; } $_arr_appKey = validateStr($str_appKey, 1, 64, "str", "alphabetDigit"); switch ($_arr_appKey["status"]) { case "too_short": return array("alert" => "x190214"); exit; break; case "too_long": return array("alert" => "x190215"); exit; break; case "format_err": return array("alert" => "x190216"); exit; break; case "ok": $_arr_appGet["app_key"] = $_arr_appKey["str"]; break; } $_arr_appGet["alert"] = "ok"; return $_arr_appGet; }
function ctl_show() { if (!isset($this->adminLogged["admin_allow"]["log"]["verify"])) { return array("alert" => "x120301"); } $_num_verifyId = fn_getSafe(fn_get("verify_id"), "int", 0); if ($_num_verifyId < 1) { return array("alert" => "x120201"); } $_arr_verifyRow = $this->mdl_verify->mdl_read($_num_verifyId); if ($_arr_verifyRow["alert"] != "y120102") { return $_arr_verifyRow; } $_arr_verifyRow["userRow"] = $this->mdl_user->mdl_read($_arr_verifyRow["verify_user_id"]); $_arr_tpl = array("verifyRow" => $_arr_verifyRow); $_arr_tplData = array_merge($this->tplData, $_arr_tpl); $this->obj_tpl->tplDisplay("verify_show.tpl", $_arr_tplData); return array("alert" => "y120302"); }
function ctl_form() { $_act_get = fn_getSafe(fn_get("act_get"), "text", "base"); if (!isset($this->adminLogged["admin_allow"]["opt"][$_act_get]) && !$this->is_super) { return array("alert" => "x040301"); } if ($_act_get == "base") { $this->tplData["tplRows"] = $this->obj_dir->list_dir(BG_PATH_TPL . "user/"); $_arr_timezoneRows = (include_once BG_PATH_LANG . $this->config["lang"] . "/timezone.php"); $_arr_timezone[] = ""; if (stristr(BG_SITE_TIMEZONE, "/")) { $_arr_timezone = explode("/", BG_SITE_TIMEZONE); } $this->tplData["timezoneRows"] = $_arr_timezoneRows; $this->tplData["timezoneJson"] = json_encode($_arr_timezoneRows); $this->tplData["timezoneType"] = $_arr_timezone[0]; } $this->tplData["act_get"] = $_act_get; $this->obj_tpl->tplDisplay("opt_form.tpl", $this->tplData); return array("alert" => "y040301"); }
function api_get() { $this->app_check("get"); $_num_callId = fn_getSafe(fn_get("call_id"), "int", 0); if ($_num_callId == 0) { $_arr_return = array("alert" => "x170201"); $this->obj_api->halt_re($_arr_return); } $this->callRow = $this->mdl_call->mdl_read($_num_callId); if ($this->callRow["alert"] != "y170102") { $this->obj_api->halt_re($this->callRow); } if ($this->callRow["call_status"] != "enable") { $_arr_return = array("alert" => "x170201"); $this->obj_api->halt_re($_arr_return); } switch ($this->callRow["call_type"]) { case "spec": $_arr_return = $this->call_spec(); break; //栏目列表 //栏目列表 case "cate": $_arr_return = $this->call_cate(); break; //TAG 列表 //TAG 列表 case "tag_list": case "tag_rank": $_arr_return = $this->call_tag(); break; //文章列表 //文章列表 default: $_arr_return = $this->call_article(); break; } //print_r($_arr_return); $this->obj_api->halt_re($_arr_return, true); }