114 La Source Code (114la) cannot generate local real estate and local newspapers and periodicals problems Level 4 Page 0 byte

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, so I couldn't help it. Learn to change it myself.

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, so I couldn't help it. Learn to change it myself.

After a period of debugging analysis, it was found that a function was written in disorder. It was estimated that it was not changed during the revision. After a period of modification and debugging, a four-level page was generated normally, I am afraid 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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.