Home Backend Development PHP Tutorial 114啦源码(114la)不能生成地方房产和地方报刊问题4级页面0字节的解决方法_php实例

114啦源码(114la)不能生成地方房产和地方报刊问题4级页面0字节的解决方法_php实例

May 17, 2016 am 09:13 AM

经过一段时间的调试分析,发现有个函数写的很乱,估计是改版的时候落下了没改,经过一段时间修改调试,终于正常的生成了4级页面,不敢独用,分享给大家。
希望对那些想用114la源码但是因为这个问题想放弃的人有所帮助。
找到管理目录下的modules目录,找到mod_make_html.php文件,
把get_html_4catalog($cid)这个函数替换成下面的代码就可以正常生成4级页面了。

复制代码 代码如下:

/**
* 生成4级分类 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 {
return false;
}
/*
* 取得页头
*/
app_tpl::$instance = null;
if (!empty($class_list[$cid]['classname']))
{
$class_name = $class_list[$cid]['classname']; // 2级目录
}
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);
// 内页不填写 keywords 和 description 的时候调用系统默认
$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);
// 热门关键字
//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'];
// 注意自定义路径
$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(); //站点列表
$key_list = array(); //分类导航
$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) 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);
/*
* 取得主体页尾
*/
app_tpl::$instance->compile_id = mod_config::get_one_config('yl_dirtplmain');
//如果自定义了模版,使用自定义的模版,否则使用默认的 class.tpl 模版
$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;
}

原文:http://www.cnblogs.com/cnwgy/archive/2012/01/10/2318413.html
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

11 Best PHP URL Shortener Scripts (Free and Premium) 11 Best PHP URL Shortener Scripts (Free and Premium) Mar 03, 2025 am 10:49 AM

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Introduction to the Instagram API Introduction to the Instagram API Mar 02, 2025 am 09:32 AM

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Working with Flash Session Data in Laravel Working with Flash Session Data in Laravel Mar 12, 2025 pm 05:08 PM

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

Build a React App With a Laravel Back End: Part 2, React Build a React App With a Laravel Back End: Part 2, React Mar 04, 2025 am 09:33 AM

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Simplified HTTP Response Mocking in Laravel Tests Simplified HTTP Response Mocking in Laravel Tests Mar 12, 2025 pm 05:09 PM

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

cURL in PHP: How to Use the PHP cURL Extension in REST APIs cURL in PHP: How to Use the PHP cURL Extension in REST APIs Mar 14, 2025 am 11:42 AM

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

12 Best PHP Chat Scripts on CodeCanyon 12 Best PHP Chat Scripts on CodeCanyon Mar 13, 2025 pm 12:08 PM

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

Announcement of 2025 PHP Situation Survey Announcement of 2025 PHP Situation Survey Mar 03, 2025 pm 04:20 PM

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio

See all articles