筍子工作雜記

1月 2, 2008

如何讓後台的跳轉頁面也套用前台的風格

歸類於: Uncategorized, xoops — shinnlu @ 1:59 pm

tested with xoops 2.016
所有呼叫 redirect_header都是執行這一個函式

/include/functions.php
line 364 function redirect_header($url, $time = 3, $message = '', $addredirect = true)

而在 372 行有一個判斷目前是前台,還是後台

if (defined('XOOPS_CPFUNC_LOADED')) {
        $theme = 'default';
    } else {
        $theme = $xoopsConfig['theme_set'];
    }

只要讀到 XOOPS_CPFUNC_LOADED,就判定為後台,直接使用預設樣版

//include/cp_functions.php
line 27 //define('XOOPS_CPFUNC_LOADED', 1);

把這一行 mark起來就可以了,目前使用起來沒什麼問題

Powered by WordPress counter stats Total Hits:49631 | Total Hits Today:54 | IP Visited:16207 | Unique referers:10282