[TextCube] TextCube 1.8 beta 心得

從 TC 1.7 到 TC 1.8 Alpha 到 TC 1.8 Beta,大致上的心得是這樣:
  1. 僅是 0.1 的差別,資料庫結構不變(恭喜夫人,賀喜老爺)。
  2. 檔案結構全數更動(天殺的)。
  3. TableQuery 與 DBQuery 將併入 POD Framework 中不再使用(舊的 plugins 死一半)。
  4. 新的資料庫介面叫做 DBModel(舊的 plugins 再死一半)。
  5. 開始正式支援 MySQLi、PostgreSQL,與韓國自行開發的資料庫系統 Cubrid。
  6. 保留舊有的 library 資料夾,不知道是為了相容性問題還是怎樣,沒有包成 Controller。
  7. 還是很愛用全域變數與超全域變數(global、$_GET、$_POST 應該就屬 TC 最愛用)。
  8. 可以裝在 Nginx 上面(但是我沒試過)。
  9. Workflow 改很大,改不用錢(plugins 死很大,死不用錢)。
  10. 使用很多 PHP 5 的功能,雖然是 MCV 但相對複雜很多(大概只有官方自己看得懂)。
  11. 僅支援 PHP 5.2 以上。
  12. 可以編輯標籤。
  13. 文章發佈設定上多了幾個項目(大多跟 Feed 有關)。
其實我之前也看過有人已經裝了 Beta 4 然後問了我一些問題,但是,老實說我真的愛莫能助。畢竟他已經把 TableQuery 跟 DBQuery 這兩組從 1.5 開始用到現在的 class 納入移除的 TODO 裡面,只要有插件用上的非死即傷。這種事情在 TatterTools 0.96、TatterTools 1.x 與 TextCube 1.5、TextCube 1.7 上面不知道發生過多少次了(怨),我上述列出的四個版本號,都是有重大改變的,我覺得 TC 用戶不多或是不想升級的主要原因,大概就是這樣吧(升級連資料庫結構都換掉,心臟要夠大顆的人才敢用)。

最近跟官方主要開發者連繫上,問了些關於插件的問題後閒聊了兩句,看來 TextCube 1.8 要推出的時間應該不遠了。不過看了看官方的 Ticket 還這麼多,我想推出的時間應該還有好一陣子吧(搞不好是明年)。至於大家一直期待的 TextCube 2.0,老實說,他是不是真的會推出 Open-source 的版本我是觀望啦,但是如果真的推出了,我覺得那應該是社群性非常強大的部落格系統了,我在官方給我的試用上,真的覺得社群性遠大於部落格本身的功能了。

先這樣,官方 beta 5,6 安裝檔案在 MySQLi 的安裝上有問題,不過我還是裝起來測試了一下,還算可以啦!只是又有新的語言檔案要翻譯了 翻桌

Posted by hina

2009/08/14 10:55 2009/08/14 10:55
, , , , , Keyword TextCube, , ,
Response
0 Trackbacks , 6 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/795

下載位置:http://code.google.com/p/tczh/downloads/list

修改了幾個地方。首先是加入地址搜尋、其二是要加入標記的時候,要按按鈕才行。


設定標記,按鈕可以開啟或是關閉,開啟時,在地圖上按左鍵就會加入標記,關閉時則不動作。


Posted by hina

2009/04/20 12:07 2009/04/20 12:07
, , , Keyword TextCube, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/742

[TextCube] 從 TextCube 發送 Plurk

update, 2009/04/18 更新完成所有的測試。
  1. 新增文章自動噗浪,噗上去是使用 shares 的方式,將文章標題以鏈結的方式噗到噗浪上面。另外,更新文章並不會將文章丟到噗浪上面,只有啟用插件之後新增的文章會噗上去喔!
  2. TextCube 有自動執行(類似 crontab 功能),每隔五分鐘,會掃描記錄的文章是否有回噗,有回噗的話抓下來寫入到該文章的回應。使用的寫入方式是 content_raw 所以噗浪上的所有 HTML Code 都會被洗掉。我有想過要使用 BBCode 的方式寫回 TC,不過不知道大家覺得如何(因為我的 Comments 支援 BBCode 笑)?
  3. 當回應文章的時候,姓名與密碼填上噗浪的暱稱與密碼,就會將回應內容回噗到噗浪的該篇文章下。由於這樣的方式會間接取得您的噗浪暱稱與密碼,所以,這個插件的安全性問題就在此。如果您信得過我,就用回噗,信不過,就不要將您的噗浪密碼打入。若不輸入噗浪的暱稱與密碼,則該回應不會回噗到噗浪上面。
  4. 管理者回應回覆的時候,會自動回應到噗浪上,且回應回覆的該回覆者若有是噗友,則會在管理者的回噗前面加上"回覆給 XXXX"的回噗標記(就是 @XXXX:)。
  5. 換行問題已解決,主要是因為 TC 傳回來的回應內容將 \r\n 跳脫過了,怪不得我要洗洗不到。另外昨天在各位回噗時,我發現有時區問題,噗浪傳回的是 GMT 跟部落格時間不同,所以也一併解決。附帶一提的是,我是使用 DateTimeZone 這個函式,目前只有 PHP 5 以上支援。
  6. 插件畫面設定:
  7. 這個插件會自動建立兩個資料表,分別是 tc_PlurkEntries 與 tc_PlurkResponse,這兩個資料表是用來記錄 TextCube 與 Plurk 的互聯記錄的。如果插件在 Entries 有查到 enrtyid(文章 id)時,才會與 Plurk 做回應檢查。同樣的,在做回應檢查的同時,若是 Response 內查不到 Responseid(Plurk 回應 id)時,他就會將噗浪上的回應寫入 TextCube。所以,這兩個表(特別是 PlurkResponse)請勿任意清空。
  8. 啟用與停止插件時,上述所提的資料表,有可能會自動刪除或是清空。這樣一來您的 Plurk 文章記錄就會重新來過。不過請放心,由於 Entries 表是空的,所以也不會亂抓噗浪回應回來寫入。請注意,當啟用或是停用此插件時,請確認上述二表皆以清空或不存在。
  9. 共筆作者(teamblog)在發佈上,會使用部落格擁有者的 Plurk 帳號密碼發佈,關於這一點,還要找時間測試共筆部落格的狀況,當然,多部落格就不會有這種問題了。因為共筆狀況下,部落格識別 ID 僅只有一組,如果要考慮共筆狀況,可能得改寫整個插件。目前以不使用共筆部落格為主。
  10. 時區計算已更新,除非 PEAR 模組出問題,不然 PHP 4 也可以正常使用了。因為 API 是使用 PHP 5 開發,所以對於 PHP 4 的使用者就抱歉了。
需要的人請私底下找我,謝謝。

怎麼辦 結果測試了大概 10 篇文章,40 篇留言才完成!
而且還意外的發現了 TC 1.7.x 的快取模組發生錯誤!

這個插件可以讓文章與回應跟噗浪互通,目前不打算公開,會有安全性問題,我會給某些人而以(如果他們要的話)。

這篇文章的回應,你如果在姓名的地方打入噗浪的暱稱,密碼打入你在噗浪的密碼,就可以把回應回噗到噗浪上的這篇回應裡面,這篇文章的噗浪網址在此:http://www.plurk.com/p/oos4o

倒是,TC 到現在都還有那種 Bug 實在不應該啊 怎麼辦

Posted by hina

2009/04/17 20:56 2009/04/17 20:56
, , , , , , , ,
Response
0 Trackbacks , 14 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/740

Overview

There is GoogleMap Flash pugin for TextCube. Original offical plugin using the Static Map API, but too slow to display the blog page on loading. So, there is Flash Map API for new.

More Friendly

I modified the Flash and Script in the Editor. So, when you insert the map into your article, the map will show up with image to display where you inserted. And if you want to modify your map, click the image and click the GoogleMaps button after. The googleMap popup window will get the data you setting before.

Insert map into your article like this,


When you click "Insert", the editor will insert an image into your article. If you want to modify the map you added, click the image make it focus like this,


And click the GoogleMaps button, the map data you added before will reload into the map in the popup window. And you can modify the marker data or any setting AGAIN.


More Quickly

Flash >>> Javascript. :-P

Posted by hina

2009/03/26 13:41 2009/03/26 13:41
, , , , , , , , Keyword TextCube, , , , ,
Response
0 Trackbacks , 4 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/731

DEMO, Speed UP~UP~UP~

目前開發最終版本已經送往官方測試,這個插件應該會由官方來發佈。如果想先玩玩看的人請寫 email 來跟我拿。

Screenshot






基本上,使用方式與官方的差不多,功能被我拿掉了不少(像是不能自定地圖大小)。官方的 Location 地圖功能也先被我拿掉了,想到再加回去吧!以功能面來說,目前這樣已經算是可以使用囉!就剩下一些畫面的最佳化而已了!我只能說,Flash 速度比起 Javascript 來說,真是超越神速的超神速啊!

Posted by hina

2009/03/24 16:56 2009/03/24 16:56
, , , , , , , , Keyword TextCube, , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/730



看圖說故事!只是,我不知道還有什麼其他好說的?也許,這個插件還會再改,但是,想到有些主機未必會支援某些功能,就暫且先這樣。以前在 TT/TC 的編輯器是可以插入網路圖片的,不過不知道從哪個版本之後,就消失了。所以,這也只是單純為了方便而已(懶)。

請到 Google Code 下載:
http://code.google.com/p/tczh/downloads/list

Posted by hina

2009/03/18 13:36 2009/03/18 13:36
, , , , Keyword TextCube, , , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/728

[TextCube] TC 1.7.7 patch

官方公告:Textcube 1.7.7 오류 패치 안내 (3월 7일 오후 11시 50분)

修正了兩個地方,剛好都是我之前回報給官方的錯誤。
  1. 備份資料時,修正鏈結與鏈結分類遺失的問題。
  2. 編輯文章時,修正標籤(Tag)與地域(Location)的建議功能因為 Eolin 與 TC 之間的更新導致錯誤的問題。
檔案請直接到官方下載。

Posted by hina

2009/03/16 16:45 2009/03/16 16:45
, , , Keyword TextCube, , , , , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/726

update, 新增了 tiltviewer 樣式,而且 tiltviewer 可以透過 Picasa 軟體產生 xml 檔案,非常方便!

沒圖沒真像:


檔案在這裡,請自行取用(更新,樣版檔案忘記打包到圖片了):
[##_2C|6318217339.zip|||3394807657.zip||_##]檔案結構如下:

HC_TiltViewerPhotoStudio
  • tiltviewer
    • images,照片資料夾。
    • gallery.xml,照片設定檔案。
    • swfobject.js
    • TiltViewer.swf
  • index.xml
  • skin.html
  • style.css
  • style.ie6.css
  • style.ie7.css
  • wysiwyg.css
TiltViewerPicasa.zip 這個檔案是給 Picasa 用的網頁輸出樣版,解壓縮之後,會產生 TiltViewerPicasa 資料夾,請將這個資料夾複製到 Picasa 的 templage 資料夾底下。以 Picasa 3 為例子,資料夾應該在:C:\Program Files\Google\Picasa3\web\templates,請將 TiltViewerPicasa 資料夾複製到這裡,並重新啟動 Picasa。

開啟 Picasa 之後,先挑好你要輸出的照片,把那些照片設定到新的相簿裡。然後,在新的相簿按下滑鼠右鍵,選擇"匯出為 HTML 頁面(X)"。


接著請選擇尺寸,你要選擇小張的也可以,樣版最寬是 800px 所以這邊以 800 像素為一個基準。相簿標題隨便你打,反正這不是重點。最後請記得他輸出的資料夾,不然輸出完成後會找不到檔案喔。


網頁範本,請選擇"Tiltviewer",如果你沒有這個項目可以選,請回到最上面,確定你的樣板資料夾是否已經拷貝過去,而且也重新啟動 Picasa 了。


按下"完成"之後就開始等待漫長的輸出,如果你的照片數量越多、照片尺寸越大,輸出的時間就會比較久。


最後,找到輸出的資料夾,把 image 資料夾與 gallery.xml 拷貝起來,回到樣板資料夾,貼到 titlviewer 資料夾裡面,全部蓋掉。這樣,就可以隨意更換你的照片了,而,也不用花時間去處理 XML 檔案。


以上,完畢。

附帶一提,tiltviewer 可支援 Flickr 的串接,詳情請到官方網站看說明。至於怎麼改,請自行參照說明,修改 skin.html 檔案中的 script 囉(無責)。

============================ 我是舊文分隔線 ============================

基本上就是你現在看到的這個。上面的輪播,我不想綁插件,所以需要手動去設定,是稍嫌煩瑣了點。

要的人請私底下找我。

HC_CainPhotoStudio
  • images
  • flashalbum
    • images.xml,相本設定檔案。
    • loader.swf
    • param.xml
    • slideshowpro.swf
    • swfobject.js
    • album1,相本資料夾,依照設定檔案設定。
      • images,大尺寸相片。
      • thumb,小尺寸相片。
      • preview,相簿封面。
  • skin.html
  • style.css
  • style.ie7.css
  • style.ie6.css
  • index.xml
  • wysiwyg.css
簡單說明一下 images.xml 檔案內容:
[code]
<?xml version="1.0" encoding="utf-8"?>
<gallery>
    <album lgPath="album1/images/" tnPath="album1/thumb/" title="Photo Studio, 2009 Hina/Cain Chen." description="Photo Studio, 2009 Hina/Cain Chen." tn="album1/preview.jpg">
        <img src="001.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="002.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="003.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="004.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="005.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="006.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="007.jpg" title="" caption="" link="" target="_blank" pause="" />
        <img src="008.jpg" title="" caption="" link="" target="_blank" pause="" />
    </album>
</gallery>

// <album lgPath="大尺寸相片路徑" tnPath="小尺寸相片路徑" title="相簿標題" description="相簿描述" tn="相簿封面圖片">
// <img src="圖片檔案(大小尺寸圖片檔案須相同)" title="" caption="" link="" target="_blank" pause="" />
// 其他就不贅述了
// 有多少個 <album ...>...</album> 就有多少本,依此類推。
[/code]
就這樣,我很久沒做樣版了,很懶啊(茶)。

Posted by hina

2009/03/11 13:02 2009/03/11 13:02
, , , , , , Keyword TextCube, , ,
Response
1 Trackbacks , 13 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/723

鏈結備份匯入匯出依舊沒解決,官方已經回信,會將官方發佈檔案更新。我在 Google Code 上面也放了新的檔案了。至於官方回信說什麼,這個嘛,他說太忙了沒注意到這些 bugs。

至於 1.7.7 更新了什麼?老實說,沒有

所以,想要更新的人可以緩一緩,等到 1.8 或是 2.0 推出的時候再更新就好了。

ps. 1.7.7 在新增文章時,標籤的自動建議沒辦法使用,我不知道原因,也不確定這是不是 bug。
ps2. 1.7.7 在新增文章時,區域的自動建議會列出你所輸入過的區域資料,這一點蠻方便的。
ps3. 現在確定 TagSuggest 有 BUG 了 =_______=...(雖然我改好了)

ps4. 使用"升級"安裝之後,會出現資料錯誤的狀況,若沒必要,請先別升級 1.7.7。

ps5. Tag suggestion 已確認是官方 bug(大概跟官方來回了數十封信 debug)。

Posted by hina

2009/03/06 12:26 2009/03/06 12:26
, Keyword TextCube, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/720

相信很多人都遇到了這件事情,從 TC 把資料匯出之後,再匯入其他(或是原來)的 TC 的時候,鏈結全部都不見了,只剩下一個鏈結而已。這件事情,從 TC 1.7 推出之後就已經存在,而,這個錯誤並不單純只是程序上的錯誤,而是整個資料結構上的錯誤,老實說,我覺得 TC 團隊會出這樣的錯誤實在是該打屁股了。

我們先來看看 tc_Links 這個資料表:
[code]
/// setup.php Line 1319

CREATE TABLE {$_POST['dbPrefix']}Links (
  pid int(11) NOT NULL default '0',
  blogid int(11) NOT NULL default '0',
  id int(11) NOT NULL default '0',
  category int(11) NOT NULL default '0',
  name varchar(255) NOT NULL default '',
  url varchar(255) NOT NULL default '',
  rss varchar(255) NOT NULL default '',
  written int(11) NOT NULL default '0',
  visibility tinyint(4) NOT NULL default '2',
  xfn varchar(128) NOT NULL default '',
  PRIMARY KEY (pid),
  UNIQUE KEY blogid (blogid,url)
) $charset;
[/code]
眼尖的人可以看到,有兩個關鍵欄位,pid 與 id,而這兩組關鍵欄位,pid 是主鍵,兩欄位都沒有設定 auto_increment,至於為什麼不設定,這一點我也不知道。既然他沒有設定 auto_increment 這個附加條件,那麼,我們再來看看當資料轉出(匯出)時,他的格式:
[code]
/// 僅節錄 Links 匯出的部分

<link><url>http://nzma.ushiisland.net/</url><title>NZMA::STUDIO VOICE R&amp;W</title><feed></feed><registered>1212398140</registered></link>
<link><url>http://fusionism.blogspot.com/</url><title>Fusionism Art</title><feed>http://fusionism.blogspot.com/feeds/posts/default</feed><registered>1212398085</registered></link>
<link><url>http://blog.xuite.net/nzma/diary</url><title>在草原的中心‧不存在的騎士</title><feed>http://blog.xuite.net/nzma/diary/rss.xml</feed><registered>1212560707</registered></link>

/// 後略...
[/code]
由這樣的匯出資料,我們可以猜到 id 與 pid 並沒有在他的匯出清單中,也就是說,這兩項值將來可以在匯入的時候,依照 migrational 的設定(true or false)來決定是否覆寫原來的資料。這種情況在分類的部分也可以看出端倪,分類匯出時,也沒有帶入 id 這項設定:
[code]
/// 僅節錄 Category 匯出的部分

<category><name>Chats</name><priority>1</priority>
    <category><name>Moblog</name><priority>39</priority></category>
    <category><name>blahblah</name><priority>40</priority></category>
    <category><name>nothing else</name><priority>41</priority></category>
    <category><name>funny</name><priority>42</priority></category>
    <category><name>note note note</name><priority>43</priority></category>
    <category><name>dark cooking</name><priority>44</priority></category>
</category>
<category><name>Life</name><priority>2</priority></category>
<category><name>Photography</name><priority>3</priority></category>

/// 後略...
[/code]
所以,在匯入與匯出這個部分,其實在程序上並沒有太大的問題。接著我們轉向 TC 的核心原件(Components)來看看。當 TC 在做匯入與匯出時,使用的原件是以 Data 為命名規則的所有原件庫,所以,在調用資料庫的動作時,全部都是以個別的原件庫去完成。那,我們就來看看 Textcube.Data.Link.php 到底做了甚麼事:
[#M_展開 Textcube.Data.Link.php 原始碼...|關閉原始碼...| [code]
<?php
/// Copyright (c) 2004-2008, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)

// NOTE : it does not support to save link category yet,
// due to compartibility issues with other software under 'Project Tattertools.'

class Link {
   function Link() {
       $this->reset();
   }

   function reset() {
       $this->error =
       $this->id =
       $this->title =
       $this->url =
       $this->feed =
       $this->registered =
           null;
   }
  
   function open($filter = '', $fields = '*', $sort = 'id') {
       global $database;
       if (is_numeric($filter))
           $filter = 'AND id = ' . $filter;
       else if (!empty($filter))
           $filter = 'AND ' . $filter;
       if (!empty($sort))
           $sort = 'ORDER BY ' . $sort;
       $this->close();
       $this->_result = POD::query("SELECT $fields FROM {$database['prefix']}Links WHERE blogid = ".getBlogId()." $filter $sort");
       if ($this->_result)
           $this->_count = POD::num_rows($this->_result);
       return $this->shift();
   }
  
   function close() {
       if (isset($this->_result)) {
           POD::free($this->_result);
           unset($this->_result);
       }
       $this->_count = 0;
       $this->reset();
   }
  
   function shift() {
       $this->reset();
       if ($this->_result && ($row = POD::fetch($this->_result))) {
           foreach ($row as $name => $value) {
               if ($name == 'blogid')
                   continue;
               switch ($name) {
                   case 'name':
                       $name = 'title';
                       break;
                   case 'rss':
                       $name = 'feed';
                       break;
                   case 'written':
                       $name = 'registered';
                       break;
               }
               $this->$name = $value;
           }
           return true;
       }
       return false;
   }

   function add() {
       unset($this->id);
       if (!isset($this->url))
           return $this->_error('url');
       if (!isset($this->title))
           return $this->_error('title');
      
       if (!$query = $this->_buildQuery())
           return false;
       if (!isset($this->registered))
           $query->setAttribute('written', 'UNIX_TIMESTAMP()');
      
       if (!$query->insert())
           return $this->_error('insert');
       $this->id = $query->id;
       return true;
   }
  
   function update() {
       if (!isset($this->id))
           return $this->_error('id');

       if (!$query = $this->_buildQuery())
           return false;
      
       if (!$query->update())
           return $this->_error('update');
       return true;
   }
  
   function getCount() {
       return (isset($this->_count) ? $this->_count : 0);
   }
  
   /*@static@*/
   function getId($url) {
       global $database;
       if (empty($url))
           return null;
       return POD::queryCell("SELECT id FROM {$database['prefix']}Links WHERE blogid = ".getBlogId()." AND url = '" . POD::escapeString($url) . "'");
   }
  
   /*@static@*/
   function getURL($id) {
       global $database;
       if (!Validator::number($id, 1))
           return null;
       return POD::queryCell("SELECT label FROM {$database['prefix']}Links WHERE blogid = ".getBlogId()." AND id = $id");
   }

   function _buildQuery() {
       global $database;
       $query = new TableQuery($database['prefix'] . 'Links');
       $query->setQualifier('blogid', getBlogId());
       if (isset($this->id)) {
           if (!Validator::number($this->id, 1))
               return $this->_error('id');
           $query->setQualifier('id', $this->id);
       }
       if (isset($this->url)) {
           $this->url = UTF8::lessenAsEncoding(trim($this->url), 255);
           if (empty($this->url))
               return $this->_error('url');
           $query->setQualifier('url', $this->url, true);
       }
       if (isset($this->title)) {
           $this->title = UTF8::lessenAsEncoding(trim($this->title), 255);
           if (empty($this->title))
               return $this->_error('title');
           $query->setAttribute('name', $this->title, true);
       }
       if (isset($this->feed)) {
           $this->feed = UTF8::lessenAsEncoding(trim($this->feed), 255);
           if (empty($this->feed))
               return $this->_error('feed');
           $query->setAttribute('rss', $this->feed, true);
       }
       if (isset($this->registered)) {
           if (!Validator::number($this->registered, 1))
               return $this->_error('registered');
           $query->setAttribute('written', $this->registered);
       }
       return $query;
   }

   function _error($error) {
       $this->error = $error;
       return false;
   }
}
?>
[/code]_M#]我在這裡簡單的說明一下,當使用者匯出資料時,會使用到 Link->open()、Link->shift() 與 Link->close() 把每一筆資料都寫成 TTXML 格式並寫入匯出檔案裡。這裡有一個問題:

早在 TC 1.7 就有鏈結分類功能,匯出時並未將分類匯出。

再來,第二個就是匯入。我剛剛已經說過,他應該會仿造 Category 的模式,將鏈結匯入,但是,仔細拆解 Link 類別之後,發現了兩個嚴重問題:

整個類別功能沒有因為資料結構修改而做修正,缺了 pid、id 以及 category 檢查。
在 add() 時,因為結構與匯出資料結構不符,導致匯入資料的 pid 以及 id 永遠為 0。

這也就是為什麼,鏈結匯入時,永遠只有一個鏈結的主因。我目前依照這個狀況修改了這個類別檔案,這個檔案可以用在 TC 1.7.x 版本上,請直接覆蓋掉原來的檔案。檔案請到 Google Code 下載。


http://code.google.com/p/tczh/downloads/list

Posted by hina

2009/03/05 16:37 2009/03/05 16:37
, , , Keyword TextCube, , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/719

[TextCube] 五週年

官方來信,
Dear all, our Textcube 1.7.7 as a last official support of 1.7 branch, is about to the end of its development.

We'll announce 1.7.7 RC2 at 4pm today (KST), and close every tickets in 72 hours after last RC release. Please finish your tickets on time.

And thanks to all, today we've been passed 5 years as a fans, supporters and developers of Tattertools project. There are still tremendous things to do, huge goal to achieve, however I believe we can, and we will.

Even if you are tired of your life (or whatever you've meet in recent times), let's celebrate what we've done today.

Thank you again, and be together.
Cloud.
轉眼間五年了,真是快。一點都不覺得這些事情已經有五年之久。

總而言之,TC 加油吧!

另外,我已經在準備 TC 1.7.7 RC1 的檔案,目前更新至 RC 1 也沒甚麼太大的問題。後端的通知引用回覆的地方,有個字沒有 i18n 也修改了,這一點也已經回報官方,應該會一並加入 RC2 的修改。等 RC2 釋出之後,接著就準備等 1.8 的正式版(或是 2.0?)推出了,希望 TC 能夠繼續加油啦!

Posted by hina

2009/03/02 17:52 2009/03/02 17:52
, , Keyword TextCube, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/716

[##_1L|2389849314.png|width="150" height="147" alt="用戶插入圖片"|_##]

Overview


This tool is the revision from dev.tattersite.com. I modified the code and release the beta 0.210 within ZIP-file in the Google Code.

There is way to convert Wordpress database to Textcube TTXML structure and you can import the xml file into your textcube. Cause the plugins are very different in wordpress and textcube, this tool only export entries, categories, tags, comments, trackbacks, attachments and guestbook into TTXML. And you can choose whether replace the original data in your textcube or not. Also the categories are sortable in the tool before you export data.

HOWTO

  1. Download source-code in Google Code.
  2. Un-zip into wp2ttxml/ folder and upload into your server.
  3. Open link in the browser which is http://your.domain.name/wp2ttxml/wp2ttxml.php
  4. Go start and save the TTXML file in your PC.
    1. Input your Wordpress Database Setting.
    2. Check Settings in Step 2. ATTENTION!! here, attach base url and attach base path is NOT correct in default. You MUST be fixed before you start to exoprt.
  5. Login into textcube and import the TTXML file you saved.
If your TTXML file cannot import into Textcube, there may something error in the xml file. Please email the TTXML file to me (hinablue@gmail.com).

Screenshot

  1. Front page.
  2. Second page.
  3. Export TTXML file and save as...
  4. Import into TextCube
  5. There is Sherry who convert Wordpress to Textcube using this tool.

Special thanks

Sherry

Posted by hina

2009/02/10 14:27 2009/02/10 14:27
Keyword TextCube, , , , ,
Response
0 Trackbacks , 2 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/702

[TextCube] Flickr Toy with paging

如圖所示,其實這一切,都是為了自己方便(肯定的)



請到 Google Code 下載,感謝您。
http://code.google.com/p/tczh/downloads/list

Posted by hina

2009/01/17 22:31 2009/01/17 22:31
, , , , , , Keyword TextCube, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/688

[TextCube] Auto burning SPAM plugin


SPAM 走開,讓專業的來!

下載點:
http://code.google.com/p/tczh/downloads/list

僅限 TC 1.7.x 以上的版本使用。因為自動執行這個動作好像只有 1.7 以上才有。
這個插件會自動刪除被系統標記成 isFiltered (被過濾) 的資料。
如果你是在過濾的地方自行添加過濾關鍵字的話,他也會將符合過濾資料表的引用或是回覆自動刪除。

是資料 "真實刪除" 而不是資料庫標記而已,所以使用上請小心一點。

他會每個小時自動執行,每次執行會檢查前一個小時的引用與回覆(包含留言版)
只要是 isFiltered 或是符合過濾資料表的內容的,一律會刪掉。

使用這個插件時,請先到回收桶清空一下再啟用。

另外,這個插件因為大量存取資料庫,所以當你在除錯模式的時候,他會自動停止執行。
當你的除錯模式關閉後,他才會繼續執行。

Posted by hina

2009/01/15 12:57 2009/01/15 12:57
, , , Keyword TextCube, , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/686

[code]
PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 13056 bytes) in /home/ushiisla/public_html/hina/blog/library/components/Textcube.Function.Image.php on line 33
[/code]

TextCube 你會不會太扯,雖然說 GD 很吃系統資源是事實,但是我的 memory_limit 開到 32M 你跟我說不夠是怎樣啦!我現在可以體會為什麼 JP 身為 TC 的開發人員,卻寧可另外使用縮圖引擎的原因了(怨)。

解決方法嘛,還在想,但是我實在很不想替官方搞這種很屎的問題耶(我操你媽 TC)。

ps. 我已經寫信去官方靠北一下了(怨)。

我更新檔案了,解決方式如下(其實只是避免他爆炸而已):
[code]
// 開啟 index.php 找到這個 function
function MT_Cover_getImageResizer($blogid, $filename){
    global $serviceURL;
    /// 加入下面這一行,限制使用 1/6 的 PHP 記憶體限制,或是限制 1920000,可以縮圖到 1600x1200
    $memory_allow = (!@ini_get('memory_limit')) ? 1920000 : round(max(intval(ini_get('memory_limit')), intval(get_cfg_var('memory_limit'))) * 1048576 / 6);
    /// 加入上面這一行,限制使用 1/6 的 PHP 記憶體限制,或是限制 1920000,可以縮圖到 1600x1200

    $originSrc = ROOT . "/attach/{$blogid}/{$filename}";
    $currentBlogId = getBlogId();
    $cropSize = 90;

    if (file_exists($originSrc)) {
        $imageInfo = getimagesize($originSrc);
        $newSrc = ROOT . "/cache/thumbnail/{$currentBlogId}/coverPostThumbnail/th_{$filename}";
        $imageURL = "{$serviceURL}/attach/{$currentBlogId}/{$filename}";

        /// 加入下面這一行,爆掉就直接返回 NULL
        if($imageInfo[0]*$imageInfo[1]>=$memory_allow) return NULL;
       /// 加入上面這一行,爆掉就直接返回 NULL
      
        if (extension_loaded('gd')) {
            if (!file_exists($newSrc)) {
                requireComponent('Textcube.Function.Image');

                $objThumbnail = new Image();
                if ($imageInfo[0] > $imageInfo[1])
                    list($tempWidth, $tempHeight) = $objThumbnail->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], NULL, 90);
                else
                    list($tempWidth, $tempHeight) = $objThumbnail->calcOptimizedImageSize($imageInfo[0], $imageInfo[1], 90, null);

                $objThumbnail->imageFile = $originSrc;
                if ($objThumbnail->resample($tempWidth, $tempHeight) && $objThumbnail->cropRectBySize($cropSize, $cropSize)) {
                    $imageURL = "{$serviceURL}/thumbnail/{$currentBlogId}/coverPostThumbnail/th_{$filename}";
                    $objThumbnail->saveAsFile($newSrc);
                }
                unset($objThumbnail);
            } else {
                $imageURL = "{$serviceURL}/thumbnail/{$currentBlogId}/coverPostThumbnail/th_{$filename}";
            }
        }

        return $imageURL;
    } else {
        return NULL;
    }
}
[/code]

要的人請到 Google Code 下載:
http://tczh.googlecode.com/files/MT_Meta_RecentPS_Default_fixed_20090113.zip

Posted by hina

2009/01/13 14:42 2009/01/13 14:42
, , , , Keyword TextCube, , , ,
Response
0 Trackbacks , 6 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/684

[TextCube] 官方插件 GoogleMap

這是官方在 TextCube 1.8 alpha 出現的插件,原本的版本需求要 1.8 以上才可以使用,不過,我把他中文化之後,發現 1.7.x 也可以用嘛,所以版本限定一切都是幻覺而已,嚇不倒我的(沒有誤)。

想用的人請到 Google Code 下載:

他插入文章會顯示成這樣:
[code]
[## _GoogleMap|{"center":{"latitude":23.640750128915293,"longitude":120.970458984375},"zoom":10,"width":500,"height":400,"user_markers":[{"title":"這是測試","desc":"這是測試這是測試這是測試這是測試這是測試","lat":23.492217202245076,"lng":120.9320068359375}]}|_ ##]

[/code]
其中那個"這是測試",是可以在地圖中插入標記,標記的內文似乎不支援 <br /> 斷行,所以我小修改了一下他的插件,讓他把 \n 轉換成編輯器裡面的 <br />,讓他可以正常的斷行顯示。

有興趣的人請自行下載囉,附帶一提,插件設定中可以設定預設經緯度,下載的版本預設是台灣,請自行修改。

Posted by hina

2009/01/13 13:32 2009/01/13 13:32
, , , Keyword TextCube, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/679

請到 Google Code 下載,感謝您。目前支援英文、繁體、簡體中文。
http://code.google.com/p/tczh/downloads/list

嗯,最大的用處在,當你使用 JP 的縮短內文插件,同時又使用可更改字體大小,或是觀看文章字數的插件時,由於插件載入順序的問題導致互相干擾,而使得 JP 的縮短內文插件,縮短了一堆奇怪的東西,利用這個插件來改變其他插件載入的前後順序,可以避免這種問題。

請看完美輸出範例:


後端展示:


由於本人非常懶惰,所以這個插件用滑鼠拖一拖拉一拉就可以改變載入順序並自動儲存。前提是,請開啟頁面快取功能。



就這樣,我英文很爛,不想翻譯了。

Posted by hina

2008/12/18 17:30 2008/12/18 17:30
, , , , Keyword TextCube, , , ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/669

結構又換了!這回影響的層級是:

所有的插件!

好吧,官方回覆是這樣的:
 
We will fix it soon^^ Thank you a lot.

And we will support requireComponent as a legacy function. Currently, we're focusing on integrating map application and deploying NAF (temporary name. Needlworks Application Framework). Thus sorry for late update.

Anyway, thanks again :)

至於說到底改了什麼東西,大概是這樣:
  • 使用了 jQuery
  • 修改了 include 系列檔案,連檔案名稱都一併修改如下:
    • include.php (唯一沒改變名稱的)
    • includeForBlog.php -> include.blog.php
    • includeForBlogOwner.php -> include.owner.php
    • includeForFeeder.php -> include.feeder.php
    • includeForIcon.php -> include.icon.php
    • includeForReader.php -> include.reader.php
    原有 include 內的 function 全部轉移至 Needworks.PHP.Loader.php 這個元件中
    Needworks.PHP.Loader.php 多了一個類,叫做 AutoLoad,預設存取所有內建的元件
    所有的元件、模組、程序等等需要 require 的東西全部寫入陣列中,使用上述 AutoLoad 載入
首當其衝的就是插件會受影響,只要使用到 require 系列的函式全部都無效。requireComponent,requireModel,requireView,requireLibrary,在插件內幾乎都會失效,我目前安裝的就是 TC 1.8 alpha 8 的版本,已經有兩三個插件無效,大多都是受到 requireComponent 的影響。

希望官方能重視這個問題,不然插件全部重新寫過也不無可能。

Posted by hina

2008/12/12 13:34 2008/12/12 13:34
, , Keyword TextCube,
Response
0 Trackbacks , 11 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/666

[TextCube] 2.0 將至

我已經加入 TextCube.com 的 2.0 Garnet 的測試部落格當中。

偷偷放一下後台畫面:


JeongKyu Shin 如是說:
17:17 me: TC 2.0 Garnet.... it's wonderful :-)
 Jeongkyu: 하이
  hi~
17:18 textcube.com ? :)
  Thanks a lot
  ^^
 me: YES... I just received the mail from textcube.com
17:19 Jeongkyu: ^^
  Sorry, i18n function is not implemented yet;
 me: All Korea.... :P
17:20 Jeongkyu: and .com team is porting our sources into Google-based system, thus adding new functions will take some time..
 me: It's ok... I used yahoo to translated :P
 Jeongkyu: (as you know, our commercial partner, TNC is acquired by Google)
17:21 me: hmm :-) ...
17:22 Jeongkyu: I'll return after eating dinner,
 me: OK...
 Jeongkyu: thus call me at anytime~!

期待,TC 2.0 與 Google 的到來。

其實我有一點比較不解的地方,當 TNC 被 Google 買下後,TextCube 是否還能真的維持 Open Source 的精神呢?還是說,以後的 TextCube 裡面就會出現所謂的 undocumented 的謎樣 API 了呢?不過,我想應該是不會才對,畢竟這樣做應該對 Google 來說也沒甚麼好處(吧)。


Posted by hina

2008/11/20 17:29 2008/11/20 17:29
, , , Keyword TextCube
Response
0 Trackbacks , 9 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/657

Posted by hina

2008/11/11 15:28 2008/11/11 15:28
, , , , , , Keyword TextCube, ,
Response
0 Trackbacks , 0 Comments
RSS :
http://hina.ushiisland.net/blog/rss/response/654

« Previous : 1 : 2 : 3 : 4 : 5 : ... 6 : Next »

블로그 이미지

- DearJohn

Tag Cloud

Archives

Authors

Recent Posts

Recent Comments

Recent Trackbacks

Calendar

«   2010/03   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Site Stats

Total hits:
529024
Today:
0
Yesterday:
0