歡迎光臨, 訪客. 請先 登入註冊一個帳號.
五月 08, 2024, 04:57:27 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
  列出文章
頁: 1 2 [3] 4 5
31  開發 / 外掛程式 / Re: 使用gallery外掛,設定完後出現Fatal error: Only variables can be passed by reference 於: 二月 28, 2007, 05:49:48 下午
那是 php 設定的問題. 把 php.ini 中的 allow_call_time_pass_reference 設成 on 就可以了.
32  開發 / 外掛程式 / Re: Gallery2整合LifeType後無法預覽照片 於: 十一月 15, 2006, 08:26:33 上午
在 gallery2 的設定中, 網址改寫的  "限制熱連接項" 不要選.
33  支援 / 使用與操作 / Re: 无法输入\字符的问题 於: 十一月 12, 2006, 06:27:15 下午
這個問題的修正我在 1.0.3 就 submit 了. 不過在 1.0.x 的官方版本並沒有包含. 1.1 確定有修正這個問題.
至少... 我在的 blog 中, 常常用到 \ 字元  (貼程式碼常用到), 自從使用修正過的版本後, 到目前的 1.1.1 為止, 我沒有碰過不能輸入 \ 的問題.

最近的一篇有 \ 字元的文章是 11/1 用 1.1.1 寫出來的. 並沒有你說的問題.
http://blog.teatime.com.tw/post/1/145
34  支援 / 安裝與設定 / Re: LifeType 1.1 的 TinyMCE秀不出來 於: 十一月 09, 2006, 08:55:14 下午
如果要直接載入 tiny_mce.js, 就不用再使用 tiny_mce_gzip.js 或 tiny_mce_gzip.php 了.
35  開發 / 外掛程式 / Re: 自製 "部落格觀察" LifeType 外掛 於: 十一月 05, 2006, 08:58:49 上午
升級到 1.1?
或... 看一下別的 1.0 使用的外掛, 有關那個部份應該怎麼寫才會正確.

1.0 與 1.1 的某些 function 的參數不太一樣, 我記得不難改..
36  建議 / 要求與建議 / 討論區搜尋問題 於: 十一月 04, 2006, 09:00:18 上午
Sorry, 這個問題與 LifeType 無關, 不過我在 "站務建議" 那區無法發表新主題 (設定有誤嗎? 不能讓人發表, 要怎麼讓人建議?)

早上要搜尋 "迴響" 時, 發現會說明有 7 頁, 但是選擇 2-7 頁時, 都會出現沒有相符的結果.
原本以為是中文搜尋有關, 不過, 剛剛用別的中文又查了一次, 並不會有這個問題.
37  支援 / 安裝與設定 / Re: 哪裡可以下載 lifetype1.1 的gallery外掛 於: 十月 23, 2006, 07:07:27 下午
這個 patch 被接受了. 作者等一下就會把檔案放到 sf.net 上頭.
38  開發 / 外掛程式 / 自製 "部落格觀察" LifeType 外掛 於: 十月 23, 2006, 10:57:42 上午
這東西是修改 Google Analytics 外掛來的. 因為兩者的設定很類似, 都是只有一個 ID, 所以就直接把來使用. 檔案我放在下頭的網址, 有需要就自行取用吧.

http://www.teatime.com.tw/~tommy/files/lifetype/lifetype_bloglook_plugin.tgz
39  支援 / 安裝與設定 / Re: 哪裡可以下載 lifetype1.1 的gallery外掛 於: 十月 22, 2006, 08:49:15 下午
剛剛裝了一個新的 LifeType 1.1 來測, 果然會有問題. 我做了修正, 請再抓一次上頭的檔案.
詳細的原因與修正的方式, 請參考:
http://blog.teatime.com.tw/post/1/137
40  支援 / 安裝與設定 / Re: 哪裡可以下載 lifetype1.1 的gallery外掛 於: 十月 20, 2006, 09:30:16 上午
那兒下載的是舊版的.
http://www.lifetype.net/blog.php/lifetype-development-journal/page/development#subversion_repository
用 subversion 抓吧, 下頭的指令可以只抓 gallery 外掛:
svn checkout http://devel.lifetype.net/svn/plog/plugins/trunk/unported/gallery

或者抓這個回去用吧:
http://www.teatime.com.tw/~tommy/files/lifetype/lifetype_1.1_gallery.tgz
41  支援 / 安裝與設定 / Re: 哪裡可以下載 lifetype1.1 的gallery外掛 於: 十月 19, 2006, 03:08:37 下午
可以抓 LifeType 1.1 svn 的 plugins 裡頭的 gallery 那個目錄出來用  (在 unported 目錄裡頭).
這個不用做任何修改就可以在 1.1 中使用.

(我之前回報過 1.1 的一個 bug, 與這個外掛有關, 會造成 gallery 不能用, 不過後來把 LifeType 有關這個的問題修正後, gallery 完全不用動就可以使用了:
http://bugs.lifetype.net/view.php?id=976

在 bug 修正後, 我也回覆說 gallery 外掛可以正常使用. 不過... 它還是一直被放在 unported 裡頭.

PS. 沒記錯的話, 1.0.x 使用的 gallery 外掛與 1.1 用的應該是一樣的. 沒印象有什麼需要改的 (1.0->1.1 外掛好像 API 只有一個地方有差別, 忘了這個有沒有用到).
42  開發 / 外掛程式 / Re: 修改 LifeType 的 AuthImage, 使用 Better Captcha 的圖形 於: 十月 17, 2006, 07:25:15 上午
我記得 1.0 到 1.1 中間, plugins 的寫法只有一點點差別.
我改的部份應該是完全沒有動到那些部份. 應該 1.0 的也可以用才對.
43  開發 / 外掛程式 / 修改 LifeType 的 AuthImage, 使用 Better Captcha 的圖形 於: 十月 16, 2006, 01:33:37 下午
在 PHPBB 有一個 Better Captcha MOD, 所產生的識別碼圖形, 並不會像 FreeCap 所產生的那般, 十分難辨識. 而 LifeType 本身的 AuthImage 所產生的圖形, 又太有規律. 所以, 打算讓 AuthImage 產生圖形的方式, 用 Better Captcha 方式來產生.

首先, 先到這兒抓取 Better Captcha. 抓回解開之後, 把 fonts 這個目錄放到 authimage 的目錄下頭. 然後修改 pluginauthimage.class.php 如下:
程式碼:
--- authimage.old/pluginauthimage.class.php	2006-07-05 10:19:57.000000000 +0800
+++ authimage/pluginauthimage.class.php 2006-10-16 14:20:28.744067612 +0800
@@ -8,7 +8,10 @@
 
     define( "AUTHIMAGE_FILE", "/plugins/authimage/authimage.php" );
     define( "AUTHIMAGE_BACKGROUND_FOLDER", PLOG_CLASS_PATH."plugins/authimage/backgrounds/" );
-   
+// twu2 20061016 begin
+    define( "AUTHIMAGE_FONT_FOLDER", PLOG_CLASS_PATH."plugins/authimage/fonts/" );
+// twu2 20061016 end
+
     /**
      * Plugin that offers comment authentication image for current blog
      * Original Author: Gudlyf http://www.gudlyf.com/index.php?p=376
@@ -93,8 +96,9 @@
 
         function show() {
             $authImageUrl = $this->generateImageUrl();
+                //return '<img src="'.$authImageUrl.'" style="vertical-align:middle;" width="70px" height="20px" alt="authimage" />';
             if ( $authImageUrl )
-                return '<img src="'.$authImageUrl.'" style="vertical-align:middle;" width="70px" height="20px" alt="authimage" />';
+                return '<img src="'.$authImageUrl.'" style="vertical-align:middle;" alt="authimage" />';
             else
                 return 'You don\'t have GD support compiled in, we cannot create an authimage. Please activate GD Support.';
         }
@@ -103,6 +107,16 @@
             // Delete those cached authimage files that never used
             $this->deleteExpiredAuthImage($this->expiredTime);
             
+// twu2 20061016 begin
+            $code = $this->generateCode();
+            $encrypt = $this->encrypt($code, $this->key);
+            if ( function_exists ( 'ImageGIF' ) )
+ $image_format = 'gif';
+     else
+ $image_format = 'png';
+            $tempFile = $this->cacheFolder."/".$encrypt.".".$image_format;
+     $this->captcha_createimage($code, $image_format, $tempFile);
+/* old method for image
             $code = $this->generateCode();
             $encrypt = $this->encrypt($code, $this->key);
             $background = AUTHIMAGE_BACKGROUND_FOLDER.$this->default;
@@ -125,6 +139,8 @@
             } else {
                 ImageGIF($image, $tempFile);
             }
+*/
+// twu2 20061016 end
             $temp = fopen($tempFile,"rb");
             $buffer = fread($temp,filesize($tempFile));
             fclose($temp);
@@ -137,7 +153,10 @@
             // Now chmod it so it can be deleted later by the user
             chmod($tempFile, 0666);
             
-            header("Content-type: image/gif");
+// twu2 20061016 begin
+            //header("Content-type: image/gif");
+            header("Content-type: image/".$image_format);
+// twu2 20061016 end
             echo $buffer;
         }
 
@@ -150,7 +169,14 @@
         
         function generateCode() {
             $code = "";
-            for($i=0; $i < $this->length; $i++) $code .= rand(0,9);
+// twu2 20061016 begin
+            //for($i=0; $i < $this->length; $i++) $code .= rand(0,9);
+     //$hash = "0123456789";
+     //$hash = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+     $hash = "0123456789ABCDEFGHKMNPQRWXYZ";
+     $len = strlen($hash) - 1;
+            for($i=0; $i < $this->length; $i++) $code .= $hash[rand(0,$len)];
+// twu2 20061016 end
             return $code;
         }       
         
@@ -168,6 +194,135 @@
                 closedir($handle);
             }
         }           
+
+// twu2 20061016 begin
+        function captcha_createimage($code, $image_format, $tempFile)
+        {
+            $breedte = rand(256, 384);
+            $hoogte = rand(64, 96);
+            $img = imagecreatetruecolor($breedte,$hoogte);
+            $achtergrond = imagecolorallocate($img, $this->captcha_color("bg"), $this->captcha_color("bg"), $this->captcha_color("bg"));
+
+            imagefilledrectangle($img, 0, 0, $breedte-1, $hoogte-1, $achtergrond);
+     $hash = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+     $hash_len = strlen($hash);
+            for($g = 0;$g < 30; $g++)
+            {
+ $t = $hash[rand(0, $hash_len)];
+                   
+                $ypos = rand(0,$hoogte);
+                $xpos = rand(0,$breedte);
+                   
+                $kleur = imagecolorallocate($img, $this->captcha_color("bgtekst"), $this->captcha_color("bgtekst"), $this->captcha_color("bgtekst"));
+
+                if (!($g % 2))
+    {
+       $scribx = rand(0,($breedte*2));
+       $scriby = rand(0,($hoogte*2));                     
+     
+       $wibblex = rand(0,($breedte*2));
+       $wibbley = rand(0,($hoogte*2));
+     
+       imageline($img, rand(0, $scribx-$xpos), rand(0, $scriby+$ypos), rand(0, $wibblex), rand(0, $wibbley), $kleur+$g);
+       imageellipse($img, rand(0, $scribx+$xpos), rand(0, $scriby-$ypos), rand(0, $scriby), rand(0, $scribx), $kleur-$g);             
+ }
+                   
+                imagettftext($img, $this->captcha_size(), $this->captcha_move(), $xpos, $ypos, $kleur, $this->captcha_font(), $t);
+            }
+            $stukje = $breedte / (strlen($code) + 3);
+
+            for($j = 0;$j < strlen($code); $j++)
+            {
+                $tek = $code[$j];
+                $ypos = rand(32,$hoogte-8);
+                $xpos = $stukje * ($j+2);
+                   
+                $kleur2 = imagecolorallocate($img, $this->captcha_color("tekst"), $this->captcha_color("tekst"), $this->captcha_color("tekst"));
+               
+                imagettftext($img, $this->captcha_size(), $this->captcha_move(), $xpos, $ypos, $kleur2, $this->captcha_font() , $tek);
+            }
+               
+     if ($image_format == 'gif')
+                imagegif($img, $tempFile);
+     else
+                imagepng($img, $tempFile);
+            imagedestroy($img);
+        }
+
+        /**
+          * Some functions :)
+          * Also orginally written by mastercode.nl
+          **/
+        /**
+          * Function to create a random color
+          * @auteur mastercode.nl
+          * @param $type string Mode for the color
+          * @return int
+          **/
+        function captcha_color($type)
+        {
+            switch($type)
+            {
+                case "bg":
+                    $kleur = rand(224,255);
+                break;
+                case "tekst":
+                    $kleur = rand(0,127);
+                break;
+                case "bgtekst":
+                    $kleur = rand(200,224);
+                break;
+                default:
+                    $kleur = rand(0,255);
+                break;
+            }
+            return $kleur;
+        }
+        /**
+          * Function to ranom the size
+          * @auteur mastercode.nl
+          * @return int
+          **/
+        function captcha_size()
+        {
+            $grootte = rand(24,32);
+            return $grootte;
+        }
+        /**
+          * Function to random the posistion
+          * @auteur mastercode.nl
+          * @return int
+          **/
+        function captcha_move()
+        {
+            $draai = rand(-25,25);
+            return $draai;
+        }
+        /**
+          * Function to return a ttf file from fonts map
+          * @auteur mastercode.nl
+          * @return string
+          **/
+        function captcha_font()
+        {
+            $f = @opendir(AUTHIMAGE_FONT_FOLDER);
+            $ar = array();
+            while(($file = @readdir($f)) !== false)
+            {
+                if(!in_array($file,array('.','..')) && eregi('.ttf',$file))
+                {
+                    $ar[] = $file;
+                }
+            }
+            if(count($ar))
+            {
+                shuffle($ar);
+                $i = rand(0,(count($ar) - 1));
+                return AUTHIMAGE_FONT_FOLDER . $ar[$i];
+            }
+        }   
+// twu2 20061016 end
+
     }
         
 ?>
 

patch 可以到這兒抓: http://www.teatime.com.tw/~tommy/mypatch/lifetype_authimage_better_captcha.patch

我修改了 generateCode() 的部份, 讓出現的字串為數字與大寫的英文字母, 但是把其中幾個比較容易弄錯的字母移除. 如果你想修改出現的字串, 請修改這個 function 內的 $hash 變數值就可以.
44  測試 / LifeType 1.1 測試 / Re: info.class.php 有錯誤訊息但是沒影響? 於: 九月 08, 2006, 11:13:22 上午
在 config/logging.properties.php 中, 沒有定義 $config["metricslog"] 這個變數?
45  測試 / LifeType 1.1 測試 / Re: 文章列表中不會顯示不在首頁顯示的群組文章? 於: 八月 02, 2006, 04:19:16 下午
剛剛 update 到 r3831. 目前看起來是正常的了.
頁: 1 2 [3] 4 5