Smartyエラー

[Fri Oct 15 05:47:06 2010] [error] [client 192.168.0.2]
PHP Warning:  Smarty error: unable to read resource:
"tmpl/download.tpl" in /usr/lib64/php/Smarty/libs/Smarty.class.php on line 1093,
 referer: http://ほげ/show.php?datno=1286294784

とりあえずSilverlightを覚えるよりも知ってるやつでつくろうってことでSmarty使って2chブラウザ作ってるんですが、

なぜかこのdownload.tplだけ読み込めない。

ちなみにソースは

download.php

<?php
require_once("config.php");
require_once"Archive/Zip.php";
require_once"Smarty.class.php";
require_once($path['lib'].$escstr."2ch_function.php");
require_once($path['lib'].$escstr."zip.lib.php");
$zipFile = new zipfile();
$datno = $_GET['datno'];
$path['cmp'] = $path['work']."/src/".$datno."/img/";
$path['zip'] = $path['work']."/src/".$datno."/".$datno.".zip";
$path['zipurl'] = "./src/".$datno."/".$datno.".zip";
$path['str'] = $datno;
chdir($path['cmp']);
$filelist = fFileListLoad($path['cmp']);
$filelist = str_replace($path['cmp'], '', $filelist);
$p_params = array('add_path' => $path['str']);
$objZip = new Archive_Zip($path['zip']);
$fileName = $filelist;
$text = $objZip->create($fileName,$p_params);
$smarty = new Smarty();
$smarty -> assign('zippath', $path['zipurl']);
$smarty -> assign('datno', $datno);
$smarty -> display($dirpath['templ'].'/download.tpl');
?>

download.tpl

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
 <title>2ch画像</title>
 <meta name="keywords" content="2ch画像" />
 <meta name="description" content="2ch画像収集してZIPで" />
 <link rel="stylesheet" href="./lib/main.css" type="text/css" />
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <meta http-equiv="Content-Style-Type" content="text/css" />
 <script src="./lib/jquery.js" type="text/javascript"></script>
 <script src="./lib/main.js" type="text/javascript"></script>
</head>
<body>
 <div id="header_all">
 <div id="header">
 <p><a href="index.html"><img src="img/logo.png" alt="画像収集" /></a></p>
 <h1>画像収集</h1>
 </div>
 <div id="contents">
 <div id="menu">
 <ul>
 <li><a href="./">TOP</a></li>
 <li><a href="index.html">DAT落一覧</a></li>
 <li><a href="index.html">TEST</a></li>
 <li><a href="index.html">TEST</a></li>
 <li><a href="index.html">TEST</a></li>
 </ul>
 </div>
 <div id="main_img">
 <div id="main">
 <div id="right">
 <p>操作メニュー</p>
 <div id="sidemenu">
 <ul>
 <li><a href="./subject.php">VIPスレ一覧へ</a></li>
 <li><a href="./download.php?datno={$datno}">このスレの画像をZIPでDL</a></li>
 </ul>
 </div>
 <p><img src="img/banner.png" alt="此処には代替テキストを挿入してください。" /></p>
 <p><img src="img/banner.png" alt="此処には代替テキストを挿入してください。" /></p>
 </div>
 <div id="left">
 <h2>取得済み一覧</h2>
 <dl>
 <dt>レス数:{$datan.resno}</dt>
 <dd></dd>
 </dl>
 <div id="product">
 <h3>ZIPファイルダウンロード:{$datno}.zip</h3>
 <p><a herf="{$zippath}"><img src="./img/zip.php" border="0" /></a></p>
 </div>
 </div>
 </div>
 </div>
 <div id="footer">
 <p>Copyright&copy; <a href="http://template-compassion.info/">COMPASSION</a> 2010 All Rights Reserved.</p>
 </div>
 </div>
</body>
</html>

こんな感じ。

圧縮部分のfFileListLoadにはそのまま「がじゃぱ!ブログ」さんの「Archive_Zipを使って、ディレクトリごと圧縮するPHP」を使ってます。

こういう細かくはわからないエラーってすごい手がつけにくい・・・。

しかもindexや他でSmartyを使ったら普通に使えてるので定義した関数が原因なのかなーとは思うんですが、ワケが分からない・・・

コメントを残す