php 菜鸟问题 template('index')报错

libRA_kin 2010-08-01 01:36:31
我一直是做jsp的 这次为了帮朋友忙 做一个php的小网站 才csdn上下了一个源码修改
可部署上就各种错:
这是 index.php的代码

<?php
/**
index.php - 首页程序
***********************************************/
require_once "./include/base.php";
require_once "./include/depart.php";


//$treelist=display_tree_frontp($classid);
$index=1;
//======== 取首页切换图 ======================================================
$condition="where speltj=1";
$syqh=array();
$query = $db->query("SELECT * FROM $table_pic where class=1 order by id desc LIMIT 5");
$syqh= array();
$blinknum=$db->num_rows($query);
$tempj=0;
$i = 0;
while($dbq_rec = $db->fetch_array($query))
{
$i++;
$dbq_rec['viewtimes']=$i;
//$dbq_rec['subject']=wordscut($dbq_rec['subject'],20);
//echo $dbq_rec['viewtimes'];
$syqh[]=$dbq_rec;
}
unset($dbq_rec);



//*************取首页显示图******************
$condition="where indextj=1";

$yycp=array();


$query = $db->query("SELECT * from $table_products $condition ORDER BY productid desc LIMIT 9");


$rows=2;
$tempnums=0;
for ($i=0;$i<=$rows;$i++)
{

$productlist=array();
$col=3;
for ($j=1;$j<=$col;$j++)
{
$tempnums++;

//if ($tempnums>($productnum-$start_limit)) $productlist[]=$blink;
//else
//{
$dbq_rec=$db->fetch_array($query);

$dbq_rec['postyear']=date('Y',$dbq_rec['posttime']);
$dbq_rec['postdate']=date('m-d',$dbq_rec['posttime']);
$dbq_rec['posttime']=date('Y-m-d',$dbq_rec['posttime']);
$productlist[]=$dbq_rec;
//}
}
$yycp[]=$productlist;
unset($productlist);
}


//=====================取招聘信息========================================
$query = $db->query("SELECT * FROM $table_documents where class=2 order by id desc LIMIT 5");
$zxzp= array();
$blinknum=$db->num_rows($query);
$tempj=0;
while($dbq_rec = $db->fetch_array($query))
{


$dbq_rec['subject']=wordscut($dbq_rec['subject'],20);
$zxzp[]=$dbq_rec;
}
unset($dbq_rec);

//==============================促销信息==============================
$query = $db->query("SELECT * FROM $table_documents where class=1 order by id desc LIMIT 4");
$hydx= array();
$blinknum=$db->num_rows($query);
$tempj=0;

while($dbq_rec = $db->fetch_array($query))
{
$i++;
$dbq_rec['subject']=wordscut($dbq_rec['subject'],30);

$hydx[]=$dbq_rec;
}
unset($dbq_rec);

include template('index');
?>

我把路径改了 时区改了 现在报include template('index'); 这一行的错
0 @filemtime($objfile)) { require_once $shop_root.'./include/template.php'; //parse_template($file, $templateid, $tpldir); parse_template($tplfile,$objfile); } // } return $objfile; } function showmessage($show_message, $url_forward = '') { extract($GLOBALS, EXTR_SKIP); include language('messages'); if(isset($language[$show_message])) { eval("\$show_message = \"".$language[$show_message]."\";"); } $url_redirect = $url_forward ? '' : NULL; if ($url_forward == '') unset($url_forward); include template('showmessage'); exit; } ?>
Fatal error: Call to undefined function template() in D:\www\tjaitong\index.php on line 96

这是什么原因啊 我百度google都找不到答案... 我查了 在templates 文件夹里有index.htm 文件
谁能告诉我啊 急等
...全文
153 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
libRA_kin 2010-08-01
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 dingsongtao 的回复:]
它还是用的模板系统。
估计是没有将系统的模板解释文件包含进来。
导致找不到template函数。
只有自己在相应的文件里找下,找到文件并包含进来。
[/Quote]
这应该怎么写啊 没有模板文件啊
Dleno 2010-08-01
  • 打赏
  • 举报
回复
它还是用的模板系统。
估计是没有将系统的模板解释文件包含进来。
导致找不到template函数。
只有自己在相应的文件里找下,找到文件并包含进来。
amani11 2010-08-01
  • 打赏
  • 举报
回复
undefined function template()


函数名未定义

检测函数名拼写,或者自己写相应功能的函数

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧