Skip to content

Commit

Permalink
修改模板类;
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowsoft committed Jul 11, 2016
1 parent 21a2347 commit df6d058
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
2 changes: 2 additions & 0 deletions zb_system/cmd.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@
case 'ThemeMng':
if (GetVars('install', 'GET')) {
InstallPlugin(GetVars('install', 'GET'));
}
if (GetVars('install', 'GET') !== null) {
$zbp->BuildTemplate();
}
Redirect('admin/index.php?' . GetVars('QUERY_STRING', 'SERVER'));
Expand Down
1 change: 0 additions & 1 deletion zb_system/defend/default/sidebar.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{* Template Name:侧栏模板 *}
{foreach $sidebar as $module}
{$module->Content = str_replace(array_keys($this->replaceTags),array_values($this->replaceTags),$module->Content)}
{template:module}
{/foreach}
23 changes: 15 additions & 8 deletions zb_system/function/c_system_event.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ function VerifyLogin() {
$addinfo['levelname'] = $m->LevelName;
$addinfo['userid'] = $m->ID;
$addinfo['useralias'] = $m->StaticName;
if ($sd == 0) {
setcookie("username", $un, 0, $zbp->cookiespath);
setcookie("password", $ps, 0, $zbp->cookiespath);
setcookie("addinfo" . str_replace('/', '', $zbp->cookiespath), json_encode($addinfo), 0, $zbp->cookiespath);
} else {
setcookie("username", $un, time() + 3600 * 24 * $sd, $zbp->cookiespath);
setcookie("password", $ps, time() + 3600 * 24 * $sd, $zbp->cookiespath);
setcookie("addinfo" . str_replace('/', '', $zbp->cookiespath), json_encode($addinfo), time() + 3600 * 24 * $sd, $zbp->cookiespath);

if ($sd == 0)
$sdt = 0;
else
$sdt = time() + 3600 * 24 * $sd;

if(HTTP_SCHEME == 'https://'){
setcookie("username", $un, $sdt, $zbp->cookiespath, '', true, false);
setcookie("password", $ps, $sdt, $zbp->cookiespath, '', true, true);
setcookie("addinfo" . str_replace('/', '', $zbp->cookiespath), json_encode($addinfo), $sdt, $zbp->cookiespath, '', true, false);

}else{
setcookie("username", $un, $sdt, $zbp->cookiespath);
setcookie("password", $ps, $sdt, $zbp->cookiespath);
setcookie("addinfo" . str_replace('/', '', $zbp->cookiespath), json_encode($addinfo), $sdt, $zbp->cookiespath);
}

return true;
Expand Down
8 changes: 6 additions & 2 deletions zb_system/function/lib/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Template {
public $templates = array();
public $compiledTemplates = array();
public $templateTags = array();
public $replaceTags = array();
public $staticTags = array();

/**
* @var array 默认侧栏
Expand Down Expand Up @@ -641,6 +641,10 @@ public function MakeTemplateTags() {
}

}
$this->replaceTags = $t + $o;
$this->staticTags = $t + $o;
}
public function ReplaceStaticTags($s) {
$s = str_replace(array_keys($this->replaceTags), array_values($this->replaceTags), $s);
return $s;
}
}
1 change: 0 additions & 1 deletion zb_system/function/lib/zblogphp.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,6 @@ public function Load() {
$fpreturn = $fpname();
if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
$fpsignal = PLUGIN_EXITSIGNAL_NONE;

return $fpreturn;
}
}
Expand Down

0 comments on commit df6d058

Please sign in to comment.