歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 17, 2024, 12:45:31 上午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
  列出文章
頁: [1] 2 3 ... 5
1  開發 / 核心補強 / Re: 被廣告迴響入侵 於: 四月 02, 2008, 01:50:25 下午
標準的 authimage 那些數字圖形很容易辨識 (不過上星期就算我這兒用中文的數字圖形, 也一樣出現一堆廣告), 應該早就沒什麼用了吧.
建議自己改一下, 把那個圖形多產生幾個數字, 而實際上用文字註明只要輸入那幾碼數字就可以, 這樣應該可以擋掉一堆 bot 吧.

例如, 產生 6 位數字的圖, 請人家只要輸入前 4 位就可以.

另外, 有些應該是 "人" 在刊登廣告的, 通常會是經由到 Google 查詢
程式碼:
inurl:/post/  "發表迴響" "暱稱" "AuthImage"
這樣子的字串, 去找使用 LifeType 與 AuthImage 的網址, 再連過去刊登廣告, 可以考慮使用 Apache 的 rewrite 模組, 把這個的 request 擋掉.
程式碼:
RewriteCond %{HTTP_REFERER} q= [NC]
RewriteCond %{HTTP_REFERER} inurl(:|%3A)(post|/post|%2Fpost) [NC]
RewriteRule .* - [F,L]

如果對方一進來看到錯誤, 也許就不會再試著去輸入吧.
2  開發 / 外掛程式 / Re: LifeType 外掛: 新增迴響 MSN/Yahoo 即時通知 於: 七月 16, 2007, 11:35:41 上午
版本更新到 20070716, 異動記錄:

    * 更新 phpmsnclass 到 1.7 版
    * 加入 trackback 通知的功能

檔案放在: http://www.teatime.com.tw/~tommy/files/lifetype/lifetype_1.2_addcommentnotify_20070716.tgz
3  開發 / 外掛程式 / Re: LifeType 外掛: 新增迴響 MSN/Yahoo 即時通知 於: 七月 13, 2007, 04:59:06 下午
log 是指 phpmsnclass 的 log.
如果你的設定是直接使用 msn.class.php 來傳訊 (建議用 msnbot.php 的方式, 避免同時多個登入, 或登入登出過於頻繁被 MS block), 自己改 pluginaddcommentnotify.class.php 中,
程式碼:
$msn = new MSN;
改成
程式碼:
$msn = new MSN('', '/tmp/msn.log');
然後去看 /tmp/msn.log 的內容吧.
4  開發 / 外掛程式 / Re: LifeType 外掛: 新增迴響 MSN/Yahoo 即時通知 於: 七月 13, 2007, 01:31:52 下午
我不覺得那個錯誤與資料庫內的設定值有關係.
有看到你自行寫過外掛程式, 所以應該也熟悉 php 才對. 所以...

1. 先確定 phpmsnclass 可以運作再說:
1.1 單獨使用 msn.class.php, 改一下 sample.php 的內容, 確定執行 sample.php 可以正確的傳送訊息給你所指定的 MSN 帳號.
1.2. 或者先安裝 msn.class.php 與 msnbot.php, 確定可以正確傳送訊息.

2. 如果 phpmsnclass 可以運作時, 再設定這個外掛.

3. 如果步驟 1 正常, 步驟 2 不正常, 請打開 phpmsnclass 的除錯功能, 自己看一下 log 是那兒有問題吧.

PS. 會出現空白頁面, 也許是你的 php 的錯誤是不直接顯示, 請去看你的 apache 的 log 吧.
5  支援 / 安裝與設定 / Re: 升级到1.2.2后,summary page有Fatal error 於: 五月 21, 2007, 08:34:28 下午
那個錯誤是指 $postOwner 不是該有的那個物件. 所以沒有 hasPicture() 這個 function.
6  開發 / 核心補強 / 修正 LifeType 1.2.2 在使用 smtp 傳送信件時, 無法載入 class.smtp.php 的問題 於: 五月 19, 2007, 12:47:08 下午
昨天晚上把 LifeType 升級到 1.2.2 之後, 今天早上發現有人連續留了幾個相同的迴響, 但是.... 我的 MSN/Yahoo 帳號卻沒有收到任何的訊息. 檢查了一下伺服器上的記錄, 果然沒有執行到送出訊息的地方. 後來就自己試著產生一個新的迴響, 發現在 1.2.2 中, 會出現找不到 class.smtp.php 的錯誤. (所以沒有訊息, 而留言的人會以為不成功就再留一次, 所以產生多個相同的迴響.) 把 email 的傳送設定, 由 smtp 改成 PHP mail() 之後, 就可以正常使用了.

比較了一下 1.2.1 與 1.2.2 的部份, 發現在 phpmail 的部份, 1.2.2 使用了 lt_include() 取代 include_once() 來載入 class.smtp.php 檔案. 不過... 由於並沒有定義 phpmail 物件的 PluginDir 變數, 所以原本在執行 include_once($this->PluginDir.'class.smtp.php') 時, 會找目前路徑下的 class.smtp.php, 所以可以正常的載入. 不過改用 lt_include() 之後, 變成執行 lt_include('class.smtp.php'), 並沒有加上路徑, 而 lt_include() 定義在別的檔案, 也就是在別的路徑下頭, 在那裡頭去執行 include('class.smtp.php') 時, 變成只找該路徑, 而不是原本 phpmail 所在的路徑了. 自然會載入失敗.

經過下面的修正, 就可以避免這個問題:
程式碼:
diff -Nur lifetype-1.2.2/class/mail/emailservice.class.php blog/class/mail/emailservice.class.php
--- lifetype-1.2.2/class/mail/emailservice.class.php 2007-05-18 15:21:32.000000000 +0800
+++ blog/class/mail/emailservice.class.php 2007-05-19 13:17:24.650920201 +0800
@@ -95,6 +95,9 @@
// create a phpmailer object
$mail = new PHPMailer();
 
+ // need to set PluginDir if we use lt_include()
+ $mail->PluginDir = PLOG_CLASS_PATH."class/mail/phpmailer/";
+
// set a few fields
$mail->ContentType = $message->getMimeType();
$mail->From = $message->getFrom();

檔案可以由這兒抓取:
http://www.teatime.com.tw/~tommy/mypatch/lifetype_1.2.2_phpmail_smtp.patch 

這個修正同時送到 http://bugs.lifetype.net/view.php?id=1310
7  開發 / 外掛程式 / Re: LifeType 外掛: 新增迴響 MSN/Yahoo 即時通知 於: 五月 18, 2007, 08:01:38 上午
用 msnbot.php? 怎麼設定的? 你的 msnbot.php 已經執行中了嗎?
用 msn.class.php? 你的環境是 linux 嗎? 不然怎麼會寫不出 /tmp/msn.log?

請不要管 lifetype 吧. 先把 phpmsnclass 這個東西跑成功再來設定 lifetype 吧.
找個會 php 的人看一下就應該知道怎麼用 phpmsnclass 這東西了.
8  開發 / 外掛程式 / Re: LifeType 外掛: 新增迴響 MSN/Yahoo 即時通知 於: 五月 17, 2007, 08:30:10 下午
如果你是直接使用 msn.class.php 的話, 把 new MSN; 改成 new MSN('', '/tmp/msn.log'); 後再試看看.
這時 msn.class.php 的記錄會產生在 /tmp/msn.log 中. 再看看是什麼問題吧.

如果是利用 msnbot.php 處理, 那就看檔案有沒有被產生在 spool 的路徑下, 再看看 msnbot.php 的記錄吧.
9  開發 / 外掛程式 / Re: LifeType 外掛: 新增迴響 MSN/Yahoo 即時通知 於: 五月 15, 2007, 09:04:17 下午
沒有用 1.1.6 了. 所以不怎麼確定.
我記得由 1.1.x 的外掛改成 1.2 時, 是在 constructor 上加上 $source 這個參數.
也許把 1.2 改成 1.1.x 用的時候, 只要把 function PluginAddCommentNotify($source) 的 $source 拿掉. 把裡頭用到的地方也把 $source 移除就可以了. (那個 if 判斷就直接拿到, 直接執行 $this->initAdmin() 吧)

自己試看看就知道了.
10  開發 / 外掛程式 / Re: 請問有關於gallery publishXP的問題 於: 五月 06, 2007, 07:10:24 下午
自己改吧: http://blog.teatime.com.tw/1/post/238
11  開發 / 核心補強 / Re: 修正 LifeType 1.2 中, 打開 magic_quotes_gpc 後, 無法儲存 backslash [\] 字元的問題 於: 四月 24, 2007, 11:22:41 上午
那是 php 的設定, 到 php.ini 中去改. 或用 .htaccess 來設定 (如果你用的是 apache 的話).
12  開發 / 核心補強 / Re: 修正 LifeType 1.2 中, 打開 magic_quotes_gpc 後, 無法儲存 backslash [\] 字元的問題 於: 四月 24, 2007, 09:16:47 上午
好像沒什麼好寄的. 把那兩個檔案有執行 stripslashes() 的部份刪除就可以了.
在別的文章看到你的環境是用  windows, 我不清楚是否在 windows 中要另外處理. 不過在 linux 上頭, 這個部份我並沒有碰到問題.

最簡單的做法, 是把 magic_quotes_gpc 設成 off 不就好了?
如果不想把 magic_quotes_gpc 設成 off (想不出有什麼不能的? 還是在 windows 下, 就算設成 off 也有問題?), 那就等官方的開發人員, 那天有空處理到這個問題再說吧. 我沒有 windows 的 web 環境, 也不想特地裝一個來測, 所以這部份我也不清楚為什麼在你的環境下會有問題.
13  開發 / 核心補強 / Re: 修正 LifeType 1.2 中, 打開 magic_quotes_gpc 後, 無法儲存 backslash [\] 字元的問題 於: 四月 22, 2007, 08:04:57 下午
也許 patch 有那邊您沒改到吧.
至少在我家的機器上頭, 不管 magic_quotes_gpc 打開或關閉, 都不會有您說的問題產生.
14  支援 / 安裝與設定 / Re: 乱码啊~ 请求解决一下 於: 四月 09, 2007, 11:11:57 上午
這個看起來像是你的 apache 在那個網頁用的編碼與 browser 用的不同, 所以字會被轉成 &#xxxxx; 之類的碼.
15  開發 / 核心補強 / 修正 LifeType 1.2 中, 打開 magic_quotes_gpc 後, 無法儲存 backslash [\] 字元的問題 於: 四月 09, 2007, 11:06:44 上午
轉自: http://blog.teatime.com.tw/1/post/228

在 LifeType 1.0.3 的時候, 我修正過一次 backslash 無法儲存的問題, 不過, 最近發現又有人反應這類的問題, 查了一下, 發現原本的修正, 在 magic_quotes_gpc 關閉時, 可以正確的儲存 backslash. 但是如果將 magic_quotes_gpc 打開之後, 就無法儲存 backslash 了.

下面這個 patch, 應該可以解決這一個問題了:
程式碼:
diff -Nur class.orig/data/kses.class.php class/data/kses.class.php
--- class.orig/data/kses.class.php 2007-03-20 20:40:22.000000000 +0800
+++ class/data/kses.class.php 2007-04-10 10:42:10.601863738 +0800
@@ -76,10 +76,13 @@
 
  function Parse($string = "")
  {
+/* we already handle magic_quotes_gpc in class/net/request.class.php
+   so don't do it again.
  if (get_magic_quotes_gpc())
  {
    $string = stripslashes($string);
  }
+*/
  $string = $this->_no_null($string);
  $string = $this->_js_entities($string);
  $string = $this->_normalize_entities($string);
@@ -759,4 +762,4 @@
  return '0.0.2 (OOP fork of kses 0.2.1)';
  } # function _version
  }
-?>
\ No newline at end of file
+?>
diff -Nur class.orig/database/db.class.php class/database/db.class.php
--- class.orig/database/db.class.php 2007-03-20 20:40:21.000000000 +0800
+++ class/database/db.class.php 2007-04-10 10:42:13.009975865 +0800
@@ -156,6 +156,8 @@
  */
  function qstr($string) {
 
+/* we already handle magic_quotes_gpc in class/net/request.class.php
+   so don't do it again.
  if (get_magic_quotes_gpc()) {
  $string = stripslashes($string);
  //$string = stripslashes($string);
@@ -163,6 +165,7 @@
                  $string = str_replace("\\'", "'", $string);
                  $string = str_replace('\\"', '"', $string);
  }
+*/
 
  $string = str_replace("\\", "\\\\", $string);
  $string = str_replace("'", "''", $string);
@@ -170,4 +173,4 @@
  return $string;
  }
     }
-?>
\ No newline at end of file
+?>
上面的 patch, 可以由這兒抓取: http://www.teatime.com.tw/~tommy/mypatch/lifetype_1.2_backslash.patch
Patch submit 到 Mantis: http://bugs.lifetype.net/view.php?id=1141 
頁: [1] 2 3 ... 5