查无此人连城雪百度云:PHP的 template问题include template('shownews');

来源:百度文库 编辑:高校问答 时间:2024/05/02 20:29:30
谁能跟我说一下最后这个include template('shownews');是什么意思?

整个文件程序是这样的
<?php
require_once './includes/common.inc.php';

$query = $db->query("select * from {$tablepre}news where id='$id'");
if(!$curnew = $db->fetch_array($query))
{
echo "此记录不存在!";
exit;
}
$curnew['fbtime'] = date("Y-m-d H:i:s", $curnew['fbtime']);
$claid = $curnew[newsclassid];
$maxclaid = $curnew[maxclassid];

if($claid == '5')
{
if($aid == 4) $where = "and (areaid != '8' and areaid != '12')";
elseif($aid == 8) $where = "and (areaid != '4' and areaid != '12')";
else $where = "and (areaid != '4' and areaid != '8')";
$where = "newsclassid='$claid' ".$where;
}
elseif($claid == '16')
{
if($aid == 4) $where = "and areaid != '8'";
else $where = "and areaid != '4'";
$where = "newsclassid='$claid' ".$where;
}
elseif(in_array($claid, array('14','3','20'))) $where = "areaid='$templateid' and newsclassid in ('14','3','20')";
else $where = "maxclassid='$maxclaid' and areaid='$templateid'";

$query = $db->query("select id,newstitle from {$tablepre}news
where $where and isshow='y' order by id desc limit 0, 10");
while($row = $db->fetch_array($query))
{
$row[newstitle] = cutstr($row[newstitle], 24);
$leftlist[] = $row;
}

include template('shownews');
?>

template只是一个自定义函数,
'shownews'是它的参数,
返回值可能是一个文件路径供include命令使用
include命令调用指定的文件