CentOS 5.4安裝myphpadmin 3.0以上會需要PHP版本5.2.0以上
然而內建的CentOS 5.4 使用yum update PHP最新版本也才到5.1.6
做法就是新增一個更新的位置
cd /etc/yum.repos.d
cp CentOS-Base.repo CentOS-test.repo
vi CentOS-test.repo
加入以下內容:
[C5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/5/testing/i386
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
然後yum update即可
2010年5月26日
2010年5月18日
How to add a custom CAPTCHA to phpBB2
某客戶留下的phpBB2被洗版 解決方法 安裝CAPTCHA方案
翻譯http://www.matthewleverton.com/howto/phpBB2-captcha.html
系統需求:
phpBB2
freecap
PHP 4/5 with GD enabled 確認是否有安裝->(rpm -qa|grep php-gd)
Admin Rights
安裝步驟:
1. 將freecap下載到phpbb網頁資料夾內
cd /phpbb
wget http://www.puremango.co.uk/freecap1.4.1.zip
unzip -a freecap1.4.1.zip
rm freecap1.4.1.zip
mv freecap1.4.1 freecap
2.找到phpBB內的樣式template資料夾 修改下面的profile_add_body.tpl,
例如\phpBB\template\subSilver\profile_add_body.tpl
3.將以下文字貼到profile_add_body.tpl檔案內, 建議是在password那段落的下面
下面的英文Cannot read the image?等,都可以改成你想要顯示的文字
4.以下原網頁第7步驟我沒做就OK了 有空再來翻譯..
Edit the phpBB2/includes/usercp_register.php file. (Remember to make a backup copy!) Around line 265, you'll see a block of code that says:
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $lang['Fields_empty'];
}
}
You need to add some lines to it, just in front of that closing brace. That section should look like:
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $lang['Fields_empty'];
}
session_start();
if (!isset($_POST['captcha']) || !isset($_SESSION['freecap_word_hash']) || $_SESSION['hash_func']($_POST['captcha']) != $_SESSION['freecap_word_hash'])
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . "The word you entered did not match the image.";
}
unset($_SESSION['freecap_word_hash']);
}
Note that you are only adding those seven lines in bold!
翻譯http://www.matthewleverton.com/howto/phpBB2-captcha.html
系統需求:
phpBB2
freecap
PHP 4/5 with GD enabled 確認是否有安裝->(rpm -qa|grep php-gd)
Admin Rights
安裝步驟:
1. 將freecap下載到phpbb網頁資料夾內
cd /phpbb
wget http://www.puremango.co.uk/freecap1.4.1.zip
unzip -a freecap1.4.1.zip
rm freecap1.4.1.zip
mv freecap1.4.1 freecap
2.找到phpBB內的樣式template資料夾 修改下面的profile_add_body.tpl,
例如\phpBB\template\subSilver\profile_add_body.tpl
3.將以下文字貼到profile_add_body.tpl檔案內, 建議是在password那段落的下面
下面的英文Cannot read the image?等,都可以改成你想要顯示的文字
<tr>
<td class="row1"><span class="gen">CAPTCHA Image:</span><br />
<td class="row2">
<img id="freecap" src="/phpBB2/freecap/freecap.php" />
<div style="margin: 0.5em 0;">
<label style="font-size: 10px;" for="captcha">Word in Above Image:</label>
<input id="captcha" name="captcha" type="text" size="10" />
</div>
<div style="font-size: 10px;">
Cannot read the image?
<a href="#" onclick="document.getElementById('freecap').src='/phpBB2/freecap/freecap.php?'+Math.random();">Click Here</a>
to generate a new one.
</div>
</td>
</tr>
4.以下原網頁第7步驟我沒做就OK了 有空再來翻譯..
Edit the phpBB2/includes/usercp_register.php file. (Remember to make a backup copy!) Around line 265, you'll see a block of code that says:
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $lang['Fields_empty'];
}
}
You need to add some lines to it, just in front of that closing brace. That section should look like:
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . $lang['Fields_empty'];
}
session_start();
if (!isset($_POST['captcha']) || !isset($_SESSION['freecap_word_hash']) || $_SESSION['hash_func']($_POST['captcha']) != $_SESSION['freecap_word_hash'])
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '
' : '' ) . "The word you entered did not match the image.";
}
unset($_SESSION['freecap_word_hash']);
}
Note that you are only adding those seven lines in bold!
訂閱:
文章 (Atom)