在 LifeType 中要啟用外掛都必須 "請" 使用者自行到管理介面中設定,有客戶希望 LifeType 中的所有部落格都啟用 authimage 這個外掛,因此找了一個尚且能夠解決問題的方式。
註冊過程加入外掛設定
在官方網站的討論有提到:
http://forums.lifetype.net/viewtopic.php?t=2005
1. 開啟檔案 /class/summary/action/dofinishregister.class.php
2. 找到
3. 在這一行上方加入下面這幾行即可
為現有部落格進行設定
請在 LifeType 根目錄放上一個檔案(例如 test.php ),裡面包含下面程式碼:
註冊過程加入外掛設定
在官方網站的討論有提到:
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