原本之前改了 Gallery 的外掛給 LifeType 1.2 使用, 以為一切的正常, 結果今天才發現, 雖然可以顯示圖片, 不過一點選圖片或選擇進入相簿時, 並無法像之前在 1.1 時的運作一般, 可以進入 Gallery 系統中.
檢查一下程式, 發現在改成 1.2 使用時, 在註冊相關服務時, 變成只有 admin 才會去註冊, 一般的使用就沒有註冊 gallery 服務, 所以在執行 op=gallery 時, 就無法運作了.
這個 patch 可以修正這個問題: http://www.teatime.com.tw/~tommy/mypatch/lifetype12_gallery_plugin.patch
--- plugingallery.class.php.orig 2007-04-05 09:37:58.971689103 +0800
+++ plugingallery.class.php 2007-04-05 09:38:48.741881593 +0800
@@ -31,15 +31,23 @@
$this->id = "gallery";
$this->author = "Laurent Vauthrin";
$this->desc = "Integrates gallery into plog.";
- $this->version = "20070321";
+ $this->version = "20070405";
// Setup the locale
$this->locales = Array( "en_UK" );
if ($source == "admin")
$this->initAdmin();
+ else
+ $this->init();
}
+ function init()
+ {
+ // Register the actions
+ $this->registerBlogAction( "gallery", "PluginGalleryShowAction" );
+ }
+
function initAdmin()
{
// Register the actions
經過修正之後, 果然可以正常運作了.
這個 patch 也送到官方的網站了: http://bugs.lifetype.net/view.php?id=1263
Tommy大哥,
有幾個問題請教,希望您有撥冗幫我解惑,不勝感激。
我安裝1.2版的lifetype,想試gallery的外掛,但把gallery拷貝到/var/www/lifetype12/plugins/後
在網誌中選外掛中心時出現如下的錯誤
Fatal error: Undefined class name 'menu' in /var/www/lifetype12/plugins/gallery/plugingallery.class.php on line 44
這是跟這篇文章有關嗎??
那我把lifetype12_gallery_plugin.patch 這個檔案下載到/var/www/lifetype12/plugins/gallery
這個目錄,然後下底下的指令,這樣步驟有錯嗎???
patch - apply lifetype12_gallery_plugin.patch plugingallery.class.php
不然該如何修正呢???
另外我在1.1版中設定gallery時送出資料時出現
Fatal error: Only variables can be passed by reference in /var/www/lifetype11/plugins/gallery/class/action/plugingalleryupdateconfigaction.class.php on line 135
我看你有說只要把php.ini中的一個設定設成On就可以,但我看我的設定檔,本來就是設成On,為什麼還是會出現這個錯誤呢??
你抓官方的 LifeType 官方的 plugin 版本嗎? 我記得那個版本現在是不用另外 patch 的.
至於後面那個錯誤, 改了 php.ini 要重跑 apache 才有作用. (或者... 你改的 php.ini 不是你系統用的? 用 phpinfo() 看一下檔案對不對.)