Skip to content

Commit

Permalink
修正了大谋发现的bug;
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowsoft committed Jul 8, 2016
1 parent 1a6b98c commit 21a2347
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions zb_system/cmd.php
Expand Up @@ -258,6 +258,7 @@
case 'ThemeMng':
if (GetVars('install', 'GET')) {
InstallPlugin(GetVars('install', 'GET'));
$zbp->BuildTemplate();
}
Redirect('admin/index.php?' . GetVars('QUERY_STRING', 'SERVER'));
break;
Expand Down
5 changes: 2 additions & 3 deletions zb_system/function/c_system_event.php
Expand Up @@ -2241,6 +2241,8 @@ function PostMember() {
$fpname($mem);
}

$zbp->AddBuildModule('authors');

if (isset($data['Password'])) {
if ($mem->ID == $zbp->user->ID) {
Redirect($zbp->host . 'zb_system/cmd.php?act=login');
Expand Down Expand Up @@ -2583,13 +2585,10 @@ function SetTheme($theme, $style) {
$zbp->option['ZC_BLOG_THEME'] = $theme;
$zbp->option['ZC_BLOG_CSS'] = $style;

$zbp->BuildTemplate();

$zbp->SaveOption();

if ($oldtheme != $theme) {
UninstallPlugin($oldtheme);

return $theme;
}
}
Expand Down
13 changes: 7 additions & 6 deletions zb_system/function/lib/modulebuilder.php
Expand Up @@ -7,14 +7,15 @@
*/
class ModuleBuilder {

//需要重建的module list
public static $List = array();//array('filename'=>,'function' => '', 'paramters' => '');
//需要重建的module list
private static $Ready = array();//'filename';

public static function Build() {
global $zbp;
foreach (ModuleBuilder::$List as $m) {
if (isset($zbp->modulesbyfilename[$m['filename']])) {
$m = $zbp->modulesbyfilename[$m['filename']];
foreach (ModuleBuilder::$Ready as $m) {
if (isset($zbp->modulesbyfilename[$m])) {
$m = $zbp->modulesbyfilename[$m];
$m->Build();
$m->Save();
}
Expand Down Expand Up @@ -44,7 +45,7 @@ public static function Reg($modfilename, $userfunc) {
* @param null $parameters 模块参数
*/
public static function Add($modfilename, $parameters = null) {
ModuleBuilder::$List[$modfilename]['filename'] = $modfilename;
ModuleBuilder::$Ready[$modfilename] = $modfilename;
ModuleBuilder::$List[$modfilename]['parameters'] = $parameters;
}

Expand All @@ -53,7 +54,7 @@ public static function Add($modfilename, $parameters = null) {
* @param string $modfilename 模块名
*/
public static function Del($modfilename) {
unset(ModuleBuilder::$List[$modfilename]);
unset(ModuleBuilder::$Ready[$modfilename]);
}

/**
Expand Down

0 comments on commit 21a2347

Please sign in to comment.