function SetTheme($theme, $style) { global $zbp; $oldtheme = $zbp->option['ZC_BLOG_THEME']; if ($oldtheme != $theme) { $app = $zbp->LoadApp('theme', $theme); if ($app->sidebars_sidebar1 | $app->sidebars_sidebar2 | $app->sidebars_sidebar3 | $app->sidebars_sidebar4 | $app->sidebars_sidebar5) { $s1 = $zbp->option['ZC_SIDEBAR_ORDER']; $s2 = $zbp->option['ZC_SIDEBAR2_ORDER']; $s3 = $zbp->option['ZC_SIDEBAR3_ORDER']; $s4 = $zbp->option['ZC_SIDEBAR4_ORDER']; $s5 = $zbp->option['ZC_SIDEBAR5_ORDER']; $zbp->option['ZC_SIDEBAR_ORDER'] = $app->sidebars_sidebar1; $zbp->option['ZC_SIDEBAR2_ORDER'] = $app->sidebars_sidebar2; $zbp->option['ZC_SIDEBAR3_ORDER'] = $app->sidebars_sidebar3; $zbp->option['ZC_SIDEBAR4_ORDER'] = $app->sidebars_sidebar4; $zbp->option['ZC_SIDEBAR5_ORDER'] = $app->sidebars_sidebar5; $zbp->cache->ZC_SIDEBAR_ORDER1 = $s1; $zbp->cache->ZC_SIDEBAR_ORDER2 = $s2; $zbp->cache->ZC_SIDEBAR_ORDER3 = $s3; $zbp->cache->ZC_SIDEBAR_ORDER4 = $s4; $zbp->cache->ZC_SIDEBAR_ORDER5 = $s5; } else { if ($zbp->cache->ZC_SIDEBAR_ORDER1 | $zbp->cache->ZC_SIDEBAR_ORDER2 | $zbp->cache->ZC_SIDEBAR_ORDER3 | $zbp->cache->ZC_SIDEBAR_ORDER4 | $zbp->cache->ZC_SIDEBAR_ORDER5) { $zbp->option['ZC_SIDEBAR_ORDER'] = $zbp->cache->ZC_SIDEBAR_ORDER1; $zbp->option['ZC_SIDEBAR2_ORDER'] = $zbp->cache->ZC_SIDEBAR_ORDER2; $zbp->option['ZC_SIDEBAR3_ORDER'] = $zbp->cache->ZC_SIDEBAR_ORDER3; $zbp->option['ZC_SIDEBAR4_ORDER'] = $zbp->cache->ZC_SIDEBAR_ORDER4; $zbp->option['ZC_SIDEBAR5_ORDER'] = $zbp->cache->ZC_SIDEBAR_ORDER5; $zbp->cache->ZC_SIDEBAR_ORDER1 = ''; $zbp->cache->ZC_SIDEBAR_ORDER2 = ''; $zbp->cache->ZC_SIDEBAR_ORDER3 = ''; $zbp->cache->ZC_SIDEBAR_ORDER4 = ''; $zbp->cache->ZC_SIDEBAR_ORDER5 = ''; $zbp->SaveCache(); } } } $zbp->option['ZC_BLOG_THEME'] = $theme; $zbp->option['ZC_BLOG_CSS'] = $style; $zbp->BuildTemplate(); $zbp->SaveOption(); if ($oldtheme != $theme) { UninstallPlugin($oldtheme); return $theme; } }
Redirect('cmd.php?act=TagMng'); break; case 'PluginMng': if (GetVars('install', 'GET')) { InstallPlugin(GetVars('install', 'GET')); $zbp->BuildModule(); $zbp->SaveCache(); } Redirect('admin/?' . GetVars('QUERY_STRING', 'SERVER')); break; case 'PluginDis': if (!$zbp->ValidToken(GetVars('token', 'GET'))) { $zbp->ShowError(5, __FILE__, __LINE__); die; } UninstallPlugin(GetVars('name', 'GET')); DisablePlugin(GetVars('name', 'GET')); $zbp->BuildModule(); $zbp->SaveCache(); $zbp->SetHint('good'); Redirect('cmd.php?act=PluginMng'); break; case 'PluginEnb': if (!$zbp->ValidToken(GetVars('token', 'GET'))) { $zbp->ShowError(5, __FILE__, __LINE__); die; } $install = '&install='; $install .= EnablePlugin(GetVars('name', 'GET')); $zbp->BuildModule(); $zbp->SaveCache();
/** * 设置当前主题样式 * @param string $theme 主题ID * @param string $style 样式名 * @return string 返回主题ID */ function SetTheme($theme, $style) { global $zbp; $app = $zbp->LoadApp('theme', $theme); $app->CheckCompatibility(); $oldtheme = $zbp->option['ZC_BLOG_THEME']; if ($oldtheme != $theme) { if ($app->sidebars_sidebar1 | $app->sidebars_sidebar2 | $app->sidebars_sidebar3 | $app->sidebars_sidebar4 | $app->sidebars_sidebar5) { $s1 = $zbp->option['ZC_SIDEBAR_ORDER']; $s2 = $zbp->option['ZC_SIDEBAR2_ORDER']; $s3 = $zbp->option['ZC_SIDEBAR3_ORDER']; $s4 = $zbp->option['ZC_SIDEBAR4_ORDER']; $s5 = $zbp->option['ZC_SIDEBAR5_ORDER']; $zbp->option['ZC_SIDEBAR_ORDER'] = $app->sidebars_sidebar1; $zbp->option['ZC_SIDEBAR2_ORDER'] = $app->sidebars_sidebar2; $zbp->option['ZC_SIDEBAR3_ORDER'] = $app->sidebars_sidebar3; $zbp->option['ZC_SIDEBAR4_ORDER'] = $app->sidebars_sidebar4; $zbp->option['ZC_SIDEBAR5_ORDER'] = $app->sidebars_sidebar5; $zbp->cache->zc_sidebar_order1 = $s1; $zbp->cache->zc_sidebar_order2 = $s2; $zbp->cache->zc_sidebar_order3 = $s3; $zbp->cache->zc_sidebar_order4 = $s4; $zbp->cache->zc_sidebar_order5 = $s5; } else { if ($zbp->cache->zc_sidebar_order1 | $zbp->cache->zc_sidebar_order2 | $zbp->cache->zc_sidebar_order3 | $zbp->cache->zc_sidebar_order4 | $zbp->cache->zc_sidebar_order5) { $zbp->option['ZC_SIDEBAR_ORDER'] = $zbp->cache->zc_sidebar_order1; $zbp->option['ZC_SIDEBAR2_ORDER'] = $zbp->cache->zc_sidebar_order2; $zbp->option['ZC_SIDEBAR3_ORDER'] = $zbp->cache->zc_sidebar_order3; $zbp->option['ZC_SIDEBAR4_ORDER'] = $zbp->cache->zc_sidebar_order4; $zbp->option['ZC_SIDEBAR5_ORDER'] = $zbp->cache->zc_sidebar_order5; $zbp->cache->zc_sidebar_order1 = ''; $zbp->cache->zc_sidebar_order2 = ''; $zbp->cache->zc_sidebar_order3 = ''; $zbp->cache->zc_sidebar_order4 = ''; $zbp->cache->zc_sidebar_order5 = ''; } } } $zbp->option['ZC_BLOG_THEME'] = $theme; $zbp->option['ZC_BLOG_CSS'] = $style; $zbp->SaveOption(); if ($oldtheme != $theme) { UninstallPlugin($oldtheme); return $theme; } }