ecshop 函數列表大全
lib_time.php
gmtime()
P: 獲得當前格林威治時間的時間戳 /$0
server_timezone()
P: 獲得服務器的時區 /$0
local_mktime($hour = NULL , $minute= NULL, $second = NULL, $month = NULL, $day = NULL, $year = NULL)
P: 生成一個用戶自定義時區日期的GMT時間戳
local_date($format, $time = NULL)
P: 將GMT時間戳格式化為用戶自定義時區日期
gmstr2time($str)
P: 轉換字符串形式的時間表達式為GMT時間戳
local_strtotime($str)
P: 將一個用戶自定義時區的日期轉為GMT時間戳
local_gettime($timestamp = NULL)
P: 獲得用戶所在時區指定的時間戳
local_getdate($timestamp = NULL)
P: 獲得用戶所在時區指定的日期和時間信息
lib_base.php
sub_str($str, $length = 0, $append = true)
P: 截取UTF-8編碼下字符串的函數
real_ip()
P: 獲得用戶的真實IP地址
str_len($str)
P: 計算字符串的長度(漢字按照兩個字符計算)
get_crlf()
P: 獲得用戶操作系統的換行符
send_mail($name, $email, $subject, $content, $type = 0, $notification=false)
P: 郵件發送
gd_version()
P: 獲得服務器上的 GD 版本
file_get_contents($file)
P: 如果系統不存在file_get_contents函數則聲明該函數
file_put_contents($file, $data, $flags = '')
P: 如果系統不存在file_put_contents函數則聲明該函數
floatval($n)
P: 如果系統不存在 floatval 函數則聲明該函數
file_mode_info($file_path)
P: 文件或目錄權限檢查函數
log_write($arg, $file = '', $line = '')
P: 寫入日志內容
make_dir($folder)
P: 檢查目標文件夾是否存在,如果不存在則自動創建該目錄
gzip_enabled()
P: 獲得系統是否啟用了 gzip
addslashes_deep($value)
P: 遞歸方式的對變量中的特殊字符進行轉義
addslashes_deep_obj($obj)
P: 將對象成員變量或者數組的特殊字符進行轉義
stripslashes_deep($value)
P: 遞歸方式的對變量中的特殊字符去除轉義
make_semiangle($str)
P: 將一個字串中含有全角的數字字符、字母、空格或'%+-()'字符轉換為相應半角字符
check_file_type($filename, $realname = '', $limit_ext_types = '')
P: 檢查文件類型 /文件名/真實文件名/允許的文件類型
mysql_like_quote($str)
P: 對 MYSQL LIKE 的內容進行轉義 過濾掉_ %等字符.
real_server_ip()
P: 獲取服務器的ip
ecs_header($string, $replace = true, $http_response_code = 0)
P: 自定義 header 函數,用于過濾可能出現的安全隱患
ecs_iconv($source_lang, $target_lang, $source_string = '')
P: 自定義的編碼轉換
ecs_geoip($ip)
P: 取得IP的地址,采用IP庫
trim_right($str)
P: 去除字符串右側可能出現的亂碼
move_upload_file($file_name, $target_name = '')
P: 將上傳文件轉移到指定位置
json_str_iconv($str)
P: 將JSON傳遞的參數轉碼
get_file_suffix($file_name, $allow_type = array())
P: 獲取文件后綴名,并判斷是否合法
read_static_cache($cache_name)
P: 讀結果緩存文件
write_static_cache($cache_name, $caches)
P: 寫結果緩存文件
lib_common.php (公用函數庫)
db_create_in($item_list, $field_name = '')
P: 創建像這樣的查詢: "IN('a','b')" $item_list為數組
is_email($user_email)
P: 驗證輸入的郵件地址是否合法
is_time($time)
P: 檢查是否為一個合法的時間格式
assign_query_info()
P: 獲得查詢時間和次數,并賦值給smarty
region_result($parent, $sel_name, $type)
P: 創建地區的返回信息
get_regions($type = 0, $parent = 0)
P: 獲得指定國家的所有省份, 函數需要數據庫支持.
get_shipping_config($area_id)
P: 獲得配送區域中指定的配送方式的配送費用的計算參數 比如快捷公司不同.
init_users()
P: 初始化會員數據整合類
cat_list($cat_id = 0, $selected = 0, $re_type = true, $level = 0, $is_show_all = true)
P: 獲得指定分類下的子分類的數組, $re_type控制返回類型
cat_options($spec_cat_id, $arr)
P: 過濾和排序所有分類,返回一個帶有縮進級別的數組
load_config()
P: 載入配置信息
get_brand_list()
P: 取得品牌列表
get_brands($cat = 0, $app = 'brand')
P: 獲得某個分類下的品牌列表
get_promotion_info($goods_id = '')
P: 所有的促銷活動信息
get_children($cat = 0)
P: 獲得指定分類下所有底層分類的ID
get_article_children ($cat = 0)
P: 獲得指定文章分類下所有底層分類的ID
get_mail_template($tpl_name)
P: 獲取郵件模板
order_action($order_sn, $order_status, $shipping_status, $pay_status, $note = '', $username = null)
P: 記錄訂單操作記錄
price_format($price, $change_price = true)
P: 格式化商品價格
get_virtual_goods($order_id, $shipping = false)
P: 返回訂單中的虛擬商品 記錄是否發貨.
virtual_goods_ship(&$virtual_goods, &$msg, $order_sn, $return_result = false, $process = 'other')
P: 虛擬商品發貨
virtual_card_shipping ($goods, $order_sn, &$msg, $process = 'other')
P: 虛擬卡發貨
virtual_card_result($order_sn, $goods)
P: 返回虛擬卡信息
get_snatch_result($id)
P: 獲取指定 id snatch 活動的結果
clear_tpl_files($is_cache = true, $ext = '')
P: 清除指定后綴的模板緩存或編譯文件
clear_compiled_files($ext = '')
P: 清除模版編譯文件
clear_cache_files($ext = '')
P: 清除緩存文件
clear_all_files($ext = '')
P: 清除模版編譯和緩存文件
smarty_insert_scripts($args)
P: 頁面上調用的js文件,組合功能.
smarty_create_pages($params)
P: 創建分頁的列表
build_uri($app, $params, $append = '', $page = 0, $size = 0)
P: 重寫 URL 地址
formated_weight($weight)
P: 格式化重量
log_account_change($user_id, $user_money = 0, $frozen_money = 0, $rank_points = 0, $pay_points = 0, $change_desc = '', $change_type =
ACT_OTHER)
P: 記錄帳戶變動
article_cat_list($cat_id = 0, $selected = 0, $re_type = true, $level = 0)
P: 獲得指定分類下的子分類的數組/ 向下取數組.
article_cat_options($spec_cat_id, $arr)
P: 過濾和排序所有文章分類,返回一個帶有縮進級別的數組
uc_call($func, $params=null)
P: 調用UCenter的函數
exception_handler($errno, $errstr, $errfile, $errline)
P: error_handle回調函數未啟用.
get_image_path($goods_id, $image='', $thumb=false, $call='goods', $del=false)
P: 重新獲得商品圖片與商品相冊的地址
user_uc_call($func, $params = null)
P: 調用使用UCenter插件時的函數
get_volume_price_list($goods_id, $price_type = '1')
P: 取得商品優惠價格列表
get_final_price($goods_id, $goods_num = '1', $is_spec_price = false, $spec = array())
P: 取得商品最終使用價格
新聞熱點
疑難解答