114 Source Code (114LA) can not generate local real estate and local newspapers and periodicals Problem level 4 page 0 byte solution _php instance

Source: Internet
Author: User
Tags php file
After a period of debugging analysis, found that 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, and finally the normal generation of 4-level page, not alone, to share.
I want to be helpful to those who want to use 114la source code but want to give up because of this problem.
Locate the modules directory under the Admin directory, find the mod_make_html.php file,
Replace the Get_html_4catalog ($cid) function with the following code to generate 4-level pages normally.
Copy Code code as follows:

/**
* Generate Level 4 classification 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 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 ', "<a href=\" {$parent _filepath}\ ">". $parent _class_name. "</a>", $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 '])? ': ' <span style= ' color: #f00 ' >√</span> ';
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 you customized a template, use a custom template, otherwise 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

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.