歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 27, 2024, 01:24:35 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  支援  |  使用與操作  |  请教达人: « 上篇主題 下篇主題 »
頁: [1]
作者 主題: 请教达人:  (閱讀 8447 次)
huywings
新手見習
*
文章: 11


檢視個人資料
« 於: 四月 09, 2007, 12:47:33 上午 »

我用了论坛一位朋友修改的Hemingway-beta模板,发现在发表回复时会出现下面的错误,但该回复却已经成功提交:
引用
Exception message: Smarty error: unable to read resource: "Hemingway-beta/postandcomments.template"
Error code: 512
-- Backtrace --
/home/bbs/blog/class/template/smarty/Smarty.class.php(1108): trigger_error
/home/bbs/blog/class/template/smarty/Smarty.class.php(1604): template.trigger_error
/home/bbs/blog/class/template/smarty/Smarty.class.php(1433): template._fetch_resource_info
/home/bbs/blog/class/template/smarty/Smarty.class.php(1279): template._compile_resource
/home/bbs/blog/class/template/template.class.php(120): smarty.fetch
/home/bbs/blog/class/view/smartyview.class.php(190): template.fetch
/home/bbs/blog/class/view/blogview.class.php(224): smartyview.render
/home/bbs/blog/class/view/viewarticleview.class.php(73): blogview.render
/home/bbs/blog/class/controller/controller.class.php(325): viewarticleview.render
/home/bbs/blog/index.php(44): blogcontroller.process

我仔细看了很久postandcomments.template,也没有找到问题所在(下面给出postandcomments.template),希望各位达人能够帮帮忙,谢谢^_^

引用
{assign var="postPageTitle" value=$post->getTopic()}
{assign var="postPageTitle" value=" | $postPageTitle"}
{include file="$blogtemplate/header.template"}

{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}

<div id="primary" class="single-post">

      <div class="inside">
                  <div class="primary">
                    <h1>{$post->getTopic()}</h1>
                    {$post->getText()}
              </div>
              <hr class="hide" />
              <div class="secondary">
                    <h2>About this entry</h2>
                    <div class="featured">
                         <p>You&rsquo;re currently reading &ldquo;{$post->getTopic()},&rdquo; an entry on {$blog->getBlog()}</p>
                         <dl>
                              <dt>Published:</dt>
                              <dd>{$locale->formatDate($postDate, "%m.%d.%y / %H:%M")}</dd>
                         </dl>

               <dl>
                  <dt>{$locale->tr("categories")|capitalize}:</dt>
                     {foreach name=categories from=$post->getCategories() item=postcategory}
                  <dd><a href="{$url->categoryLink($postcategory)}"title="View all posts in {$postcategory->getName()}" rel="category tag">{$postcategory->getName()}</a>{if !$smarty.foreach.categories.last}, {/if}</dd>
              {/foreach}
                  
               </dl>
                           </div>
         </div>
         <div class="clear"></div>
      </div>

   </div>
   <!-- [END] #primary -->
   
   <hr class="hide" />
   <div id="secondary">
      <div class="inside">
         
                     <div class="comment-head">
               <h2>{$post->getTotalComments()} {$locale->tr("comments")}</h2>
               <span class="details"><a href="#comment-form">Jump to comment form</a> | <a href='http://localhost/wordpress/?feed=rss2&amp;p=5'>comments rss</a> <a href="#what-is-comment-rss" class="help">[?]</a> | <a href="http://crazylib.twbbs.org/wordpress/wp-trackback.php?p=5">trackback uri</a> <a href="#what-is-trackback" class="help">[?]</a></span>

            </div>
                  
         
<!-- You can start editing here. -->


   <ol id="comments">
       {foreach from=$post->getComments() item=comment}
           <li id="{$comment->getId()}">
                  <cite>
                       <span class="author">
                           {if $comment->getUserUrl() != ""}
                           <a href="{$comment->getUserUrl()}"}>{$comment->getUsername()}</a>
                       {else}
                           {$comment->getUsername()}
                       {/if}
                       
                       </span>
                       {assign var=commentDate value=$comment->getDateObject()}
                       <span class="date">{$locale->formatDate($commentDate, "%m.%d.%y / %H:%M")}</span>
                 </cite>
                  <div class="content">
                          {$comment->getText()}
                  </div>
                 <div class="clear"></div>
            </li>
      {/foreach}

   </ol>
   {if $blogsettings->getValue("comments_enabled") && $post->getCommentsEnabled()==1}
 
     {include file="$blogtemplate/commentform.template"}
 
 {/if}
   
    


         
               </div>
   </div>



<hr class="hide" />
   <div id="ancillary">
      {include file="$blogtemplate/panel.template"}
   </div>
   <!-- [END] #ancillary -->   
{include file="$blogtemplate/footer.template"}
已記錄
markwu
系統管理員
超級會員
*****
文章: 3928


Mark Wu


檢視個人資料 個人網站
« 回覆文章 #1 於: 四月 09, 2007, 01:26:58 上午 »

他的意思是說 Smarty 無法讀取

Hemingway-beta/postandcomments.template

這個檔案。有幾個可能性:

1. 你這個檔案不存在
2. 你這個檔案無法被你主機上的 Apache user 來讀取。

因為不知道你的情況,所以只能這樣猜了。  微笑

Mark
已記錄

huywings
新手見習
*
文章: 11


檢視個人資料
« 回覆文章 #2 於: 四月 09, 2007, 01:04:13 下午 »

他的意思是說 Smarty 無法讀取

Hemingway-beta/postandcomments.template

這個檔案。有幾個可能性:

1. 你這個檔案不存在
2. 你這個檔案無法被你主機上的 Apache user 來讀取。

因為不知道你的情況,所以只能這樣猜了。  微笑

Mark
多谢回答。postandcomments.template这个文件是存在的,那么可能就是第二种原因:這個檔案無法被主機上的 Apache user 读取。
已記錄
頁: [1]
LifeType 中文開發論壇  |  支援  |  使用與操作  |  请教达人: « 上篇主題 下篇主題 »
    前往: