<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>貳夢の弦 &#187; 專案</title>
	<atom:link href="http://blog.frost.tw/tag/%e5%b0%88%e6%a1%88/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.frost.tw</link>
	<description>夢醒之時，驚覺一切都是虛幻。前行吧！迷途者。</description>
	<lastBuildDate>Wed, 26 Oct 2011 13:28:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://blog.frost.tw/?pushpress=hub'/>
		<item>
		<title>寒假結束前夕的趕工</title>
		<link>http://blog.frost.tw/web-project/poston-2011-02-08/postid-1080</link>
		<comments>http://blog.frost.tw/web-project/poston-2011-02-08/postid-1080#comments</comments>
		<pubDate>Tue, 08 Feb 2011 11:17:09 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[網站專案]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[生活]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[設計]]></category>
		<category><![CDATA[雜記]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=1080</guid>
		<description><![CDATA[寒假時間不多了！ 不知道我是否能夠如期完成網站呢～ 就目前情況來看，我可以先把程式放一邊。 先來準備做版面設計了（趴 今天的特色圖片就是正在製作的版面。 不過，老爸也沒告訴我這 Project 的站名呢～ 我就暫時以我自己判定的「資訊」來命名吧！ 也許有人會問為什麼是「入口頁」 我也不知道，不過老爸他們的想法認為這個東西有他的吸引力。 嘛，反正我不管這的。 今晚看完漫畫、動畫後，還有不少時間。 希望可以切版完成。 明天把會員系統完成後，再來把主體（頁面產生）的功能做出來。 接著是連結組的設定。 之後我想應該就沒什麼了吧（大概 看起來不多東西，後續還得再處理 Multi-Site 的部份呢（滾動 都處理好之後，我想就能上場了！ 不過 Control Panel 的設計還是得要再加強。 （如果以我測試的版本，應該很多潛在用戶無法適應吧……） 呼，希望我如期完成！ （不過Codeigniter內建的jQuery功能是不是有點少阿？）<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-30%2Fpostid-469&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">程式、設計等對我來說</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2011-01-24%2Fpostid-966&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">兩本設計新書入手</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-08-15%2Fpostid-641&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">久違的程式</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2009-09-07%2Fpostid-16&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">何時能步上的設計師之路</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>寒假時間不多了！<br />
不知道我是否能夠如期完成網站呢～</p>
<p>就目前情況來看，我可以先把程式放一邊。<br />
先來準備做版面設計了（趴<br />
<span id="more-1080"></span><br />
今天的特色圖片就是正在製作的版面。<br />
不過，老爸也沒告訴我這 Project 的站名呢～</p>
<p>我就暫時以我自己判定的「資訊」來命名吧！<br />
也許有人會問為什麼是「入口頁」<br />
我也不知道，不過老爸他們的想法認為這個東西有他的吸引力。<br />
嘛，反正我不管這的。</p>
<p>今晚看完漫畫、動畫後，還有不少時間。<br />
希望可以切版完成。</p>
<p>明天把會員系統完成後，再來把主體（頁面產生）的功能做出來。<br />
接著是連結組的設定。</p>
<p>之後我想應該就沒什麼了吧（大概</p>
<p>看起來不多東西，後續還得再處理 Multi-Site 的部份呢（滾動<br />
都處理好之後，我想就能上場了！</p>
<p>不過 Control Panel 的設計還是得要再加強。<br />
（如果以我測試的版本，應該很多潛在用戶無法適應吧……）</p>
<p>呼，希望我如期完成！<br />
（不過Codeigniter內建的jQuery功能是不是有點少阿？）</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-30%2Fpostid-469&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">程式、設計等對我來說</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2011-01-24%2Fpostid-966&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">兩本設計新書入手</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-08-15%2Fpostid-641&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">久違的程式</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2009-09-07%2Fpostid-16&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2011-02-08%2Fpostid-1080">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">何時能步上的設計師之路</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/web-project/poston-2011-02-08/postid-1080/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一個全新的計畫！</title>
		<link>http://blog.frost.tw/article/poston-2010-04-25/postid-507</link>
		<comments>http://blog.frost.tw/article/poston-2010-04-25/postid-507#comments</comments>
		<pubDate>Sun, 25 Apr 2010 11:04:46 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[文學創作]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[生活]]></category>
		<category><![CDATA[網站]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=507</guid>
		<description><![CDATA[雖然我的事情已經多到我快被淹沒了！ 但是，我的興趣、夢想，不能拋棄！ 目前正在和兩位友好的網友秘密策劃一個對「架站新手」的服務。 不過，公開與實行之前，還是要問一下大家的感想喔！ 這個計畫也對我們有「利益」 不過我想利益不高，頂多能平衡我們三人的網站支出吧！ 那麼，請問大家，如果你是一個「超級新手」想架站時，有人這樣提供你服務，你願意用嗎？ 1. 在免空幫你架設網站 2. 這個免空有廣告，但是可以有條件去除（如放置連結） 3. 當你學成之後，提供你們路找到更好的免空與主機商 4. 網站上隨時都有教學可以閱讀，但是部份教學會收取小費用（如一些鮮為人知的技巧） 5. 沒有即時的客服，但是可以發送客服單（兩天內回覆） 6. 第一次需要架站時，可以幫你架設 10 種左右的網站 希望看到這篇的網友，能夠給我一些建議。 因為這些會影響到往後計畫的規劃，我並不希望新手的福利變少。 這個計畫，我們預定在暑假時期開始運作。 而我們也找好了品質不錯的免空，願意提供我們無廣告的免空。 當然，更多詳細資訊都是保密的。 （但是可以確定，我們有心做好這項服務。） 附註：我們基於 Byethost 免空，有經驗的朋友可以排除這項計畫。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2009-11-23%2Fpostid-194&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">網站專案考慮中……</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-04-20%2Fpostid-500&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">談記憶中的架站(3) – 資源越來越多</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-04-19%2Fpostid-499&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">談記憶中的架站(2) - 越來越容易</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-04-12%2Fpostid-489&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">檢討，聳動的網誌標題</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>雖然我的事情已經多到我快被淹沒了！<br />
但是，我的興趣、夢想，不能拋棄！<br />
目前正在和兩位友好的網友秘密策劃一個對「架站新手」的服務。<br />
不過，公開與實行之前，還是要問一下大家的感想喔！<br />
<span id="more-507"></span><br />
這個計畫也對我們有「利益」<br />
不過我想利益不高，頂多能平衡我們三人的網站支出吧！</p>
<p>那麼，請問大家，如果你是一個「超級新手」想架站時，有人這樣提供你服務，你願意用嗎？<br />
1. 在免空幫你架設網站<br />
2. 這個免空有廣告，但是可以有條件去除（如放置連結）<br />
3. 當你學成之後，提供你們路找到更好的免空與主機商<br />
4. 網站上隨時都有教學可以閱讀，但是部份教學會收取小費用（如一些鮮為人知的技巧）<br />
5. 沒有即時的客服，但是可以發送客服單（兩天內回覆）<br />
6. 第一次需要架站時，可以幫你架設 10 種左右的網站</p>
<p>希望看到這篇的網友，能夠給我一些建議。<br />
因為這些會影響到往後計畫的規劃，我並不希望新手的福利變少。</p>
<p>這個計畫，我們預定在暑假時期開始運作。<br />
而我們也找好了品質不錯的免空，願意提供我們無廣告的免空。</p>
<p>當然，更多詳細資訊都是保密的。<br />
（但是可以確定，我們有心做好這項服務。）</p>
<p>附註：我們基於 Byethost 免空，有經驗的朋友可以排除這項計畫。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2009-11-23%2Fpostid-194&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">網站專案考慮中……</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-04-20%2Fpostid-500&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">談記憶中的架站(3) – 資源越來越多</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-04-19%2Fpostid-499&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">談記憶中的架站(2) - 越來越容易</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-04-12%2Fpostid-489&from=http%3A%2F%2Fblog.frost.tw%2Farticle%2Fposton-2010-04-25%2Fpostid-507">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">檢討，聳動的網誌標題</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/article/poston-2010-04-25/postid-507/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>DIY一個PHP留言板之讀取解析</title>
		<link>http://blog.frost.tw/web-project/poston-2010-03-12/postid-446</link>
		<comments>http://blog.frost.tw/web-project/poston-2010-03-12/postid-446#comments</comments>
		<pubDate>Fri, 12 Mar 2010 11:08:55 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[網站專案]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[程式]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=446</guid>
		<description><![CDATA[經過前幾次的「教學」 其實我也發現，直接提供程式碼和註解對新手實在不利。 因此本篇文章會解析讀取的技巧。 首先，是 glob() 函式的使用。 $paths = glob("./data/*.txt"); //讀取留言路徑 glob是一個依照「路徑」讀取檔案的函式，這點大家一定都很清楚。 不過卻可以使用 * 字元，把所有路徑都讀取。 如 data 目錄下有 a.txt , b.txt, c.dat 3個檔案，在上述的情況下，會將 a.txt 與 b.txt 的路徑存入陣列。 而留言需要排序，因此使用 sort() 函式。 sort($paths, SORT_NUMERIC); //將路徑以數值排序 通過 sort 排序陣列，如果鎮列原本是混亂的，那麼會被排列整齊，並且依照規則。 如：依照字母、數字大小等等 SORT_NUMERIC 則是「將值以數字排序」 當然，也可以利用「自訂排列規則」的方式進行排列。 接著我們需要能夠讀取檔案。 &#8230; <a href="http://blog.frost.tw/web-project/poston-2010-03-12/postid-446">Continue reading <span class="meta-nav">&#8594;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(四)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">新的作品完成！</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>經過前幾次的「教學」<br />
其實我也發現，直接提供程式碼和註解對新手實在不利。<br />
因此本篇文章會解析讀取的技巧。<br />
<span id="more-446"></span><br />
首先，是 glob() 函式的使用。</p>
<pre class="brush: php">
$paths = glob("./data/*.txt"); //讀取留言路徑
</pre>
<p>glob是一個依照「路徑」讀取檔案的函式，這點大家一定都很清楚。<br />
不過卻可以使用 * 字元，把所有路徑都讀取。<br />
如 data 目錄下有 a.txt , b.txt, c.dat 3個檔案，在上述的情況下，會將 a.txt 與 b.txt 的路徑存入陣列。</p>
<p>而留言需要排序，因此使用 sort() 函式。</p>
<pre class="brush: php">
sort($paths, SORT_NUMERIC); //將路徑以數值排序
</pre>
<p>通過 sort 排序陣列，如果鎮列原本是混亂的，那麼會被排列整齊，並且依照規則。<br />
如：依照字母、數字大小等等<br />
SORT_NUMERIC 則是「將值以數字排序」<br />
當然，也可以利用「自訂排列規則」的方式進行排列。</p>
<p>接著我們需要能夠讀取檔案。</p>
<pre class="brush: php">
$contents = file_get_contents('./data/comments.txt'); //讀取 ./data/comments.txt 的內容
</pre>
<p>file_get_contents() 是 PHP4 新增的函式，我想市面上應該沒有 PHP3 的主機。<br />
如果不確定版本，可以使用 phpinfo() 來檢查。</p>
<p>這個函式原理很簡單，把路徑的檔案內容一次不漏的讀取，並且放進變數。</p>
<p>不過我們的留言是特殊的規則：</p>
<pre class="brush: html">
;subject
留言標題
;nickname
暱稱
;contents
留言
換行
</pre>
<p>因此需要使用迴圈搭配，來找出各數值的內容。<br />
*其實也可以用preg_match之類的方式把數值抓出，使用迴圈慢慢讀取是為了「可擴充欄位」</p>
<pre class="brush: php">
$contents = file_get_contents('./data/comments.txt'); //讀取
$contents = explode(PHP_EOL, $contents); //用換行字元分割 *Linux以 \n 換行， Windows 以 \r\n 換行
foreach($contents as $line){ //foreach 是把陣列值一一讀取
  if(!$line) continue;
  if($line[0] == ';'){
    $dKey = substr(1, $line);
    continue;
  }
  if(!$dKey) continue;
  if($dkey == 'contents')
    $data[$dkey][] = $line;
  else
    $data[$dkey] .= $line;
}
</pre>
<p>exoplde() 函式會依照指定的字元、字串，將字串切割。<br />
如：a|b|c 以 | 為切割字元，則傳回 Array( [0] => a [1] => b [2] => c )</p>
<p>接著在迴圈中，做非常多的判斷。<br />
Ex. if(!$line) continue;<br />
! 為相反字元，當變數有值時也相當於 boolen 的 true, 因此 false 反轉就是 true<br />
而執行 continue; 結束本次迴圈。<br />
這類用法也有 break; 結束迴圈，可以在某條件下停止。</p>
<p>substr() 則是擷取字串，如 abcdef 使用 substr(2, &#8216;abcdef&#8217;) 則傳回 cdef<br />
這點原理何在呢？</p>
<p>程式中，字串其實是由 char[] 陣列組成，因此 $line[0] 即是 $line 字串的第一個字元。<br />
而 substr 就是把字串從指定的陣列key開始讀取到最後一個。</p>
<p>經過這些步驟之後，終於完成了「讀取」的效果。<br />
傳回的 $data 可以讀到檔案中各種資料。</p>
<p>不過仍有一個小 bug 會發生，在正式的實作時，這個會直接修正掉。<br />
( 在這之前，檢查看看讀取的判斷式，哪裡出現矛盾，資料中含有什麼會發生問題。 )</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(四)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">新的作品完成！</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/web-project/poston-2010-03-12/postid-446/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>新的作品完成！</title>
		<link>http://blog.frost.tw/life/poston-2010-03-11/postid-445</link>
		<comments>http://blog.frost.tw/life/poston-2010-03-11/postid-445#comments</comments>
		<pubDate>Thu, 11 Mar 2010 11:16:51 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[生活雜記]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[程式]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=445</guid>
		<description><![CDATA[其實這樣斷斷續續做下來，大致上花了一星期。 不過整個開發時間卻集中在上周日的一整天，相較過去，開發速度快上很多。 不過，我想這個系統大概沒什麼人有興趣吧！ 這款其實是開發來給我放置教學用的系統，因此構造非常簡單。 不過也不算是小型的系統，算是一種輕巧的網頁產生器。 主要特色： 1. 版模系統 &#8211; 更換容易 2. BBCode + Wiki &#8211; 方便的撰寫結構 3. 簡易快取 &#8211; 減少多次分析版模的次數，加快運作 4. 中文支援 &#8211; 從 MediaWiki 學來的方法，其實挺不錯的！ 5. 簡潔的畫面 &#8211; 其實我很不擅長做複雜的東西，所以畫面非常簡單。 6. 簡易管理功能 &#8211; 其實修改設定檔還挺累的，所以就做了簡易的更改頁。 不過，很多人看到這款，都會有疑問「要做什麼用？」 說真的，用途就是「快速產生網頁」 沒什麼特別的意義，唯一的優點就是「產生網頁」 從一個空白的檔案寫出一個網頁，並且設置連結、目標，有點稍嫌麻煩。 不過使用這個系統，只需要把創作的頁面位子輸入，並且編輯即可完成畫面。 不過目前功能過於簡單，還無法提供大量使用。 &#8230; <a href="http://blog.frost.tw/life/poston-2010-03-11/postid-445">Continue reading <span class="meta-nav">&#8594;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(四)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之讀取解析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>其實這樣斷斷續續做下來，大致上花了一星期。<br />
不過整個開發時間卻集中在上周日的一整天，相較過去，開發速度快上很多。<br />
不過，我想這個系統大概沒什麼人有興趣吧！<br />
<span id="more-445"></span><br />
這款其實是開發來給我放置教學用的系統，因此構造非常簡單。<br />
不過也不算是小型的系統，算是一種輕巧的網頁產生器。</p>
<p>主要特色：<br />
1. 版模系統 &#8211; 更換容易<br />
2. BBCode + Wiki &#8211; 方便的撰寫結構<br />
3. 簡易快取 &#8211; 減少多次分析版模的次數，加快運作<br />
4. 中文支援 &#8211; 從 MediaWiki 學來的方法，其實挺不錯的！<br />
5. 簡潔的畫面 &#8211; 其實我很不擅長做複雜的東西，所以畫面非常簡單。<br />
6. 簡易管理功能 &#8211; 其實修改設定檔還挺累的，所以就做了簡易的更改頁。</p>
<p>不過，很多人看到這款，都會有疑問「要做什麼用？」</p>
<p>說真的，用途就是「快速產生網頁」<br />
沒什麼特別的意義，唯一的優點就是「產生網頁」</p>
<p>從一個空白的檔案寫出一個網頁，並且設置連結、目標，有點稍嫌麻煩。<br />
不過使用這個系統，只需要把創作的頁面位子輸入，並且編輯即可完成畫面。<br />
不過目前功能過於簡單，還無法提供大量使用。</p>
<p>整款系統參考很多 MediaWiki 和 Discuz 的技巧，也許很多人會感到親切吧！<br />
另外還有幾項缺陷，打算下次更新時改進。<br />
第一個是 Index (索引) 和 Page (頁面) 還未有區分，因為我還想不出來如何索引資料比較好。<br />
另外則是我希望像 MediaWiki 設計一個輸入 [分類:PHP] 而打開 分類:PHP 就會開到其下檔案的功能。<br />
不過目前也無方向製作，希望有一天能夠完成。</p>
<p>看這自己進步，算是有點成就感吧！<br />
今天在看書的時候，看到一句話：「放慢腳步，好好思考。」<br />
其實，我很多時候真的走太快，但是我很慶幸我最後會停下思考。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(四)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之讀取解析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Flife%2Fposton-2010-03-11%2Fpostid-445">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/life/poston-2010-03-11/postid-445/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY一個PHP留言板之反思(一)</title>
		<link>http://blog.frost.tw/web-project/poston-2010-03-10/postid-444</link>
		<comments>http://blog.frost.tw/web-project/poston-2010-03-10/postid-444#comments</comments>
		<pubDate>Wed, 10 Mar 2010 11:01:16 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[網站專案]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[網站]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=444</guid>
		<description><![CDATA[經過一斷時間的思考之後，多多少少會發現先前的系統有問題。 在許多情況之下，一開始的設計並不是很好。 在經過幾次開發之後，其實開始發現有些不切實際的製作和多餘的動作。 首先，先把原本預定的功能找出來： 1. 版模 2. 仿HTML標籤 3. 可覆蓋 4. BBcode 等等…… 但是現在反思，「這個留言板要給誰用？讓誰學會呢？」 一開始我的目標是針對「新手」 那麼這些功能是否太困難了？ 「是的，真的太困難！」 那個改進方向呢？ 「針對『製作留言板』來進行重點教學」 結論： 1. 留言、回覆留言 2. BBCode ( 基於安全性，這點要重點教學 ) 3. 管理功能 ( 就算再討厭，還是得做 ) 下次的教學會和大家分享留在「資料存取(一)提到的讀取技巧，並且加以改善」<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之讀取解析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fcode%2Fposton-2010-02-08%2Fpostid-380&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">SWFUpload 讓上傳可以選個檔案</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>經過一斷時間的思考之後，多多少少會發現先前的系統有問題。<br />
在許多情況之下，一開始的設計並不是很好。<br />
在經過幾次開發之後，其實開始發現有些不切實際的製作和多餘的動作。<br />
<span id="more-444"></span><br />
首先，先把原本預定的功能找出來：<br />
1. 版模<br />
2. 仿HTML標籤<br />
3. 可覆蓋<br />
4. BBcode<br />
等等……</p>
<p>但是現在反思，「這個留言板要給誰用？讓誰學會呢？」</p>
<p>一開始我的目標是針對「新手」<br />
那麼這些功能是否太困難了？<br />
「是的，真的太困難！」</p>
<p>那個改進方向呢？<br />
「針對『製作留言板』來進行重點教學」</p>
<p>結論：<br />
1. 留言、回覆留言<br />
2. BBCode ( 基於安全性，這點要重點教學 )<br />
3. 管理功能 ( 就算再討厭，還是得做 )</p>
<p>下次的教學會和大家分享留在「資料存取(一)提到的讀取技巧，並且加以改善」</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之讀取解析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fcode%2Fposton-2010-02-08%2Fpostid-380&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">SWFUpload 讓上傳可以選個檔案</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/web-project/poston-2010-03-10/postid-444/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY一個PHP留言板之資料存取(四)</title>
		<link>http://blog.frost.tw/web-project/poston-2010-03-08/postid-441</link>
		<comments>http://blog.frost.tw/web-project/poston-2010-03-08/postid-441#comments</comments>
		<pubDate>Mon, 08 Mar 2010 10:59:35 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[網站專案]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[程式]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=441</guid>
		<description><![CDATA[呼呼~ 接下來是製作刪除檔案的處理，其實這方面只是把之前讀取留言的功能改良而已。 除了改成只「讀主題」和「加入刪除函式」之外，就沒有其他的處理。 首先，在目錄下建立一個 remove.php 的檔案，並且撰寫程式碼(如下) &#60;?php function removeComment(array $paths){ //建立移除函式 foreach($paths as $path){ //將路徑陣列一個一個讀取 if(!is_file($path)) continue; //如果不是檔案則切到下一個繼續 unlink($path); //刪除檔案 ++$i; } return $i; } function getSubject($file){ //建立 getSubject 函式 $data = file_get_contents($file); //讀取檔案內容 $data = explode(PHP_EOL, $data); //以斷行分割檔案內容( PHP_EOL &#8230; <a href="http://blog.frost.tw/web-project/poston-2010-03-08/postid-441">Continue reading <span class="meta-nav">&#8594;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜歡：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-06%2Fpostid-437&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(三)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-05%2Fpostid-435&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之資料存取(二)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-12%2Fpostid-446&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之讀取解析</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-10%2Fpostid-444&from=http%3A%2F%2Fblog.frost.tw%2Fweb-project%2Fposton-2010-03-08%2Fpostid-441">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">DIY一個PHP留言板之反思(一)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>呼呼~<br />
接下來是製作刪除檔案的處理，其實這方面只是把之前讀取留言的功能改良而已。<br />
除了改成只「讀主題」和「加入刪除函式」之外，就沒有其他的處理。<br />
<span id="more-441"></span><br />
首先，在目錄下建立一個 remove.php 的檔案，並且撰寫程式碼(如下)</p>
<pre class="brush: php">
&lt;?php

function removeComment(array $paths){ //建立移除函式
	foreach($paths as $path){ //將路徑陣列一個一個讀取
		if(!is_file($path)) continue; //如果不是檔案則切到下一個繼續
		unlink($path); //刪除檔案
		++$i;
	}
	return $i;
}

function getSubject($file){ //建立 getSubject 函式
	$data = file_get_contents($file); //讀取檔案內容
	$data = explode(PHP_EOL, $data); //以斷行分割檔案內容( PHP_EOL 會依照作業系統切換 \n 或 \r\n )

	foreach($data as $key => $line){ //將內容陣列放入 foreach 運作
		if($line == ';subject'){ //檢查是否為註解
			$logSubject = (bool) true; //啟動紀錄主旨
			continue; //直接結束本次迴圈
		}

		if(!$logSubject) continue; //如果非主旨則跳過，並且繼續尋找

		$subject = $line; //紀錄主旨
		break; //離開迴圈

	}

	return $subject; //傳回取得之主旨
}

if($_POST['submit']){ //檢查是否有送出表單
	$dels = removeComment($_POST['del']); //傳入移除陣列
	echo "
<div style=\"width:50%; margin:5px auto; border:1px solid #EEE; padding:5px; text-align:center;\">成功移除{$dels}筆留言</div>

";//產生表單(送出)
}

$glob = glob('./data/*.txt'); //搜尋資料檔案
sort($glob, SORT_NUMERIC); //排序檔案( 由大到小 )

$_GET['page'] = !$_GET['page'] ? 1 : $_GET['page'];  //檢查是否有指定頁碼
$start = ($_GET['page'] - 1) * 15; //設定迴圈開始編號
$end = $_GET['page'] * 15; //設定回圈結束編號

echo '
<form action="" method="post">'; //產生表單
for($i = $start; $i < $end; ++$i){ //從開始編號運作到結束編號。
	if(empty($glob[$i])) break; //檢查是否有此筆資料，無則跳出
	$subject = getSubject($glob[$i]); //呼叫 getSubject 函式取得主旨
	/* 開始產生畫面 */
	echo "
<div style=\"width:50%; margin:5px auto; border:1px solid #EEE; padding:5px;\">主題: {$subject} -
<input type=\"checkbox\" value=\"{$glob[$i]}\" name=\"del[]\" /></div>

";

}
echo '
<div style="width:50%; margin:5px auto; border:1px solid #EEE; padding:5px; text-align:center;">
<input type="submit" name="submit" value="刪除選取" /></div>

';//產生表單(送出)
echo '</form>

';//產生表單

?&gt;
</pre>
<p>上方的 HTML 部份可能會有問題，請各位在使用時稍微注意。</p>
<p>原理大致解說：</p>
<p>顯示部份和 comment.php 無異，只是將讀取部份改為「只讀取標題」<br />
並且為了防止意外，只在「確認為標題時」才會做儲存。</p>
<p>而另外就是加入了「刪除函式」<br />
構造很簡單，將傳入的陣列依序使用 unlink 刪除檔案函式刪除。</p>
<p>而 name="del[]" 為表單的陣列用法，在 PHP 收到為 $_POST['del'] 的陣列(method="post" 狀況)<br />
每個 checkbox 儲存的 value 都是該筆留言路徑，因此刪除時只需將取得的路徑陣列傳入。</p>
<p>&#8212;</p>
<p>到了這部份，其實已經準備好製作留言板的技術。<br />
明天，即將開始的就是「正式製作」</p>
<p>不過到了這個部份，其實整個架構是很混亂的。<br />
因此明天要先做「重新規劃、整理」的處理，以免成品過度混亂。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/web-project/poston-2010-03-08/postid-441/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>DIY一個PHP留言板之資料存取(三)</title>
		<link>http://blog.frost.tw/web-project/poston-2010-03-06/postid-437</link>
		<comments>http://blog.frost.tw/web-project/poston-2010-03-06/postid-437#comments</comments>
		<pubDate>Sat, 06 Mar 2010 11:12:00 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[網站專案]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[程式]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=437</guid>
		<description><![CDATA[經過了兩天琢磨讀取功能，目前已經有一個稍微完善的讀取系統。 那麼，現在就要來製作「寫入」的部份。 實際上在 PHP5 之後可以使用方便的函式寫入，不過為了顧及到 PHP4 所以還是改良一下語法。 首先，我們先任意建立一個網頁( html 或者 php 皆可 ) 並且製作一個表單，作為留言使用： &#60;form method="post" action="post.php"&#62; 主旨：&#60;input type="text" size="20" name="subject" /&#62;&#60;br /&#62; 暱稱：&#60;input type="text" size="20" name="nickname" /&#62;&#60;br /&#62; 留言：&#60;textarea name="contents"&#62;&#60;/textarea&#62; &#60;input type="submit" name="submit" value="送出" /&#62; &#60;/form&#62; 因為表單指向 post.php 因此，新增 &#8230; <a href="http://blog.frost.tw/web-project/poston-2010-03-06/postid-437">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>經過了兩天琢磨讀取功能，目前已經有一個稍微完善的讀取系統。<br />
那麼，現在就要來製作「寫入」的部份。<br />
實際上在 PHP5 之後可以使用方便的函式寫入，不過為了顧及到 PHP4 所以還是改良一下語法。<br />
<span id="more-437"></span><br />
首先，我們先任意建立一個網頁( html 或者 php 皆可 )<br />
並且製作一個表單，作為留言使用：</p>
<pre class="brush: html">
&lt;form method="post" action="post.php"&gt;
主旨：&lt;input type="text" size="20" name="subject" /&gt;&lt;br /&gt;
暱稱：&lt;input type="text" size="20" name="nickname" /&gt;&lt;br /&gt;
留言：&lt;textarea name="contents"&gt;&lt;/textarea&gt;
&lt;input type="submit" name="submit" value="送出" /&gt;
&lt;/form&gt;
</pre>
<p>因為表單指向 post.php 因此，新增 post.php 接收留言資訊：</p>
<pre class="brush: php">
&lt;?php

function createComment(array $data){ //建立產生檔案函式
	$eol = PHP_EOL; //指定換行字元 \n 或 \r\n
	foreach($data as $key => $value){ //讀取傳入的資料
		/*
			寫入格式：
			;(陣列鍵值) Ex. ;subject
			(資料)
		*/
		if($i > 0) //檢查是否為第1筆
			$contents .= "{$eol};{$key}{$eol}{$value}"; //如果為非，則在每筆資料前加入換行
		else
			$contents .= ";{$key}{$eol}{$value}"; //如果為真，則照一般方式儲存
		++$i; //增加1 做為判斷資料筆數
	}
	$dataPath = './data/'.time().'.txt'; //指定儲存路徑
	if(PHP_VERSION > 5){ //檢查 PHP 版本
		file_put_contents($dataPath, $contents); //使用PHP5新增函式
	}else{
		$fp = fopen($dataPath, 'w'); //開啟檔案
		fwrite($fp, $contents); //寫入資料
		fclose($fp); //關閉檔案
	}
}

$subject = $_POST['subject'] ? $_POST['subject'] : '無主題'; //檢查主題，無則自動設定
$nickname = $_POST['nickname'] ? $_POST['nickname'] : '匿名'; //檢查暱稱，無則自動設定
$contents = $_POST['contents'] ? $_POST['contents'] : false; //檢查內容，無則傳回假

if(!$contents){ //檢查是否有內容
	echo "填寫不完整";
	header("Location: post.htm"); //導回發表頁
}else{
	createComment(array('subject' => $subject, 'nickname' => $nickname, 'contents' => $contents)); //產生資料檔案( 目前需依照順序才能正常讀取資料 )
	header("Location: comments.php"); //引導至觀看留言頁
}

?&gt;
</pre>
<p>到此，留言板的基本功能已經完成。<br />
明天會加入簡易的刪除留言功能，希望到此各位都能理解。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/web-project/poston-2010-03-06/postid-437/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DIY一個PHP留言板之資料存取(二)</title>
		<link>http://blog.frost.tw/web-project/poston-2010-03-05/postid-435</link>
		<comments>http://blog.frost.tw/web-project/poston-2010-03-05/postid-435#comments</comments>
		<pubDate>Fri, 05 Mar 2010 11:17:52 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[網站專案]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[程式]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=435</guid>
		<description><![CDATA[昨天經過思考後，決定將「資料讀取」的方式改變。 雖然還未成熟，不過已經比起原定的方式更加完整。 今天就來實作資料讀取與版面的呈現(模型) 首先先看一下新版本的資料檔案(data.txt)： ;title 測試留言標題 ;nickname 蒼時 弦 ;contents 這是測試留言， 主要是對資料解析做測試 ;responds 奏>>回復了留言！ 影賜>>回復留言～ 接著是新的讀取程式 data.php &#60;?php function setdata($content, array $eArrs){ $datas = explode(PHP_EOL, $content); foreach($datas as $key => $line){ if($line[0] == ';'){ ++$dKey; if(in_array($line, $eArrs)) $enableArr = (bool) &#8230; <a href="http://blog.frost.tw/web-project/poston-2010-03-05/postid-435">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>昨天經過思考後，決定將「資料讀取」的方式改變。<br />
雖然還未成熟，不過已經比起原定的方式更加完整。<br />
今天就來實作資料讀取與版面的呈現(模型)<br />
<span id="more-435"></span><br />
首先先看一下新版本的資料檔案(data.txt)：</p>
<pre class="brush: html">
;title
測試留言標題
;nickname
蒼時 弦
;contents
這是測試留言，
主要是對資料解析做測試
;responds
奏>>回復了留言！
影賜>>回復留言～
</pre>
<p>接著是新的讀取程式 data.php</p>
<pre class="brush: php">
&lt;?php

function setdata($content, array $eArrs){
	$datas = explode(PHP_EOL, $content);
	foreach($datas as $key => $line){
		if($line[0] == ';'){
			++$dKey;
			if(in_array($line, $eArrs))
				$enableArr = (bool) true;
			else
				$enableArr = (bool) false;
			continue;
		}
		if($enableArr)
			$dataGroup[$dKey][] = $line;
		else
			$dataGroup[$dKey] .= $line;
	}

	return $dataGroup;
}

$eArrs = array(';contents', ';responds');
$content = file_get_contents('data.txt');

$data = setdata($content, $eArrs);

print_r($data);

?&gt;
</pre>
<p>輸出結果是一組依照順序的陣列，如果是「同一組，則再建立新陣列儲存。」</p>
<p>以上就是初步完成資料讀取了！</p>
<p>接下來就是<strong>呈現留言以及排序</strong>的處理。</p>
<p>現在新增一個 comments.php 來製作模型。</p>
<pre class="brush: php">
&lt;?php

function getComment($file, array $eArrs){ //建立 getComment 函式
	$data = file_get_contents($file); //讀取檔案內容
	$data = explode(PHP_EOL, $data); //以斷行分割檔案內容( PHP_EOL 會依照作業系統切換 \n 或 \r\n )

	foreach($data as $key => $line){ //將內容陣列放入 foreach 運作
		if($line[0] == ';'){ //檢查是否為註解
			++$dKey; //如果是則 +1
			if(in_array($line, $eArrs)) //檢查是否產生陣列(兩行以上資料需要)
				$enableArr = (bool) true; //傳回真
			else
				$enableArr = (bool) false; //傳回假
			continue; //直接結束本次迴圈
		}
		if($enableArr) //檢查是否開啟產生陣列
			$dataGroup[$dKey][] = $line; //如為真，則產生陣列儲存(二維)
		else
			$dataGroup[$dKey] .= $line; //如為假，則直接儲存資料(並且連接起來)
	}

	return $dataGroup; //傳回解析後陣列
}

$glob = glob('./data/*.txt'); //搜尋資料檔案
sort($glob, SORT_NUMERIC); //排序檔案( 由大到小 )

$eArr = array(';contents', ';responds'); //指定需要產生二維鎮列的註解

$_GET['page'] = !$_GET['page'] ? 1 : $_GET['page'];  //檢查是否有指定頁碼
$start = ($_GET['page'] - 1) * 2; //設定迴圈開始編號
$end = $_GET['page'] * 2; //設定回圈結束編號

for($i = $start; $i < $end; ++$i){ //從開始編號運作到結束編號。
	if(empty($glob[$i])) break; //檢查是否有此筆資料，無則跳出
	$comments = getComment($glob[$i], $eArr); //呼叫 getComment 函式分析檔案
	$contents = implode('', $comments[3]); //將內容部份特別分析，用結合
	/* 開始產生畫面 */
	echo "
<div style=\"width:50%; margin:5px auto; border:1px solid #EEE; padding:5px;\">主題:{$comments[1]}暱稱：{$comments[2]}內容：{$contents}</div>

";

}

?&gt;
</pre>
<p>之後請新增一個 /data 資料夾，並且新增大於二的「檔案」<br />
檔名： 1.txt ~ ?.txt (一律數字)<br />
檔案內容：</p>
<pre class="brush: html">
;title
留言標題
;nickname
留言者暱稱
;contents
留言內容，
可以換行輸入，並不會影響。
</pre>
<p>接著打開 comments.php 會發現檔名最大的兩篇被顯示，其餘的並沒有顯示。<br />
原因在哪裡呢？</p>
<p>http://網址/?page=2</p>
<p>輸入之後，會發現 (檔名最大-2) 和 (檔名最大-3) 的檔案被顯示出來。<br />
沒錯，這次讀取資料時，順便將分頁功能加入了系統。</p>
<p>明天將會繼續改善讀取功能，並且加入「發表留言」的模型。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/web-project/poston-2010-03-05/postid-435/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>網站專案考慮中……</title>
		<link>http://blog.frost.tw/life/poston-2009-11-23/postid-194</link>
		<comments>http://blog.frost.tw/life/poston-2009-11-23/postid-194#comments</comments>
		<pubDate>Mon, 23 Nov 2009 11:00:32 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[生活雜記]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[網站]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=194</guid>
		<description><![CDATA[最近初心者站長的站長，似乎更新了一下網站合作計畫。 而我正在考慮，是不是要製作中文版「網站樂透」 畢竟我不確定站長給的時間期限多長，而我還需要研發。 什麼是網站樂透呢？ 這是弦在某日，不小心看到的網站。 機制大致上是這樣，每個人每天可以送出一個網址到網站。 假如你是今天的得主，那麼今天一整天送出網址後看到的網站全部都是你的。 雖然不是什麼優化工具，也沒有什麼特殊意義。 不過只要中獎，那一整天的流量保證「大爆走」 不過我規劃的中文版本，和上面的不太一樣。 首先，有會員制度，方便做一些變化。 每個會員可以設定自己的「網站網址」還有參加的分區。 分為五區，每人只能提交一個網站和選擇一個區。 抽獎方式採用選擇五個數字，當天和系統選號結果符合最多者為該區得主。 假如無完全符合者，則依照使用者投入「點數」為高低排名。 （也可能參考讓使用者投入點數在號碼上，讓某號碼機率大增） 而點數獲得是採用點選後會顯示該日得主網站的圖示或者連結。 這樣一方面可以增加網站曝光率，又可以有變化。 不過因為站長有50%廣告收益的要求。 所以我大概會在頁底設置廣告欄位，還有得主網站顯示上方的文字小廣告。 但是大致上以使用者「不感覺不舒適」為主要訴求。]]></description>
			<content:encoded><![CDATA[<p>最近初心者站長的站長，似乎更新了一下網站合作計畫。<br />
而我正在考慮，是不是要製作中文版「網站樂透」<br />
畢竟我不確定站長給的時間期限多長，而我還需要研發。<br />
<span id="more-194"></span><br />
什麼是網站樂透呢？<br />
這是弦在某日，不小心看到的網站。<br />
機制大致上是這樣，每個人每天可以送出一個網址到網站。<br />
假如你是今天的得主，那麼今天一整天送出網址後看到的網站全部都是你的。</p>
<p>雖然不是什麼優化工具，也沒有什麼特殊意義。<br />
不過只要中獎，那一整天的流量保證「大爆走」</p>
<p>不過我規劃的中文版本，和上面的不太一樣。<br />
首先，有會員制度，方便做一些變化。<br />
每個會員可以設定自己的「網站網址」還有參加的分區。<br />
分為五區，每人只能提交一個網站和選擇一個區。</p>
<p>抽獎方式採用選擇五個數字，當天和系統選號結果符合最多者為該區得主。<br />
假如無完全符合者，則依照使用者投入「點數」為高低排名。<br />
（也可能參考讓使用者投入點數在號碼上，讓某號碼機率大增）</p>
<p>而點數獲得是採用點選後會顯示該日得主網站的圖示或者連結。<br />
這樣一方面可以增加網站曝光率，又可以有變化。</p>
<p>不過因為站長有50%廣告收益的要求。<br />
所以我大概會在頁底設置廣告欄位，還有得主網站顯示上方的文字小廣告。</p>
<p>但是大致上以使用者「不感覺不舒適」為主要訴求。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/life/poston-2009-11-23/postid-194/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ice dust of land &#8211; Beta</title>
		<link>http://blog.frost.tw/life/poston-2009-11-07/postid-150</link>
		<comments>http://blog.frost.tw/life/poston-2009-11-07/postid-150#comments</comments>
		<pubDate>Sat, 07 Nov 2009 12:37:56 +0000</pubDate>
		<dc:creator>蒼時弦や</dc:creator>
				<category><![CDATA[生活雜記]]></category>
		<category><![CDATA[團隊]]></category>
		<category><![CDATA[專案]]></category>
		<category><![CDATA[網站]]></category>

		<guid isPermaLink="false">http://blog.frost.tw/?p=150</guid>
		<description><![CDATA[網站名稱：冰塵の大地  &#8211; Beta 網站網址：http://idol.frost.tw/ 網站類型：封閉測試論壇今天下午稍微將冰塵的測試論壇放置到網路上。 目前一共有六個討論版，只有最新消息討論版一般訪客可見。 現在來簡易說明如此設置的原因。 劇情相關資訊不可洩漏 測試時穩定度太低 某些營運方針需要被鬼隱 各種技術文件不得洩漏 眾多素材需要保密 總而言之，整個論壇存在極為大量的機密資料。 而我也不想有人來「亂」 所以只針對團隊成員開設帳號，以便討論。 不過這個團隊可以說是名符其實的「忙人團」 因此我無法保證預定的 1/1 之前完成論壇公開化。 即使是論壇公開化，也只開放團隊成員以及「第一批受邀者」加入會員。 而緊接著 Version 2 的商城與契約系統開放之後，才會有更容易的加入會員。 商城：因對論壇有特殊貢獻，獲得專用貨幣可購買一些稀有品。 契約：主要為「血之契約」是以消耗建立者之血製成的特殊道具，新會員需透過此方式註冊（邀請碼強化版） 而到正式開放 Version 1 的時候，到底有哪些人擁有資格呢？ 這就要看最近的情況以及有被邀請資格者的意願了！]]></description>
			<content:encoded><![CDATA[<p>網站名稱：冰塵の大地  &#8211; Beta<br />
網站網址：<a href="http://idol.frost.tw/" target="_blank">http://idol.frost.tw/</a><br />
網站類型：封閉測試論壇<span id="more-150"></span>今天下午稍微將冰塵的測試論壇放置到網路上。<br />
目前一共有六個討論版，只有最新消息討論版一般訪客可見。</p>
<p>現在來簡易說明如此設置的原因。</p>
<ol>
<li>劇情相關資訊不可洩漏</li>
<li>測試時穩定度太低</li>
<li>某些營運方針需要被鬼隱</li>
<li>各種技術文件不得洩漏</li>
<li>眾多素材需要保密</li>
</ol>
<p>總而言之，整個論壇存在極為大量的機密資料。<br />
而我也不想有人來「亂」</p>
<p>所以只針對團隊成員開設帳號，以便討論。<br />
不過這個團隊可以說是名符其實的「忙人團」</p>
<p>因此我無法保證預定的 1/1 之前完成論壇公開化。</p>
<p>即使是論壇公開化，也只開放團隊成員以及「第一批受邀者」加入會員。<br />
而緊接著 Version 2 的商城與契約系統開放之後，才會有更容易的加入會員。</p>
<p>商城：因對論壇有特殊貢獻，獲得專用貨幣可購買一些稀有品。<br />
契約：主要為「血之契約」是以消耗建立者之血製成的特殊道具，新會員需透過此方式註冊（邀請碼強化版）</p>
<p>而到正式開放 Version 1 的時候，到底有哪些人擁有資格呢？<br />
這就要看最近的情況以及有被邀請資格者的意願了！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.frost.tw/life/poston-2009-11-07/postid-150/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

