
php是如何调用模板文件的
新手,下了个php源码看,但看不懂,看他的主页index.php中只有一个<?php、、、、、?>脚本,没看到有htm代码,可它是怎么生成的呢?源码里有个模板文件,但我不...
新手,下了个php源码看,但看不懂,看他的主页index.php中只有一个<?php 、、、、、?>脚本,没看到有htm代码,可它是怎么生成的呢?源码里有个模板文件,但我不知道在index。php是怎么调用模板的?
求解
index.php源码
((<?php
define('IN_PHPMPS', true);
require dirname(__FILE__) . '/include/common.php';
$count = $db->getOneCached("select count(*) from {$table}info where is_check=1");
$today_count = $db->getOneCached("select count(*) from {$table}info where is_check=1 and postdate>".mktime(0,0,0));
$sql = "select catid,count(*) as num from {$table}info where is_check=1 group by catid ";
$counts = $db->getAllCached($sql);
$info_count = array();
foreach($counts as $k=>$v) { $info_count[$v['catid']] = $v['num']; }
$flash = get_flash();//焦点图
$fac = get_fac('20');//便民信息
$links = get_link_list();//友情链接
$helps = get_index_help('5');//首页帮助
$coms = get_index_com('7');//首页黄叶
$articles = get_index_article('7');//文章
$comments = get_new_comment('6');//最新评论信息
$new_info = get_info('','','10','','date','10');//最新信息
$pro_info = get_info('','','10','pro','','10');//推荐信息
$hot_info = get_info('','','10','','click', '10', '','m-d');//热门信息
$thumb_info = get_info('','','7','','date','9','1');//图片信息
$seo['title'] = $CFG['webname'];
$seo['keywords'] = $CFG['keywords'];
$seo['description'] = $CFG['description'];
include template('index');
?>
)) 展开
求解
index.php源码
((<?php
define('IN_PHPMPS', true);
require dirname(__FILE__) . '/include/common.php';
$count = $db->getOneCached("select count(*) from {$table}info where is_check=1");
$today_count = $db->getOneCached("select count(*) from {$table}info where is_check=1 and postdate>".mktime(0,0,0));
$sql = "select catid,count(*) as num from {$table}info where is_check=1 group by catid ";
$counts = $db->getAllCached($sql);
$info_count = array();
foreach($counts as $k=>$v) { $info_count[$v['catid']] = $v['num']; }
$flash = get_flash();//焦点图
$fac = get_fac('20');//便民信息
$links = get_link_list();//友情链接
$helps = get_index_help('5');//首页帮助
$coms = get_index_com('7');//首页黄叶
$articles = get_index_article('7');//文章
$comments = get_new_comment('6');//最新评论信息
$new_info = get_info('','','10','','date','10');//最新信息
$pro_info = get_info('','','10','pro','','10');//推荐信息
$hot_info = get_info('','','10','','click', '10', '','m-d');//热门信息
$thumb_info = get_info('','','7','','date','9','1');//图片信息
$seo['title'] = $CFG['webname'];
$seo['keywords'] = $CFG['keywords'];
$seo['description'] = $CFG['description'];
include template('index');
?>
)) 展开
4个回答
展开全部
你好,在代码的最后一行,这句代码include template('index');就调用了模板,里面的模板名称是index.
展开全部
include template('index'); 这行是
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
include template('index'); 这句就是调用模板。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
具体请看template函数
追问
在那个文件里查看template这个函数
追答
全站搜索就是了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |