Analysis of assign_dynamic ($tmp) function in Ecshop
Recently need to add a PHP page in Ecshop, which involves a number of dynamic article content calls.
Because I didn't do it before, I wrote it against index.php. First, you have added a DWT file, in which an editable area is set. Inside the admin/includes/lib_template.php, a template that can set the content is added to the templatefiles array, NEWS.DWT, in Template_ Files This array adds a template that can set the content, NEWS.DWT, in the array of library items that each template allows to set in Page_libs, adds the ' News ' + array (
'/library/ur_here.lbi ' = 0,
'/library/cart.lbi ' = 0,
'/library/category_tree.lbi ' = 0,
'/library/history.lbi ' = 0,
'/library/pages.lbi ' = 0,
'/library/exchange_hot.lbi ' = 5,
'/library/exchange_list.lbi ' = 0,
), and then in the background "set up template" Here, in languages/zh_cn/admin/template.php to the template file to add the appropriate language, $_lang[' template_files ' [' news '] = ' press page ';
After this setting, in the "Background templates"-"Settings template" Here drop-down box here you can see the new template added. The test found that if you want to display some dynamic content within this page. You must add: assign_dynamic (' News ').
Assign_dynamic (TMP) This function is to live to specify the dynamic content of the page, dynamic processing some local information update without being cached mechanism, where TMP) This function is live to specify the dynamic content of the page, dynamic processing some local information update without being cached mechanism, Where TMP is the template name.
Sql= ' Selectid,number,typefrom '. sql = ' SELECT ID, number, type from '. globals[' ECS ']->table (' template '). "WHERE filename = ' tmp′andtype>0andremarks=" Andtheme