Home > Backend Development > PHP Tutorial > Complete list of ecshop basic functions

Complete list of ecshop basic functions

巴扎黑
Release: 2016-11-23 15:52:17
Original
1178 people have browsed it

lib_time.php
gmtime()
P: Get the current Greenwich Time timestamp/$0
server_timezone()
P: Get the server’s time zone/$0
local_mktime($hour = NULL, $minute= NULL, $second = NULL, $month = NULL, $day = NULL, $year = NULL)
P: Generate a GMT timestamp for a user-defined time zone date
local_date($format, $time = NULL)
P: Convert the GMT timestamp Format a date in a user-defined time zone
gmstr2time($str)
P: Convert a time expression in string form to a GMT timestamp
local_strtotime($str)
P: Convert a date in a user-defined time zone to GMT time Stamp
local_gettime($timestamp = NULL)
P: Get the timestamp specified in the user’s time zone
local_getdate($timestamp = NULL)
P: Get the date and time information specified in the user’s time zone

lib_base.php
sub_str($ str, $length = 0, $append = true)
P: Function to intercept UTF-8 encoded string
real_ip()
P: Get the user’s real IP address
str_len($str)
P: Calculate the string The length (Chinese characters are calculated as two characters)
get_crlf()
P: Get the line break character of the user's operating system
send_mail($name, $email, $subject, $content, $type = 0, $notification=false)
P: Send email
gd_version()
P: Get the GD version on the server
file_get_contents($file)
P: If the file_get_contents function does not exist in the system, declare the function
file_put_contents($file, $data, $flags = '' )
P: If the file_put_contents function does not exist in the system, declare the function
floatval($n)
P: If the floatval function does not exist in the system, declare the function
file_mode_info($file_path)
P: File or directory permission check function
log_write ($arg, $file = '', $line = '')
P: Write log content
make_dir($folder)
P: Check whether the target folder exists, if not, automatically create the directory
gzip_enabled( )
P: Get whether gzip is enabled on the system
addslashes_deep($value)
P: Recursively escape special characters in variables
addslashes_deep_obj($obj)
P: Escape special characters of object member variables or arrays Escape
stripslashes_deep($value)
P: Recursively remove special characters in variables
make_semiangle($str)
P: Convert a string to a string containing full-width numeric characters, letters, spaces or '%+ -()' characters are converted to corresponding half-width characters
check_file_type($filename, $realname = '', $limit_ext_types = '')
P: Check file type/file name/real file name/allowed file types
mysql_like_quote($ str)
P: Escape the content of MYSQL LIKE and filter out characters such as _ %.
real_server_ip()
P: Get the server’s ip
ecs_header($string, $replace = true, $http_response_code = 0)
P: Custom header function, used to filter possible security risks
ecs_iconv($source_lang, $target_lang, $source_string = '')
P: Custom encoding conversion
ecs_geoip($ip)
P: Get the IP address, Using IP library
trim_right($str)
P: Remove possible garbled characters on the right side of the string
move_upload_file($file_name, $target_name = '')
P: Move the uploaded file to the specified location
json_str_iconv($str)
P: Transcode the parameters passed by JSON
get_file_suffix($file_name, $allow_type = array())
P: Get the file suffix name and determine whether it is legal
read_static_cache($cache_name)
P: Read the result cache file
write_static_cache( $cache_name, $caches)
P: Write the result cache file

lib_common.php (common function library)
db_create_in($item_list, $field_name = '')
P: Create a query like this: "IN('a' ,'b')" $item_list is an array
is_email($user_email)
P: Verify whether the entered email address is legal
is_time($time)
P: Check whether it is a legal time format
assign_query_info()
P: Get the query time and number, and assign it to smarty
region_result($parent, $sel_name, $type)
P: Create the return information of the region
get_regions($type = 0, $parent = 0)
P: Get the specified country’s return information For all provinces, the function requires database support.
get_shipping_config($area_id)
P: Get the calculation parameters of the delivery cost of the specified delivery method in the delivery area, such as express companies.
init_users()
P: Initialize the member data integration class
cat_list ($cat_id = 0, $selected = 0, $re_type = true, $level = 0, $is_show_all = true)
P: Get an array of subcategories under the specified category, $re_type controls the return type
cat_options($spec_cat_id, $arr)
P: Filter and sort all categories, return an array with indentation level
load_config()
P: Load configuration information
get_brand_list()
P: Get the brand list
get_brands($cat = 0, $app = ' brand')
P: Get the list of brands under a certain category
get_promotion_info($goods_id = '')
P: All promotion information
get_children($cat = 0)
P: Get the information of all underlying categories under the specified category ID
get_article_children ($cat = 0)
P: Get the IDs of all underlying categories under the specified article category
get_mail_template($tpl_name)
P: Get the email template
order_action($order_sn, $order_status, $shipping_status, $pay_status, $ note = '', $username = null)
P: Record order operation record
price_format($price, $change_price = true)
P: Format product price
get_virtual_goods($order_id, $shipping = false)
P: Return Whether the virtual goods in the order are recorded as shipped.
virtual_goods_ship(&$virtual_goods, &$msg, $order_sn, $return_result = false, $process = 'other')
P: Virtual goods shipping
virtual_card_shipping ($goods, $ order_sn, &$msg, $process = 'other')
P: Virtual card delivery
virtual_card_result($order_sn, $goods)
P: Return virtual card information
get_snatch_result($id)
P: Get the specified id snatch activity The result of
clear_tpl_files($is_cache = true, $ext = '')
P: Clear the template cache or compiled files with the specified suffix
clear_compiled_files($ext = '')
P: Clear the template compiled files
clear_cache_files($ext = '')
P: Clear cache files
clear_all_files($ext = '')
P: Clear template compilation and cache files
smarty_insert_scripts($args)
P: js files called on the page, combination functions.
smarty_create_pages($ params)
P: Create a paginated list
build_uri($app, $params, $append = '', $page = 0, $size = 0)
P: Rewrite the URL address
formated_weight($weight)
P: Format weight
log_account_change($user_id, $user_money = 0, $frozen_money = 0, $rank_points = 0, $pay_points = 0, $change_desc = '', $change_type = ACT_OTHER)
P: Log account changes
article_cat_list($ cat_id = 0, $selected = 0, $re_type = true, $level = 0)
P: Get the array of subcategories under the specified category/Fetch the array downwards.
article_cat_options($spec_cat_id, $arr)
P: Filter And sort all article categories, return an array with indentation level
uc_call($func, $params=null)
P: Call the function of UCenter
exception_handler($errno, $errstr, $errfile, $errline)
P : The error_handle callback function is not enabled.
get_image_path($goods_id, $image='', $thumb=false, $call='goods', $del=false)
P: Retrieve the address of the product image and product album
user_uc_call ($func, $params = null)
P: Call the function when using the UCenter plug-in
get_volume_price_list($goods_id, $price_type = '1')
P: Get the product discount price list
get_final_price($goods_id, $goods_num = ' 1', $is_spec_price = false, $spec = array())
P: Get the final price of the product
get_package_info($id)
P: Get the information of the specified id package
get_package_goods($package_id)
P: Get the specified gift package Product

lib_main.php (front-end public function library)
update_user_info()
P: Update user SESSION, COOKIE, login time, and number of logins.
get_user_info($id=0)
P: Get the user information array
assign_ur_here($cat = 0, $str = '')
P: Get the current position and page title
get_parent_cats($cat)
P: Get the specified category All superior categories of
build_pagetitle($arr, $type = 'category')
P: Compile into page title based on the provided array
build_urhere($arr, $type = 'category')
P: Compile into the page title based on the provided array Current location
assign_dynamic($tmp
P: Get the dynamic content of the specified page
assign_articles($id, $num)
P: Assign the article list to smarty
get_shop_help()
P: Assign help information
assign_pager($app, $ cat, $record_count, $size, $sort, $order, $page = 1,$keywords = '', $brand = 0, $price_min = 0, $price_max = 0, $display_type = 'list', $filter_attr= '', $url_format='', $sch_array='')
P: Create paging information. Paging function.
get_pager($url, $param, $record_count, $page = 1, $size = 10)
P: Generate an array assigned to pager.lbi
get_vote($id = '')
P: Call the survey content
get_user_browser()
P: Get the browser name and version
is_spider($record = true)
P: Determine whether it is a search engine spider
get_os()
P: Get the client’s operating system
visit_stats()
P: Statistical access information
save_searchengine_keyword($domain, $path)
P: Save search engine keywords
get_tags($goods_id = 0, $user_id = 0)
P: Get all the tags of the specified user and product
get_dyna_libs($theme, $tmp)
P: Get the theme of a template of the specified theme Dynamic module
dyna_libs_replace($matches)
P: Replace dynamic module
upload_file($upload, $type)
P: Process the uploaded file and return the uploaded image name (the image name will be empty when the upload fails)
show_message($content , $links = '', $hrefs = '', $type = 'info', $auto_redirect = true)
P: Display a prompt message
parse_rate_value($str, &$operate)
P: Convert a message in the form + 10, 10, -10, 10% of the strings are converted into corresponding numbers and return the operation symbol
recalculate_price()
P: Recalculate the price of the goods in the shopping cart: the purpose is to enjoy the membership price when the user logs in, and when the user logs out You do not enjoy the membership price when logging in
assign_comment($id, $type, $page = 1)
P: Query the comment content
assign_template($ctype = '', $catlist = array())
P: Default smarty assignment
time2gmt($time)
P: Convert a local timestamp to a GMT timestamp
get_user_bonus($user_id = 0)
P: Query the member’s red envelope amount
set_affiliate()
P: Save the recommended uid
get_affiliate()
P : Get recommended uid
article_categories_tree($cat_id = 0)
P: Get all categories at the same level of the specified category and subcategories under this category
get_article_parent_cats($cat)
P: Get all parent categories of the specified article category
get_library_number( $library, $template = null)
P: Get the number of settings of a certain template and library
get_navigator($ctype = '', $catlist = array())
P: Get the custom navigation bar list
license_info()
P : Authorization information content

lib_insert.php (dynamic content function library)
insert_query_info()
P: Get the number of queries and query time
insert_history()
P: Call browsing history
insert_cart_info()
P: Call shopping cart information
insert_ads($arr)
P: Call the ads of the specified advertising slot
insert_member_info()
P: Call the member information
insert_comments($arr)
P: Call the comment information
insert_vote()
P: Call the online survey information

lib_goods.php (product-related function library)
goods_sort($goods_a, $goods_b)
P: The number of custom sorting rows for product recommendation usort
get_categories_tree($cat_id = 0)
P: Get all categories at the same level of the specified category and Subcategory under this category
get_child_tree($tree_id = 0)
P: Get the sum of the category tree under the specified category ID
get_top10($cats = '')
P: Call the sales ranking of the current category
get_recommend_goods($type = '', $cats = '')
P: Get recommended products
get_promote_goods($cats = '')
P: Get promotional products
get_category_recommend_goods($type = '', $cats = '', $brand = 0 , $min =0, $max = 0, $ext='')
P: Get the recommended products under the specified category
get_goods_info($goods_id)
P: Get the detailed information of the product
get_goods_properties($goods_id)
P: Get the attributes and specifications of the product
get_same_attribute_goods($attr)
P: Get the products with the same attributes
get_goods_gallery($goods_id)
P: Get the album of the specified product
assign_cat_goods($cat_id, $num = 0, $from = 'web ')
P: Get the goods under the specified category
assign_brand_goods($brand_id, $num = 0, $cat_id = 0)
P: Get the goods under the specified brand
get_extension_goods($cats)
P: Get all extension categories All product IDs belonging to the specified category
bargain_price($price, $start, $end)
P: Determine whether a product is in the special promotion period
spec_price($spec)
P: Get the price of the specified specification
group_buy_info($ group_buy_id, $current_num = 0)
P: Get the group buying activity information
group_buy_stat($group_buy_id, $deposit)
P: Get the statistical information of a certain group buying activity
group_buy_status($group_buy)
P: Get the group buying status
auction_info($act_id , $config = false)
P: Get auction activity information
auction_log($act_id)
P: Get auction activity bid record
auction_status($auction)
P: Calculate auction activity status (note that the parameters must be original information)
goods_info ($goods_id)
P: Get product information
favourable_info($act_id)
P: Get promotion information
wholesale_info($act_id)
P: Wholesale information
add_style($goods_name, $style)
P: Add product name style
get_goods_attr($goods_id)
P: Get product attributes
get_goods_fittings($goods_list = array())
P : Get accessories for the items in the shopping cart

lib_article.php (function library related to articles and article classification)
get_cat_articles($cat_id, $page = 1, $size = 20,$requirement='')
P: Get article classification List of articles under
get_article_count($cat_id ,$requirement='')
P: Get the total number of articles under the specified category

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template