Exemplo n.º 1
0
 function Save()
 {
     global $zbp;
     if ($this->Template == $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE']) {
         $this->Data['Template'] = '';
     }
     return parent::Save();
 }
Exemplo n.º 2
0
function RegPage_CreateCode($n)
{
    global $zbp;
    for ($i = 0; $i < 100; $i++) {
        $r = new Base($GLOBALS['RegPage_Table'], $GLOBALS['RegPage_DataInfo']);
        $r->InviteCode = GetGuid();
        $r->Level = $zbp->Config('RegPage')->default_level;
        $r->Save();
    }
}
Exemplo n.º 3
0
 function Save()
 {
     global $zbp;
     if ($this->Template == $zbp->option['ZC_INDEX_DEFAULT_TEMPLATE']) {
         $this->data['Template'] = '';
     }
     foreach ($GLOBALS['Filter_Plugin_Tag_Save'] as $fpname => &$fpsignal) {
         $fpreturn = $fpname($this);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             return $fpreturn;
         }
     }
     return parent::Save();
 }
Exemplo n.º 4
0
 /**
  * @return bool
  */
 public function Save()
 {
     global $zbp;
     if ($this->Type == ZC_POST_TYPE_ARTICLE) {
         if ($this->Template == GetValueInArray($this->Category->GetData(), 'LogTemplate')) {
             $this->data['Template'] = '';
         }
     }
     if ($this->Template == $zbp->GetPostType_Template($this->Type)) {
         $this->data['Template'] = '';
     }
     foreach ($GLOBALS['hooks']['Filter_Plugin_Post_Save'] as $fpname => &$fpsignal) {
         $fpsignal = PLUGIN_EXITSIGNAL_NONE;
         $fpreturn = $fpname($this);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             return $fpreturn;
         }
     }
     return parent::Save();
 }
Exemplo n.º 5
0
 /**
  * @return bool
  */
 function Save()
 {
     global $zbp;
     foreach ($GLOBALS['Filter_Plugin_Module_Save'] as $fpname => &$fpsignal) {
         $fpreturn = $fpname($this);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             $fpsignal = PLUGIN_EXITSIGNAL_NONE;
             return $fpreturn;
         }
     }
     if ($this->Source == 'theme') {
         if (!$this->FileName) {
             return true;
         }
         $c = $this->Content;
         $d = $zbp->usersdir . 'theme/' . $zbp->theme . '/include/';
         $f = $d . $this->FileName . '.php';
         if (!file_exists($d)) {
             @mkdir($d, 0755);
         }
         @file_put_contents($f, $c);
         return true;
     }
     return parent::Save();
 }
Exemplo n.º 6
0
 /**
  * 保存评论数据
  * @return bool
  */
 function Save()
 {
     global $zbp;
     foreach ($GLOBALS['hooks']['Filter_Plugin_Comment_Save'] as $fpname => &$fpsignal) {
         $fpsignal = PLUGIN_EXITSIGNAL_NONE;
         $fpreturn = $fpname($this);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             return $fpreturn;
         }
     }
     return parent::Save();
 }
Exemplo n.º 7
0
 /**
  * @return bool
  */
 public function Save()
 {
     global $zbp;
     $this->Content = str_replace($zbp->host, '{$host}', $this->Content);
     foreach ($GLOBALS['hooks']['Filter_Plugin_Module_Save'] as $fpname => &$fpsignal) {
         $fpsignal = PLUGIN_EXITSIGNAL_NONE;
         $fpreturn = $fpname($this);
         if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
             return $fpreturn;
         }
     }
     if ($this->Source == 'theme') {
         if (!$this->FileName) {
             return true;
         }
         $c = $this->Content;
         $d = $zbp->usersdir . 'theme/' . $zbp->theme . '/include/';
         $f = $d . $this->FileName . '.php';
         if (!file_exists($d)) {
             @mkdir($d, 0755);
         }
         @file_put_contents($f, $c);
         return true;
     }
     //return parent::Save();
     //防Module重复保存的机制
     $m = $zbp->GetListType('Module', $zbp->db->sql->get()->select($zbp->table['Module'])->where(array('=', $zbp->datainfo['Module']['FileName'][0], $this->FileName))->sql);
     if (count($m) < 1) {
         return parent::Save();
     } else {
         if ($this->ID == 0) {
             return false;
         }
         return parent::Save();
     }
 }