Procházet zdrojové kódy

:bug: 新建文章报无标题错误,增加subtitle

visuddhinanda před 4 roky
rodič
revize
a1c06c924a

+ 2 - 2
app/article/article_add_dlg.js

@@ -21,7 +21,7 @@ function article_add_dlg_init(div) {
 
 function article_add_dlg_show(param=null) {
 	_article_create_param=param;
-	if(param){
+	if(param!=null){
 		if(typeof param.title !="undefined"){
 			$("#article_add_title").val(param.title);
 		}
@@ -37,7 +37,7 @@ function article_add_cancel() {
 }
 
 function article_add_new() {
-	if(typeof _article_create_param == "undefined"){
+	if(_article_create_param == null){
 		_article_create_param = {
 			title: $("#article_add_title").val(),
 		}

+ 21 - 5
app/article/my_article.js

@@ -192,21 +192,34 @@ function my_article_edit(id) {
 					html += "</div>";
 
 					html += "<div>";
-					//html += "<div id='article_collect' vui='collect-dlg' ></div>"
+
 					html += "<div style='display:flex;'>";
 					html += "<span style='flex:1;'>" + gLocal.gui.title + "</span>";
 					html += '<span id="article_title" style="flex:7;"></span>';
 					html += "</div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<span style='flex:1;'>" + gLocal.gui.sub_title + "</span>";
+					html += '<span id="article_title" style="flex:7;">';
+					if(!result.subtitle){
+						result.subtitle="";
+					}
+					html += '<input type="input" name="subtitle" value="'+result.subtitle+'" />'
+					html += '</span>';
+					html += "</div>";
+
 					html += "<div id='channal_selector' form_name='channal' style='display:none;'></div>";
 					html += "<div style='display:flex;'>";
 					html += "<span style='flex:1;'>" + gLocal.gui.status + "</span>";
 					html += '<span id="aritcle_status" style="flex:7;"></span>';
 					html += "</div>";
-					html += '<div style="width:100%;" >';
+
+					html += '<div style="width:100%;display:flex;" >';
 					html +=
-						'<span style="flex:3;margin: auto;">' +
+						'<span style="flex:1;margin: auto;">' +
 						gLocal.gui.language_select +
-						'</span>	<input id="article_lang_select"  style="flex:7;width:100%;" type="input" onchange="article_lang_change()"  placeholder="' +
+						'</span>';
+					html +='<input id="article_lang_select"  style="flex:7;width:100%;" type="input" onchange="article_lang_change()"  placeholder="' +
 						gLocal.gui.input +
 						" & " +
 						gLocal.gui.language_select +
@@ -216,7 +229,10 @@ function my_article_edit(id) {
 						result.lang +
 						'" value="' +
 						result.lang +
-						'" > <input id="article_lang" type="hidden" name="lang" value=""></div>';
+						'" >';
+					html +=' <input id="article_lang" type="hidden" name="lang" value="">';
+					html +='</div>';
+
 					html += "<div style='display:flex;'>";
 					html += "<span style='flex:1;margin:auto;'>" + gLocal.gui.introduction + "</span>";
 					html += "<textarea style='flex:7;' name='summary' >" + result.summary + "</textarea></div>";

+ 1 - 1
app/article/my_article_post.php

@@ -58,7 +58,7 @@ PDO_Connect(_FILE_DB_USER_ARTICLE_);
 
 $query="UPDATE article SET title = ? , subtitle = ? , summary = ?, content = ?  , tag = ? , setting = ? , status = ? , receive_time= ?  , modify_time= ?   where  id = ?  ";
 $sth = $PDO->prepare($query);
-$sth->execute(array($_POST["title"] , $_POST["subtitle"] ,$_POST["summary"], $_content , $_POST["tag"] , $_POST["setting"] , $_POST["status"] ,   mTime() , mTime() , $_POST["id"]));
+$sth->execute(array($_POST["title"] , $_POST["subtitle"] ,$_POST["summary"], $_content , $_POST["tag"] , "{}" , $_POST["status"] ,   mTime() , mTime() , $_POST["id"]));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();