当前位置: 首页>>代码示例>>PHP>>正文


PHP fn_getSafe函数代码示例

本文整理汇总了PHP中fn_getSafe函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_getSafe函数的具体用法?PHP fn_getSafe怎么用?PHP fn_getSafe使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fn_getSafe函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ajax_submit

 function ajax_submit()
 {
     $_act_post = fn_getSafe($GLOBALS["act_post"], "txt", "base");
     if ($_act_post != "dbconfig") {
         $this->check_db();
     }
     $_num_countSrc = 0;
     foreach ($this->obj_ajax->opt[$_act_post]["list"] as $_key => $_value) {
         if ($_value["min"] > 0) {
             $_num_countSrc++;
         }
     }
     $_arr_const = $this->mdl_opt->input_const($_act_post);
     $_num_countInput = count(array_filter($_arr_const));
     if ($_num_countInput < $_num_countSrc) {
         $this->obj_ajax->halt_alert("x030212");
     }
     $_arr_return = $this->mdl_opt->mdl_const($_act_post);
     if ($_arr_return["alert"] != "y060101") {
         $this->obj_ajax->halt_alert($_arr_return["alert"]);
     }
     if ($_act_post == "visit") {
         if ($_arr_const["BG_VISIT_TYPE"] == "pstatic") {
             $_arr_return = $this->mdl_opt->mdl_htaccess();
             if ($_arr_return["alert"] != "y060101") {
                 $this->obj_ajax->halt_alert($_arr_return["alert"]);
             }
         } else {
             if (file_exists(BG_PATH_ROOT . ".htaccess")) {
                 unlink(BG_PATH_ROOT . ".htaccess");
             }
         }
     }
     $this->obj_ajax->halt_alert("y030405");
 }
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:35,代码来源:upgrade.class.php

示例2: mdl_dbconfig

 function mdl_dbconfig()
 {
     if (!fn_token("chk")) {
         //令牌
         return array("alert" => "x030102");
         exit;
     }
     $_str_dbHost = fn_getSafe(fn_post("db_host"), "txt", "localhost");
     $_str_dbPort = fn_getSafe(fn_post("db_port"), "txt", "3306");
     $_str_dbName = fn_getSafe(fn_post("db_name"), "txt", "baigo_cms");
     $_str_dbUser = fn_getSafe(fn_post("db_user"), "txt", "baigo_cms");
     $_str_dbPass = fn_getSafe(fn_post("db_pass"), "txt", "");
     $_str_dbCharset = fn_getSafe(fn_post("db_charset"), "txt", "utf8");
     $_str_dbTable = fn_getSafe(fn_post("db_table"), "txt", "cms_");
     $_str_content = "<?php" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_HOST\", \"" . $_str_dbHost . "\");" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_PORT\", \"" . $_str_dbPort . "\");" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_NAME\", \"" . $_str_dbName . "\");" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_USER\", \"" . $_str_dbUser . "\");" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_PASS\", \"" . $_str_dbPass . "\");" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_CHARSET\", \"" . $_str_dbCharset . "\");" . PHP_EOL;
     $_str_content .= "define(\"BG_DB_TABLE\", \"" . $_str_dbTable . "\");" . PHP_EOL;
     $_num_size = file_put_contents(BG_PATH_CONFIG . "config_db.inc.php", $_str_content);
     if ($_num_size > 0) {
         $_str_alert = "y060101";
     } else {
         $_str_alert = "x060101";
     }
     return array("alert" => $_str_alert);
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:30,代码来源:opt.class.php

示例3: ctl_url

 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;
 }
开发者ID:gorgee,项目名称:baigoADS,代码行数:26,代码来源:advert.class.php

示例4: ctl_posi

 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");
 }
开发者ID:gorgee,项目名称:baigoADS,代码行数:27,代码来源:stat.class.php

示例5: ajax_submit

 function ajax_submit()
 {
     $_act_post = fn_getSafe($GLOBALS["act_post"], "txt", "base");
     if (!isset($this->adminLogged["admin_allow"]["opt"][$_act_post])) {
         $this->obj_ajax->halt_alert("x040301");
     }
     $_num_countSrc = 0;
     foreach ($this->obj_ajax->opt[$_act_post]["list"] as $_key => $_value) {
         if ($_value["min"] > 0) {
             $_num_countSrc++;
         }
     }
     $_arr_const = $this->mdl_opt->input_const($_act_post);
     $_num_countInput = count(array_filter($_arr_const));
     if ($_num_countInput < $_num_countSrc) {
         $this->obj_ajax->halt_alert("x030212");
     }
     $_arr_return = $this->mdl_opt->mdl_const($_act_post);
     if ($_arr_return["alert"] != "y040101") {
         $this->obj_ajax->halt_alert($_arr_return["alert"]);
     }
     $_arr_targets[] = $_act_post;
     $_str_targets = json_encode($_arr_targets);
     $_str_return = json_encode($_arr_return);
     $this->mdl_log->mdl_submit($_str_targets, "opt", $this->log["opt"]["edit"], $_str_return, "admin", $this->adminLogged["admin_id"]);
     $this->obj_ajax->halt_alert("y040401");
 }
开发者ID:itviewer,项目名称:baigoSSO,代码行数:27,代码来源:opt.class.php

示例6: ctl_show

 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);
 }
开发者ID:baigoStudio,项目名称:baigoADS,代码行数:7,代码来源:alert.class.php

示例7: ctl_display

 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);
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:7,代码来源:alert.class.php

示例8: ctl_list

 /**
  * 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");
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:33,代码来源:thumb.class.php

示例9: ctl_list

 /**
  * 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");
 }
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:35,代码来源:tag.class.php

示例10: ctl_list

 /**
  * 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");
 }
开发者ID:richardcj,项目名称:baigoCMS,代码行数:37,代码来源:custom.class.php

示例11: ctl_list

 /**
  * 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");
 }
开发者ID:baigoStudio,项目名称:baigoADS,代码行数:33,代码来源:media.class.php

示例12: ctl_list

 /**
  * 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");
 }
开发者ID:humor-zo,项目名称:baigoADS,代码行数:39,代码来源:user.class.php

示例13: ctl_list

 /**
  * 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");
 }
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:36,代码来源:mime.class.php

示例14: halt_re

 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);
     //输出错误信息
 }
开发者ID:baigoStudio,项目名称:baigoADS,代码行数:8,代码来源:advert.class.php

示例15: api_list

 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);
 }
开发者ID:xiaodin1,项目名称:baigoCMS,代码行数:8,代码来源:cate.class.php


注:本文中的fn_getSafe函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。