歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 25, 2024, 11:07:42 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
LifeType 中文開發論壇  |  開發  |  模版設計  |  summary頁麵的最新髮錶日誌 能不能實現一行兩列 « 上篇主題 下篇主題 »
頁: [1]
作者 主題: summary頁麵的最新髮錶日誌 能不能實現一行兩列  (閱讀 10560 次)
James.Ho
新手見習
*
文章: 20


檢視個人資料
« 於: 五月 24, 2006, 11:06:25 下午 »

如題:
   象這樣的顯示傚果   

POST1    POST2

POST3    POST4

........    ........

已記錄
ajer001
LifeType 中文發展團隊
超級會員
*****
文章: 516


張阿駕


檢視個人資料 個人網站
« 回覆文章 #1 於: 五月 24, 2006, 11:50:43 下午 »

這樣應該就得自己去修改post.template了
利用table等等的去實現,加油!
已記錄

|| FreeBSD + Apache 2.x + PHP 5.x + MySQL 5.x ||
-- ajer001 AT twntwn.info --
resnick
版主
一般會員
*****
文章: 232



檢視個人資料 個人網站
« 回覆文章 #2 於: 五月 26, 2006, 06:37:48 上午 »

這應該是你要的效果吧。

http://phys.idv.tw/plog/summary.php

找到你的 summary 裡面的 recent.template
程式碼:
{foreach from=$posts item=post}
 {include file="summary/post.template"}
{/foreach}

加上紅色字的部分:
引用
{assign var="counter" value=1}
<table border="0" width="100%" id="table1" cellpadding="0" style="border-collapse: collapse">

{foreach from=$posts item=post}
   {include file="summary/post.template"}
   {assign var="counter" value="`$counter+1`"}
{/foreach}
</table>

然後找到 post.template,同樣也加上紅色字的部分吧
引用
   {assign var="blog" value=$post->getBlogInfo()}
   {assign var="request" value=$blog->getBlogRequestGenerator()}
   
   {if $counter%2!=0}
      {if $counter%4==3}
         <tr bgcolor="#F5F5F5">
      {else}
         <tr>
      {/if}
      <td valign="top">
   {else}
      <td valign="top" width="50%">
   {/if}
      
   
  <h5>{$post->getTopic()|strip_tags}</h5>
      <div class="subtitle">
         {$locale->tr("blog")} <a href="{$request->postPermalink($post)}">{$blog->getBlog()}</a>
    </div>
    <p>
       {$post->getText()|strip_tags|truncate:200:"..."}
    </p>
   
    <div class="peu">
    {assign var="postCategories" value=$post->getCategories()}
    {assign var="postOwner" value=$post->getUserInfo()}
    {assign var="postDate" value=$post->getDateObject()}
       <a href="{$request->postPermalink($post)}" class="noborder">
          <img src="imgs/post.png" width="10" height="11" alt="Permalink" />
      </a>
         &nbsp;{$locale->tr("posted_by")} {$postOwner->getUsername()},  {$locale->formatDate($postDate,"%e %B %Y")} |
        <img src="imgs/comment.png" width="11" height="10" alt="{$locale->tr("comments")}" />&nbsp;
        <a href="{$request->postPermalink($post)}#comments">{if $post->getTotalComments() eq 0}{$locale->tr("comment on this")}{else}{$post->getTotalComments()} {$locale->tr("comments")|capitalize}{/if}</a>
        <br style="clear: both;" />
    </div>
         </td>
   {if $counter%2==0}
         </tr>
      {/if}

這樣應該就OK了吧。
« 最後編輯時間: 五月 26, 2006, 06:52:41 上午 由 resnick » 已記錄
James.Ho
新手見習
*
文章: 20


檢視個人資料
« 回覆文章 #3 於: 五月 26, 2006, 08:39:58 上午 »

 開懷大笑    嚴重感謝.    收藏之... 
已記錄
頁: [1]
LifeType 中文開發論壇  |  開發  |  模版設計  |  summary頁麵的最新髮錶日誌 能不能實現一行兩列 « 上篇主題 下篇主題 »
    前往: