目前分類:CodeIgniter (6)
- Mar 21 Sat 2009 00:32
CI解決Image_lib的PNG透明alpha層無法顯示
- Mar 18 Wed 2009 00:28
Open-source free PHP CAPTCHA script
The library bug had be find by Tongshuai.It's seem because SESSION problem in different CI version.If you got the same trouble,you can try the solution that Tongshuai's comment
(2009-04-24)
這是什麼?請看http://www.phpcaptcha.org/captcha-gallery/就知道了。
沒錯,他就是驗證圖片產生器這個類別庫源自於 http://www.phpcaptcha.org/整個類別庫只有一個檔案而且相當好使用,所以我就試著把他改成可以放在CI來使用
安裝:
- 下載Securimage類別庫:http://doublekai.org/files/Securimage_For_CI.zip
- 複製檔案 libraries / Securimage.php 到 application / libraries
- 複製檔案 config / Securimage.php 到 application / config
- 複製目錄 views / fonts 到 application / views
如果你想要馬上測試的話
- 複製檔案 controlls / welcome.php 到 application / controlls
- 複製檔案 controlls / image.php 到 application / controlls
- 複製檔案 views / test.html 到 application / views
What's it? see http://www.phpcaptcha.org/captcha-gallery/
The original source from http://www.phpcaptcha.org/.It seems light and simple to use,so I try to fixed it up for CI framework
Install:
- Download the Securimage Library from http://doublekai.org/files/Securimage_For_CI.zip
- Copy file libraries / Securimage.php to application / libraries
- Copy file config / Securimage.php to application / config
- Copy dir views / fonts to application / views
if you want to quickstart test
- Copy file controlls / welcome.php to application / controlls
- Copy file controlls / image.php to application / controlls
- Copy file views / test.html to application / views
- Nov 07 Fri 2008 23:38
CI縮圖類別(Image Manipulation Class )的true color


一口一...我用了CI的Image類別,但是上傳後的圖片都失去原始的顏色了!後來記得之前有一本「專業PHP5程式設計指南」有提供縮圖章節,索性就重啃了一遍,其中有一段提到:
imagecreatetruecolor函式是被用來產生出一個準備要放置縮圖的空白圖(以PHP變數的型態存在於記憶體當中),注意涵式名稱所暗示的,這個函數將會產生出一個「真實色彩」(true color) (24位元)的圖,而不會像imagecreate那樣,只能取得「以調色盤為基礎」(palette-based) (8位元)的圖。
接著續繼趴CI的User Guide(中)(英)提到Image類別支援使用GD, GD2, ImageMagick, NetPBM的圖型函式庫。我目前設定是GD,所以我猜想會不會GD是舊函式庫,所以沒有imagecreatetruecolor()?但是工作上的同事告訴我他在GD圖型庫的環境中,能正常使用imagecreatetruecolor()
一皿一||||見鬼了!!,害我又不得開啟system\libraries\Image_lib.php進行人工趴碼了@_@,後來發現在第504行類別判斷竟然是這樣的
- Nov 05 Wed 2008 23:35
DataMapper Use Custom PK id to save()
剛又找到DM1.4.5一個不算是bug的錯誤,那就是save()函式無法儲存使用自訂的id,換句話說DM預定強制限定你的id(PK)欄位必需數字並且自動增值(auto_increment),所以沒辦法使用像是UUID來當做識別碼。
- Nov 05 Wed 2008 21:29
CodeIgniter ORM library
最近從小海那邊得知CodeIgniter有ORM的library,馬上就去下載試了一下。從文件來看DataMapper比起IgnitedRecord來得詳細多了,不過我覺得IR的名稱比較帥XD,但是我還是選用了DM了。
DM目前最新的版本是1.4.5,看著文件一步一步試著如何使用,可能之前碰過CakePHP,所以用起來相當的容易上手,一下子就差不多看完了,不過在Automated Timestamps那篇章節所說的效果我卡彈了!
- Nov 02 Sun 2008 23:19
將 PEAR 放進 CodeIgniter
這個做法是參考此篇「Using Zend Framework with CodeIgniter」修改而來的。
事實上外掛Zend的需要性可能比PEAR還要高,我之所以要外掛PEAR來做是因為CI的分頁類好像有問題@_@,索性就直接使用PEAR的分頁類了,而且PEAR的分頁類還有Jumping和Sliding不同模式可選用,在某些情況下,PEAR的彈性可能比較高。however...看你喜不喜歡多掛一個做同樣事情的library而已。