知道簡單php的請幫忙!!



贊助商連結


cpthk
2005-12-30, 11:45 AM
小弟在編輯coppermine photo gallery, 在編輯中碰到:
$template_footer = CPGPluginAPI::filter('gallery_footer','').substr($template, $gallery_pos);

不知道是什麼意思, 不知道有沒有人看得懂, 可以解說一下gallery_footer是哪來的?
同一頁的前面都沒有說明到gallery_footer, 所以應該不是一個變數, 不知道是怎麼宣告出來的??

下面是完整的檔案.

贊助商連結


C.C.
2005-12-30, 12:58 PM
你看一下 include\plugin_api.inc.php 中 CPGPluginAPI 的 source 就知道 filter 會搜尋所有 Plugin 的 filter
所以 'grallery_footer' 應該是某個 Plugin 呼叫 add_filter 加進來的

cpthk
2005-12-30, 03:10 PM
可是我怎麼樣都找不到gallery_footer!?
到themes裡面也都找過了也沒有.

CapriSkye
2005-12-30, 05:25 PM
記得沒錯的話 CPGPluginAPI::filter('gallery_footer' 是用來 filter 佈景的 footer.
新的 1.4.x 可以讓你設定自己的 header 和 footer, 管理->佈景設定
所以如果你有設定 footer, 佈景裡面的 footer 就會被拿掉.