of 114la cannot generate a 0 byte solution to a level 4 page problem with local properties and local newspapers

  • 2020-05-12 02:18:11
  • OfStack

After a period of debugging analysis, I found that there was a function written in a mess, and it was estimated that it had not been changed during the revision. After a period of modification and debugging, I finally generated a 4-level page normally. I dare not use it alone and share it with you.
I hope it is helpful to those who want to use the 114la source code but want to give up because of this problem.
Find the modules directory in the admin directory, find the mod_make_html.php file,
Replace the get_html_4catalog($cid) function with the following code to generate a normal level 4 page.
 
/** 
*  generate 4 Grade 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; 
} 
/* 
*  In the header  
*/ 
app_tpl::$instance = null; 
if (!empty($class_list[$cid]['classname'])) 
{ 
$class_name = $class_list[$cid]['classname']; // 2 Level 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); 
//  The inside pages are not filled  keywords  and  description  System default is invoked when  
$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(); // Classification of 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'])) ? '' : '<span style="color:#f00"> Square root </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); 
/* 
*  Gets the body page tail  
*/ 
app_tpl::$instance->compile_id = mod_config::get_one_config('yl_dirtplmain'); 
// If you have a custom template, use the 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

Related articles: