114 La source code (114la) cannot generate local real estate and local newspapers and periodicals problems level 4 page 0 byte
Last Update:2018-04-03
Source: Internet
Author: User
I made a website navigation station and used the 114la source code. I didn't expect many problems in it, and the official website didn't have any patches. I couldn't help it. I learned to change it myself. after some debugging analysis, it was found that a function was written in disorder. it was estimated that it was not changed at the time of revision. after a period of modification and debugging, four levels of pages were generated normally and could not be used exclusively. I would like to share it with you.
It is helpful to those who want to use the 114la source code but want to give up on this issue.
Find the modules directory under the management directory and find the mod_make_html.php file,
Replace the get_html_4catalog ($ cid) function with the following code to generate a level 4 page.
The code is as follows:
/**
* Generate 4-level HTML
*
* @ Param int $ cid
* @ Return string
*/
Private static function get_html_4catalog ($ cid)
{
$ Timestamp = $ _ SERVER ['request _ time'];
$ Output = '';
$ Cid = intval ($ cid );
$ Dir_tpls_main = mod_config: get_one_config ('yl _ dirtplmain ');
Empty ($ dir_tpls_main) & $ dir_tpls_main = 'default ';
$ Path_tpls_main = PATH_TPLS_MAIN. '/'. $ dir_tpls_main. '/class ';
App_tpl: assign ('URL', URL, $ path_tpls_main );
$ Class_list = mod_class: get_class_list ();
If ($ cid <0 | empty ($ class_list [$ cid]) | app_db: get_rows_num ('ylmf _ class ', "parentid = '{$ cid}'") <1)
{
Return false;
}
/*
* Get the page header
*/
App_tpl: $ instance = null;
If (! Empty ($ class_list [$ cid] ['classname'])
{
$ Class_name = $ class_list [$ cid] ['classname']; // level 2 Directory
}
Unset ($ title );
$ Title = (! Empty ($ class_name ))? $ Class_name. '-'. mod_config: get_one_config ('yl _ sysname'): mod_config: get_one_config ('yl _ sysname ');
App_tpl: assign ('title', $ title, $ path_tpls_main );
// Call the system default when keywords and description are not entered in the internal page
$ Class_meta_keyword = empty ($ class_list [$ cid] ['keyword'])? Mod_config: get_one_config ('yl _ metakeyword'): $ class_list [$ cid] ['keyword'];
$ Class_meta_description = empty ($ class_list [$ cid] ['description'])? Mod_config: get_one_config ('yl _ metadescrip '): $ class_list [$ cid] ['description'];
App_tpl: assign ('class _ meta_keyword', $ class_list [$ cid] ['keyword'], $ path_tpls_main );
App_tpl: assign ('class _ meta_description ', $ class_list [$ cid] ['description'], $ path_tpls_main );
// Popular keywords
// App_tpl: assign ('search _ keyword', self: get_hot_keyword (), $ path_tpls_main );
$ Parent_id = $ class_list [$ cid] ['parentid'];
If (! Empty ($ parent_id ))
{
$ Parent_class_name = $ class_list [$ parent_id] ['classname'];
// Note the custom path
$ Parent_path = $ class_list [$ parent_id] ['path'];
$ Parent_filepath = (empty ($ parent_path ))? URL_HTML. '/catalog/'. $ parent_id. '.htm': URL_HTML. "/{$ parent_path}/index.htm ";
App_tpl: assign ('parent _ class_name ', "". $ parent_class_name. "", $ path_tpls_main );
}
If (! Empty ($ class_name ))
{
App_tpl: assign ('current _ class_name ', $ class_name, $ path_tpls_main );
}
$ Site_list = array (); // site list
$ Key_list = array (); // category navigation
$ Query = app_db: query ('select * FROM ylmf_class WHERE parentid = '. $ cid. 'Order BY displayorder ');
While ($ info = app_db: fetch_one ($ query ))
{
$ Result = app_db: select ('ylmf _ site', 'id', 'name', 'URL', 'class', 'displayorder', 'good ', 'namecolor '',
"Class = '{$ info ['classid']} 'AND starttime <= {$ timestamp} AND (endtime = 0 OR endtime >=$ timestamp) order by displayorder ");
$ Tmp_site = array ();
If (! Empty ($ result ))
{
Foreach ($ result as $ site)
{
Substr ($ site ['URL'],-1) = '/' & $ site ['URL'] = substr ($ site ['URL'], 0, -1 );
$ Site ['good'] = (empty ($ site ['good'])? '': '√ ';
If ($ site ['endtime']> 0 & $ timestamp> $ site ['endtime'])
{
$ Site ['name'] = 'null ';
$ Site ['URL'] = '#';
}
$ Site ['domain '] = get_domain ($ site ['URL']);
$ Tmp_site [] = $ site;
}
}
$ Info ['URL'] = '#'. $ info ['classid '];
$ Key_list [$ info ['classname'] = $ info;
$ Site_list [$ info ['classname'] = $ tmp_site;
}
App_tpl: assign ('key _ list', $ key_list, $ path_tpls_main );
App_tpl: assign ('site _ list', $ site_list, $ path_tpls_main );
Unset ($ rt, $ key_list, $ site_list );
/*
* Get the end of the main page
*/
App_tpl: $ instance-> compile_id = mod_config: get_one_config ('yl _ dirtplmain ');
// If the template is customized, use the template. Otherwise, use the default class. tpl template.
$ Template = empty ($ class_list [$ cid] ['template'])? 'Class. tpl': $ class_list [$ cid] ['template'];
App_tpl: assign ('ic', mod_config: get_one_config ('yl _ ic'), $ path_tpls_main );
App_tpl: assign ('icpurl', mod_config: get_one_config ('yl _ icpurl '), $ path_tpls_main );
App_tpl: assign ('tongji ', mod_config: get_one_config ('yl _ ipstat'), $ path_tpls_main );
$ Output = app_tpl: fetch ($ template, $ path_tpls_main );
Return $ output;
}
Original article: http://www.cnblogs.com/cnwgy/archive/2012/01/10/2318413.html