LifeType 統一部落格外掛設定範例

在 LifeType 中要啟用外掛都必須 "請" 使用者自行到管理介面中設定,有客戶希望 LifeType 中的所有部落格都啟用 authimage 這個外掛,因此找了一個尚且能夠解決問題的方式。

註冊過程加入外掛設定

在官方網站的討論有提到:
http://forums.lifetype.net/viewtopic.php?t=2005

1. 開啟檔案 /class/summary/action/dofinishregister.class.php
2. 找到
$locale = Locales::getLocale( $this->blogLocale );

3. 在這一行上方加入下面這幾行即可
            $blogInfo->setValue( "plugin_authimage_enabled", 1 );
            $blogInfo->setValue( "plugin_authimage_length", 4 );
            $blogInfo->setValue( "plugin_authimage_key", plog);
            $blogInfo->setValue( "plugin_authimage_expiredtime", 3600 );
            $blogInfo->setValue( "plugin_authimage_default", "sky.gif" );


為現有部落格進行設定

請在 LifeType 根目錄放上一個檔案(例如 test.php ),裡面包含下面程式碼:
<?php
if (!defined( "PLOG_CLASS_PATH" )) {
    define( "PLOG_CLASS_PATH", dirname(__FILE__)."/");
}

include_once( PLOG_CLASS_PATH."config/config.properties.php" );
include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );

$myBlogs = new Blogs;
$allBlogs = $myBlogs->getAllBlogs();
foreach($allBlogs as $id => $blogInfo) {
    $blogInfo->setValue( "plugin_authimage_enabled", 1 );
    $blogInfo->setValue( "plugin_authimage_length", 4 );
    $blogInfo->setValue( "plugin_authimage_key", "plog");
    $blogInfo->setValue( "plugin_authimage_expiredtime", 3600 );
    $blogInfo->setValue( "plugin_authimage_default", "sky.gif" ); 
    echo $id . ' => ';
    echo ($myBlogs->updateBlog($id, $blogInfo)) ? 'done' : 'error';
    echo '<br>';
}
?>



接著透過瀏覽器執行即可。

注意事項:
1. 執行完畢後請立即刪除該檔案
2. 這個方式會覆蓋現有部落格設定,可能會招致一些抱怨

 

引用自:http://twpug.net/modules/newbb/viewtopic.php?topic_id=1330

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值