diff --git a/web/app/controllers/subdomain/blog/blog_write.php b/web/app/controllers/subdomain/blog/blog_write.php index d0478a5..85bb219 100644 --- a/web/app/controllers/subdomain/blog/blog_write.php +++ b/web/app/controllers/subdomain/blog/blog_write.php @@ -60,6 +60,7 @@ } else { insertBlog($data); $blog = array('id' => DB::insert_id(), 'tags' => array()); + $ret['blog_id'] = $blog['id']; $ret['blog_write_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}/write"); $ret['blog_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}"); } @@ -77,6 +78,18 @@
+
+
写博客
+
+ style="display: none" + + > + + 博客 ID: + +
+
printHTML() ?>
diff --git a/web/js/blog-editor/blog-editor.js b/web/js/blog-editor/blog-editor.js index ae08a2e..0bf0739 100644 --- a/web/js/blog-editor/blog-editor.js +++ b/web/js/blog-editor/blog-editor.js @@ -212,6 +212,9 @@ function blog_editor_init(name, editor_config) { if (data.blog_url) { $('#a-' + name + '_view_blog').attr('href', data.blog_url).show(); } + if (data.blog_id) { + $('#div-blog-id').html('博客 ID:' + data.blog_id + '').show(); + } } }).fail(function() { if (config.need_preview) {