Пример #1
0
         die($p->URL->vxToRedirect($p->URL->vxGetLogin($p->URL->vxGetBlogCompose($weblog_id))));
     } else {
         $_SESSION['babel_message_weblog'] = '指定的博客网站没有找到';
         die($p->URL->vxToRedirect($p->URL->vxGetLogin($p->URL->vxGetBlogAdmin())));
     }
     break;
 } else {
     if (isset($_GET['weblog_id'])) {
         $weblog_id = intval($_GET['weblog_id']);
         $Weblog = new Weblog($weblog_id);
         if ($Weblog->weblog) {
             if ($Weblog->blg_uid == $p->User->usr_id) {
                 $rt = $p->Validator->vxBlogComposeCheck();
                 if ($rt['errors'] == 0) {
                     $p->Validator->vxBlogComposeInsert($p->User->usr_id, $Weblog->blg_id, $rt['bge_title_value'], $rt['bge_body_value'], $rt['bge_mode_value'], $rt['bge_comment_permission_value'], $rt['bge_status_value'], $rt['published'], $rt['bge_tags_value']);
                     $Weblog->vxUpdateEntries();
                     $sql = "SELECT bge_id FROM babel_weblog_entry WHERE bge_uid = {$p->User->usr_id} ORDER BY bge_created DESC LIMIT 1";
                     $rs = mysql_query($sql);
                     $entry_id = mysql_result($rs, 0, 0);
                     mysql_free_result($rs);
                     if ($rt['bge_status_value'] == 1) {
                         Weblog::vxBuild($p->User->usr_id, $Weblog->blg_id);
                     }
                     die($p->URL->vxToRedirect($p->URL->vxGetBlogList($Weblog->blg_id)));
                     break;
                 } else {
                     $rt['Weblog'] = $Weblog;
                     $p->vxHead($msgSiteTitle = '撰写新文章');
                     $p->vxBodyStart();
                     $p->vxTop();
                     $p->vxContainer('blog_compose_save', $rt);
Пример #2
0
 public function vxBlogErase()
 {
     if ($this->User->vxIsLogin()) {
         if (isset($_GET['entry_id'])) {
             $entry_id = intval($_GET['entry_id']);
             $sql = "SELECT bge_id, bge_uid, bge_pid FROM babel_weblog_entry WHERE bge_id = {$entry_id}";
             $rs = mysql_query($sql);
             if ($_entry = mysql_fetch_array($rs)) {
                 if ($_entry['bge_uid'] == $this->User->usr_id) {
                     $sql = "DELETE FROM babel_weblog_entry_tag WHERE bet_eid = {$entry_id}";
                     mysql_unbuffered_query($sql);
                     $sql = "DELETE FROM babel_weblog_entry WHERE bge_id = {$entry_id}";
                     mysql_unbuffered_query($sql);
                     $Weblog = new Weblog($_entry['bge_pid']);
                     $Weblog->vxSetDirty();
                     $Weblog->vxUpdateEntries();
                     URL::vxToRedirect(URL::vxGetBlogList($Weblog->blg_id));
                 } else {
                     return js_alert('你没有权力对这个博客网站进行操作', '/blog/admin.vx');
                 }
             } else {
                 return js_alert('指定的文章没有找到', '/blog/admin.vx');
             }
         } else {
             return js_alert('指定的文章没有找到', '/blog/admin.vx');
         }
     } else {
         return js_alert('你还没有登录,请登录之后再进行操作', '/blog/admin.vx');
     }
 }