114 114 The source code 114la cannot generate local property and local press issues 4-level page 0-byte solution

Source: Internet
Author: User
After a period of debugging analysis, found that there is a function to write a very messy, it is estimated that the revision of the time has not changed, after a period of time to modify debugging, finally the normal generation of the 4-level page, dare not alone, share to everyone.
Hope for those who want to use 114la source code but because of this problem want to give up people help.
Locate the modules directory under the Admin directory, locate the mod_make_html.php file,
Replace the Get_html_4catalog ($cid) function with the following code to generate a 4-level page normally.

Copy the Code code as follows:


/**
* Generate Level 4 category 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 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);
Internal page does not fill in keywords and description when calling system default
$class _meta_keyword = Empty ($class _list[$cid] [' keywords '])? Mod_config::get_one_config (' Yl_metakeyword '): $class _list[$cid] [' keywords '];
$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] [' keywords '], $path _tpls_main);
App_tpl::assign (' class_meta_description ', $class _list[$cid] [' description '], $path _tpls_main);
Hot Key Words
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 disp Layorder ");
$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 Main Page footer
*/
APP_TPL:: $instance->compile_id = mod_config::get_one_config (' Yl_dirtplmain ');
If you have customized the template, use a custom template, or use the default Class.tpl template
$template = Empty ($class _list[$cid [' template '])? ' Class.tpl ': $class _list[$cid [' template '];
App_tpl::assign (' ICP ', Mod_config::get_one_config (' YL_ICP '), $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: http://www.cnblogs.com/cnwgy/archive/2012/01/10/2318413.html

The above introduces 114 114 source code 114la can not generate local real estate and local press questions 4-level page 0-byte solution, including 114 aspects of the content, I hope to be interested in PHP tutorial friends helpful.

  • 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.