lifetype2 與 gallery2 的 plugin
試了幾天的 gallery2 plugin 終於免強完成,雖然不是很滿意,但目前也只能這樣,大部分的做法都是參考 Tommy 碎碎念
- 下載 gallery2 安裝 gallery2
- 下載 gallery plugin 將它解壓放到 /lifetype/plugins 下
- 在 lifetype 個人網誌設定=>Gallery
- 啟動 Gallery 外掛模組
- embed.php 路徑 => /var/www/html/gallery2/embed.php
- embedUri 参數 => /blog/index.php?op=gallery&blogId=2
- embedPath 参數 => /
- g2Uri 参數 => /gallery2/main.php
- 圖片區塊 => randomImage
- 顯示項目 => none
- Gallery 項目代碼 => /shyong
- 將 gallery2 整合進 lifetype 模版,我修改 ice 模版的
- header.template 加入下面幾行
{if $gallery->isEnabled()}
<li><a title="{$locale->tr('photo')}" href="http://ms7.fhsh.tp.edu.tw/blog/index.php?op=gallery&blogId=2&g2_itemId=27">{$locale->tr('photo')}</a></li>
{/if} - panel.template 加入下面幾行
{if !empty($gallery)}
{if $gallery->isEnabled()}
<div class="block">
<h5>相簿</h5>
<div align=center>
{$gallery->getImageBlock()}
</div>
</div>
{/if}
{/if}
- header.template 加入下面幾行
- 就完成了,但是結果是不能用,後面是參考Tommy的修改,才勉強可以用
- 將 plugingallery.class.php 約 26行開始改成如下:
function Plugingallery($source = "")
{
$this->PluginBase($source);
// Setup the plugin information
$this->id = "gallery";
$this->author = "Laurent Vauthrin";
$this->desc = "Integrates gallery2 into LifeType 1.2.";
$this->version = "20070405";
// Setup the locale
$this->locales = Array( "en_UK" );
if ($source == "admin")
$this->initAdmin();
else
$this->init();
}
function init()
{
$this->registerBlogAction( "gallery", "PluginGalleryShowAction" );
} - 在 gallery2 部份 在網址改寫的部份, 其中 "限制熱鏈接項目" 這個項目不可以使用. 另外 "顯示項目" 這個也不要用,這樣就ok了
- 在Tommy的網站上,有教你如果要網址改寫要如何設,可是我設不出來,不知是否我的lifetype已經用自訂網址了,看來是要將 apache 的 mod_rewrite 模組研究一下才可以,等看完,再來將 gallery 也設成網址改寫