pixmicat

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/release/ @ 460  →  /release/ @ 461
/release/Modules-PIO-v4/mod_catalog/mod_catalog.php
@@ -11,7 +11,7 @@
global $PMS;
$PMS->hookModuleMethod('ModulePage', 'mod_catalog'); // 向系統登記模組專屬獨立頁面
 
$this->CATALOG_NUMBER = 50; // 相簿模式一頁最多顯示個數 (視文章是否有貼圖而有實際變動)
$this->CATALOG_NUMBER = 20; // 相簿模式一頁最多顯示個數 (視文章是否有貼圖而有實際變動)
}
 
/* Get the name of module */
@@ -21,13 +21,13 @@
 
/* Get the module version infomation */
function getModuleVersionInfo(){
return 'Pixmicat! Catalog Module v070130';
return 'Pixmicat! Catalog Module v070702';
}
 
/* 自動掛載:樣式表 */
function autoHookHead(&$style){
$style .= '<style type="text/css">
div.list { float: left; margin: 5px; width: 125px; height: 125px; } /* (相簿模式) div 框格設定 */
div.list { float: left; margin: 5px; width: '.MAX_RW.'px; height: '.MAX_RH.'px; } /* (相簿模式) div 框格設定 */
</style>
';
}
New file
/release/Modules-PIO-v4/mod_recaptcha/howto.txt
@@ -0,0 +1,20 @@
License:
 
The reCAPTCHA PHP Library is provided by reCAPTCHA project. Copyright (c) 2007 reCAPTCHA (http://recaptcha.net)
mod_recaptcha is not a part of Pixmicat! package. So it's not licensed under the Clarified Artistic License. It's in the public domain.
 
中文安裝指引:
 
0. 請先申請免費的 reCAPTCHA 帳號 (http://recaptcha.net/whyrecaptcha.html),取得兩串 Key
1. 從 http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest 下載含 recaptchalib.php 的壓縮包並解壓取出
2. 將 mod_recaptcha.php 和 recaptchalib.php 放到 module/ 目錄
3. 修改 mod_recaptcha.php,填入在第0步驟於 reCAPTCHA 取得的 Public Key 和 Private Key
4. 修改 config.php,在模組載入區塊下加一行 $ModuleList[] = 'mod_recaptcha';
 
English Instruction:
 
0. Please sign up for a FREE account of reCAPTCHA. (http://recaptcha.net/whyrecaptcha.html) And you can get two 40-letter-long keys.
1. Download the "recaptchalib.php" from http://code.google.com/p/recaptcha/downloads/list?q=label:phplib-Latest
2. Put the following files into the module/ directory: "mod_recaptcha.php" and "recaptchalib.php."
3. Use your favorite editor to open the "mod_recaptcha.php" and fill out the public key and the private key which are gotton at step 0.
4. Finally, open the "config.php" and add one line ($ModuleList[] = 'mod_recaptcha';) into the "Modules to be loaded" block.
New file

Property changes:

Name: svn:keywords
+ Id Date Author

/release/Modules-PIO-v4/mod_recaptcha/mod_recaptcha.php
@@ -0,0 +1,38 @@
<?php
/*
mod_recaptcha.php
*/
include('recaptchalib.php'); // reCAPTCHA PHP Library
 
class mod_recaptcha{
var $KEY_PUBLIC, $KEY_PRIVATE;
 
function mod_recaptcha(){
$this->KEY_PUBLIC = ''; // Public Key of this site
$this->KEY_PRIVATE = ''; // Private Key of this site
}
 
function getModuleName(){
return 'mod_recaptcha';
}
 
function getModuleVersionInfo(){
return 'reCAPTCHA 驗證圖像機制 v070615';
}
 
/* 在頁面附加 reCAPTCHA 圖像和功能 */
function autoHookPostForm(&$txt){
global $recaptcha_api_server;
$recaptcha_api_server = 'http://api.recaptcha.net';
$txt .= '<tr><th class="Form_bg">驗證碼</th><td>'.recaptcha_get_html($this->KEY_PUBLIC)."<small>(大小寫和符號需留意,兩個文字間用空白分隔)</small></td></tr>\n";
}
 
/* 在接收到送出要求後馬上檢查是否正確 */
function autoHookRegistBegin(&$name, &$email, &$sub, &$com, $upfileInfo, $accessInfo, $POST){
global $recaptcha_verify_server;
$recaptcha_verify_server = 'api-verify.recaptcha.net';
$resp = recaptcha_check_answer($this->KEY_PRIVATE, $_SERVER['REMOTE_ADDR'], $POST['recaptcha_challenge_field'], $POST['recaptcha_response_field']);
if(!$resp->is_valid){ error('reCAPTCHA 驗證碼錯誤!除大小寫須注意之外,標點符號及兩個單字都需輸入 (以空白分隔)'); } // 檢查
}
}
?>