Jelajahi Sumber

Merge pull request #395 from visuddhinanda/master

导入自定义书
visuddhinanda 4 tahun lalu
induk
melakukan
5b6425d51f

+ 35 - 35
app/article/article_add_dlg.js

@@ -1,49 +1,49 @@
 var _article_add_dlg_div;
 function article_add_dlg_init(div) {
-  _article_add_dlg_div = div;
-  let html = "";
-  html += "<div id='article_add_dlg'>";
-  html += "<fieldset class='broder-1 broder-r'>";
-  html += "<legend>" + gLocal.gui.title + "</legend>";
-  html += "<input type='input' id='article_add_title' placeholder='" + gLocal.gui.input + gLocal.gui.title + "' />";
-  html += "</fieldset>";
-  html += "<div>";
-  html += "</div>";
-  html +=
-    "<div style='display:flex;justify-content: space-evenly;padding-top: 1em;'>";
-  html += "<button onclick='article_add_cancel()'>" + gLocal.gui.cancel + "</button>";
-  html += "<button onclick='article_add_new()'>" + gLocal.gui.new + "</button>";
-  html += "</div>";
-  html += "</div>";
+	_article_add_dlg_div = div;
+	let html = "";
+	html += "<div id='article_add_dlg'>";
+	html += "<fieldset class='broder-1 broder-r'>";
+	html += "<legend>" + gLocal.gui.title + "</legend>";
+	html += "<input type='input' id='article_add_title' placeholder='" + gLocal.gui.input + gLocal.gui.title + "' />";
+	html += "</fieldset>";
+	html += "<div>";
+	html += "</div>";
+	html += "<div style='display:flex;justify-content: space-evenly;padding-top: 1em;'>";
+	html += "<button onclick='article_add_cancel()'>" + gLocal.gui.cancel + "</button>";
+	html += "<button onclick='article_add_new()'>" + gLocal.gui.new + "</button>";
+	html += "</div>";
+	html += "</div>";
 
-  $("#" + div).append(html);
+	$("#" + div).append(html);
 }
 
 function article_add_dlg_show() {
-  $("#" + _article_add_dlg_div).show();
+	$("#" + _article_add_dlg_div).show();
 }
 function article_add_dlg_hide() {
-  $("#" + _article_add_dlg_div).hide();
+	$("#" + _article_add_dlg_div).hide();
 }
 function article_add_cancel() {
-  article_add_dlg_hide();
-  $("#article_add_title").val("");
+	article_add_dlg_hide();
+	$("#article_add_title").val("");
 }
 
 function article_add_new() {
-  $.post(
-    "../article/my_article_put.php",
-    {
-      title: $("#article_add_title").val(),
-    },
-    function (data) {
-      let error = JSON.parse(data);
-      if (error.status == 0) {
-        alert("ok");
-        article_add_cancel();
-      } else {
-        alert(error.message);
-      }
-    }
-  );
+	$.post(
+		"../article/my_article_put.php",
+		{
+			title: $("#article_add_title").val(),
+		},
+		function (data) {
+			let error = JSON.parse(data);
+			if (error.status == 0) {
+				alert("ok");
+				article_add_cancel();
+				window.location.reload();
+			} else {
+				alert(error.message);
+			}
+		}
+	);
 }

+ 44 - 45
app/article/collect_add_dlg.js

@@ -1,60 +1,59 @@
 var _collect_add_dlg_div;
 function collect_add_dlg_init(div) {
-  _collect_add_dlg_div = div;
-  let html = "";
-  html += "<div id='collect_add_dlg'>";
-  html += "<div >";
-  html += "<div >" + gLocal.gui.anthology + gLocal.gui.title + "</div>";
-  html += "<input type='input' id='collect_add_title' />";
-  html += "</div>";
-  html += "<div>";
-  html += "</div>";
-  html +=
-    "<div style='display:flex;justify-content: space-between;padding-top: 1em;'>";
-  html += "<div>";
-  html += "<select id='collect_add_dlg_status'>";
-  html += "<option value='1'>" + gLocal.gui.private + "</option>";
-  html += "<option value='2'>" + gLocal.gui.unlisted + "</option>";
-  html += "<option value='3'>" + gLocal.gui.public + "</option>";
-  html += "</select>";
+	_collect_add_dlg_div = div;
+	let html = "";
+	html += "<div id='collect_add_dlg'>";
+	html += "<div >";
+	html += "<div >" + gLocal.gui.anthology + gLocal.gui.title + "</div>";
+	html += "<input type='input' id='collect_add_title' />";
+	html += "</div>";
+	html += "<div>";
+	html += "</div>";
+	html += "<div style='display:flex;justify-content: space-between;padding-top: 1em;'>";
+	html += "<div>";
+	html += "<select id='collect_add_dlg_status'>";
+	html += "<option value='10'>" + gLocal.gui.private + "</option>";
+	html += "<option value='30'>" + gLocal.gui.public + "</option>";
+	html += "</select>";
 
-  html += "</div>";
-  html += "<div>";
-  html += "<button onclick='collect_add_cancel()'>" + gLocal.gui.cancel + "</button>";
-  html += "<button onclick='collect_add_new()'>" + gLocal.gui.new + "</button>";
-  html += "</div>";
-  html += "</div>";
-  html += "</div>";
+	html += "</div>";
+	html += "<div>";
+	html += "<button onclick='collect_add_cancel()'>" + gLocal.gui.cancel + "</button>";
+	html += "<button onclick='collect_add_new()'>" + gLocal.gui.new + "</button>";
+	html += "</div>";
+	html += "</div>";
+	html += "</div>";
 
-  $("#" + div).append(html);
+	$("#" + div).append(html);
 }
 
 function collect_add_dlg_show() {
-  $("#" + _collect_add_dlg_div).show();
+	$("#" + _collect_add_dlg_div).show();
 }
 function collect_add_dlg_hide() {
-  $("#" + _collect_add_dlg_div).hide();
+	$("#" + _collect_add_dlg_div).hide();
 }
 function collect_add_cancel() {
-  collect_add_dlg_hide();
-  $("#collect_add_title").val("");
+	collect_add_dlg_hide();
+	$("#collect_add_title").val("");
 }
 
 function collect_add_new() {
-  $.post(
-    "../article/my_collect_put.php",
-    {
-      title: $("#collect_add_title").val(),
-      status: $("#collect_add_dlg_status").val(),
-    },
-    function (data) {
-      let error = JSON.parse(data);
-      if (error.status == 0) {
-        alert("ok");
-        collect_add_cancel();
-      } else {
-        alert(error.message);
-      }
-    }
-  );
+	$.post(
+		"../article/my_collect_put.php",
+		{
+			title: $("#collect_add_title").val(),
+			status: $("#collect_add_dlg_status").val(),
+		},
+		function (data) {
+			let error = JSON.parse(data);
+			if (error.status == 0) {
+				alert("ok");
+				collect_add_cancel();
+				window.location.reload();
+			} else {
+				alert(error.message);
+			}
+		}
+	);
 }

+ 6 - 1
app/article/get.php

@@ -12,7 +12,12 @@ require_once "../article/function.php";
 
 if(isset($_GET["id"])){
 	//查询权限
-	$collectionId = $_GET["collection_id"];
+	if(isset($_GET["collection_id"])){
+		$collectionId = $_GET["collection_id"];
+	}
+	else{
+		$collectionId = "";
+	}
 	$redis = redis_connect();
 	$article = new Article($redis); 
 	$power = $article->getPower($_GET["id"],$collectionId);

+ 25 - 3
app/article/my_article.js

@@ -195,7 +195,13 @@ function my_article_edit(id) {
 					html += "<input type='hidden' name='tag' value='" + result.tag + "'/>";
 					html += "<input type='hidden' name='status' value='" + result.status + "'/>";
 
-					//html += "<input type='checkbox' name='import' />" + gLocal.gui.import + gLocal.gui.text;
+					html += "<div style='display:none;'>";
+					html +=
+						"<input type='checkbox' name='import' id='import_custom_book'  />" +
+						gLocal.gui.import +
+						gLocal.gui.text;
+					html += "</div>";
+
 					html += "<div>";
 					//html += "<div id='article_collect' vui='collect-dlg' ></div>"
 					html += "<div style='display:flex;'>";
@@ -207,8 +213,9 @@ function my_article_edit(id) {
 					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="display:none;width:100%;" ><span style="flex:3;margin: auto;">' +
+						'<span style="flex:3;margin: auto;">' +
 						gLocal.gui.language_select +
 						'</span>	<input id="article_lang_select"  style="flex:7;width:100%;" type="input" onchange="article_lang_change()"  placeholder="' +
 						gLocal.gui.input +
@@ -271,7 +278,21 @@ function article_preview() {
 	$("#preview_inner").html(note_init($("#article_content").val()));
 	note_refresh_new();
 }
-
+function my_article_custom_book() {
+	$content = $("#article_content").val();
+	if ($content == "") {
+		alert("内容不能为空");
+		return;
+	}
+	if ($content.indexOf("{{") >= 0) {
+		alert("不能包含句子模版");
+		return;
+	}
+	if (confirm("将此文档转换为自定义书模版吗?") == true) {
+		document.querySelector("#import_custom_book").checked = true;
+		my_article_save();
+	}
+}
 function my_article_save() {
 	$.ajax({
 		type: "POST", //方法类型
@@ -283,6 +304,7 @@ function my_article_save() {
 
 			if (result.status == 0) {
 				alert(gLocal.gui.saved + gLocal.gui.successful);
+				window.location.reload();
 			} else {
 				alert("error:" + result.message);
 			}

+ 11 - 1
app/article/my_article_edit.php

@@ -72,7 +72,7 @@ require_once '../studio/index_head.php';
 
 				<span class="icon_btn_div">
 					<span class="icon_btn_tip"><?php echo $_local->gui->back ;?></span>
-					<button id="icon_btn" type="button" class="icon_btn"  onclick="my_article_save()">
+					<button id="icon_btn" type="button" class="icon_btn" >
 						<a href="../article/my_article_index.php" >
 							<svg class="icon">
 								<use xlink:href="../studio/svg/icon.svg#return"></use>
@@ -92,7 +92,17 @@ require_once '../studio/index_head.php';
 
 				
 			</div>
+			
 			<div style="display:flex;">
+				<span class="icon_btn_div">
+					<span class="icon_btn_tip"><?php echo "自定义书" ;?></span>
+					<button id="edit_custom_book" type="button" class="icon_btn"  onclick="my_article_custom_book()">
+						<svg class="icon">
+							<use xlink:href="../studio/svg/icon.svg#convert"></use>
+						</svg>
+					</button>
+				</span>
+
 				<div id="article_collect" vui='collect-dlg' ></div>
 				<span class="icon_btn_div">
 					<span class="icon_btn_tip"><?php echo $_local->gui->scan_in_reader ;?></span>

+ 27 - 88
app/article/my_article_post.php

@@ -6,6 +6,7 @@ require_once '../hostsetting/function.php';
 require_once "../ucenter/active.php";
 require_once "../article/function.php";
 require_once "../redis/function.php";
+require_once "../db/custom_book.php";
 
 add_edit_event(_ARTICLE_EDIT_,$_POST["id"]);
 
@@ -24,97 +25,35 @@ if($power<20){
 
 $_content = $_POST["content"];
 
-/*
-if($_POST["import"]=='on'){
-    $sent = explode("\n",$_POST["content"]);
-    if($sent && count($sent)>0){
-        $setting =  new Hostsetting();
-        $max_book = $setting->get("max_book_number");
-        if($max_book){
-            $currBook = $max_book+1;
-            $setbooknum = $setting->set("max_book_number",$currBook);
-            if($setbooknum==false){
-                $respond["status"]=1;
-                $respond["message"]="设置书号错误";
-                echo json_encode($respond, JSON_UNESCAPED_UNICODE);
-                exit;
-            }
-        }
-        else{
-            $respond["status"]=1;
-            $respond["message"]="获取书号错误";
-            echo json_encode($respond, JSON_UNESCAPED_UNICODE);
-            exit;
-        }
-        PDO_Connect(""._FILE_DB_SENTENCE_);
 
-        # 开始一个事务,关闭自动提交 
-        $PDO->beginTransaction();
-        $query="INSERT INTO sentence ('id','block_id','channal','book','paragraph','begin','end','tag','author','editor','text','language','ver','status','strlen','create_time','modify_time','receive_time') VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? , ?, ?)";
-        
-        $sth = $PDO->prepare($query);
-        
-        $para = 1;
-        $sentNum = 0;
-        $newText =  "";
-        foreach ($sent as $data) {
-            $data = trim($data);
-            if($data==""){
-                $para++;
-                $sentNum = 0;
-                $newText .="\n";
-                continue;
-            }
-            else{
-                $sentNum=$sentNum+10;
-            }
-            if(mb_substr($data,0,2,"UTF-8")=="{{"){
-                $newText .=$data."\n";
-            }
-            else{
-                $newText .='{{'."{$currBook}-{$para}-{$sentNum}-{$sentNum}"."}}\n";
-                $sth->execute(
-                        array(UUID::v4(),
-                                    "",
-                                    $_POST["channal"],
-                                    $currBook,
-                                    $para,
-                                    $sentNum,
-                                    $sentNum,
-                                    "",
-                                    "[]",
-                                    $_COOKIE["userid"],
-                                    $data,
-                                    $_POST["lang"],
-                                    1,
-                                    1,
-                                    mb_strlen($data,"UTF-8"),
-                                    mTime(),
-                                    mTime(),
-                                    mTime()
-                                ));                
-            }
+if($_POST["import"]=='on'){
+	#导入自定义书
+	$custom_book = new CustomBook($redis);
+	$_lang = explode("_",$_POST["lang"]);
+	if(count($_lang)===3){
+		$lang = $_lang[2];
+	}
+	else if(count($_lang)===1){
+		$lang = $_lang[0];
+	}
+	else{
+		$respond["status"]=1;
+		$respond["message"]="无法识别的语言".$_POST["lang"];
+		echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+		exit;
+	}
 
-        }
-        $PDO->commit();
-        
-        if (!$sth || ($sth && $sth->errorCode() != 0)) {
-            #  识别错误且回滚更改  
-            $PDO->rollBack();
-            $error = PDO_ErrorInfo();
-            $respond['status']=1;
-            $respond['message']=$error[2];
-            echo json_encode($respond, JSON_UNESCAPED_UNICODE);
-            exit;
-        }
-        else{
-            $respond['status']=0;
-            $respond['message']="成功";
-            $_content = $newText;
-        }		        
-    }
+	$respond = $custom_book->new($_POST["title"],$_content,$lang);
+	if($respond["status"]==0){
+		$_content = $respond["content"];
+	}
+	else{
+		echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+		exit;
+	}
 }
-*/
+
+
 PDO_Connect(_FILE_DB_USER_ARTICLE_);
 
 $query="UPDATE article SET title = ? , subtitle = ? , summary = ?, content = ?  , tag = ? , setting = ? , status = ? , receive_time= ?  , modify_time= ?   where  id = ?  ";

+ 1 - 1
app/article/my_collect_put.php

@@ -26,7 +26,7 @@ PDO_Connect(""._FILE_DB_USER_ARTICLE_);
 $query="INSERT INTO collect ( id,  title  , subtitle  , summary , article_list   , owner, lang  , status  , create_time , modify_time , receive_time   )  VALUES  ( ? , ? , ? , ?  , ? , ? , ? , ? , ? , ? , ? ) ";
 $sth = $PDO->prepare($query);
 $uuid = UUID::v4();
-$sth->execute(array($uuid , $_POST["title"] , "" ,"", "[]" ,  $_COOKIE["userid"] , "" , 1 , mTime() ,  mTime() , mTime() ));
+$sth->execute(array($uuid , $_POST["title"] , "" ,"", "[]" ,  $_COOKIE["userid"] , "" , $_POST["status"] , mTime() ,  mTime() , mTime() ));
 $respond=array("status"=>0,"message"=>"");
 if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$error = PDO_ErrorInfo();

+ 149 - 0
app/db/custom_book.php

@@ -0,0 +1,149 @@
+<?php
+require_once "../path.php";
+require_once "../db/table.php";
+require_once '../hostsetting/function.php';
+
+class CustomBook extends Table
+{
+    function __construct($redis=false) {
+		parent::__construct(_FILE_DB_USER_CUSTOM_BOOK_, "custom_book", "", "",$redis);
+    }
+
+	public function new($title,$data,$lang)
+	{
+		$respond['status']=0;
+		$respond['message']="";
+		$respond['content']="";
+
+		$sent = explode("\n",$data);
+		if($sent && count($sent)>0){
+			$setting =  new Hostsetting();
+			$max_book = $setting->get("max_book_number");
+			if($max_book){
+				$currBook = $max_book+1;
+				$setbooknum = $setting->set("max_book_number",$currBook);
+				if($setbooknum==false){
+					$respond["status"]=1;
+					$respond["message"]="设置书号错误";
+					return $respond;
+				}
+			}
+			else{
+				$respond["status"]=1;
+				$respond["message"]="获取书号错误";
+				return $respond;
+			}
+
+			$query="INSERT INTO {$this->table} ('book_id','title','owner','lang','status','modify_time','create_time') VALUES (?, ?, ?, ?, ?, ?, ?)";
+
+			$stmt = $this->execute($query,array($currBook,$title,$_COOKIE["userid"],$lang,10,mTime(),mTime()));
+			if($stmt){
+				$CSent = new CustomBookSentence($this->redis);
+				$respond = $CSent->insert($currBook,$sent,$lang);
+			}
+			else{
+				$respond["status"]=1;
+				$respond["message"]="插入新书失败";
+			}
+		}
+		return $respond;
+	}
+}
+
+class CustomBookSentence extends Table
+{
+    function __construct($redis=false) {
+		parent::__construct(_FILE_DB_USER_CUSTOM_BOOK_, "custom_book_sentence", "", "",$redis);
+    }
+
+	public function getAll($book,$para,$start,$end){
+		$query="SELECT text,length,lang,modify_time,create_time,owner FROM custom_book_sentence WHERE book = ? AND paragraph = ? AND begin=? AND end = ?";
+		$result = $this->fetch($query,array($book,$para,$start,$end));
+		if($result){
+			return $result;
+		}
+		else{
+			return array("text"=>"","length"=>"","lang"=>"","modify_time"=>0,"create_time"=>0,"owner"=>"");
+		}
+	}
+
+	public function insert($book,$content,$lang)
+	{
+		$respond['status']=0;
+		$respond['message']="";
+		$respond['content']="";
+		# 开始一个事务,关闭自动提交 
+		$this->dbh->beginTransaction();
+		$query="INSERT INTO custom_book_sentence ('book','paragraph','begin','end','length','text','lang','owner','status','create_time','modify_time') VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
+		
+		$sth = $this->dbh->prepare($query);
+		
+		$para = 1;
+		$sentNum = 0;
+		$newText =  "";
+		foreach ($content as $data) {
+			$data = trim($data);
+			if($data==""){
+				$para++;
+				$sentNum = 0;
+				$newText .="\n";
+				continue;
+			}
+			else{
+				$sentNum=$sentNum+10;
+			}
+			if(mb_substr($data,0,2,"UTF-8")=="{{"){
+				$newText .=$data."\n";
+			}
+			else{
+				$newText .='{{'."{$book}-{$para}-{$sentNum}-{$sentNum}"."}}\n";
+				$sth->execute(
+						array(
+							$book,
+							$para,
+							$sentNum,
+							$sentNum,
+							mb_strlen($data,"UTF-8"),
+							$data,
+							$lang,
+							$_COOKIE["userid"],
+							10,
+							mTime(),
+							mTime()
+						));                
+			}
+
+		}
+		$this->dbh->commit();
+		
+		if (!$sth || ($sth && $sth->errorCode() != 0)) {
+			#  识别错误且回滚更改  
+			$this->dbh->rollBack();
+			$error = $this->dbh->errorInfo();
+			$respond['status']=1;
+			$respond['message']=$error[2];
+			$respond['content']="";
+		}
+		else{
+			$respond['status']=0;
+			$respond['message']="成功";
+			$respond['content']=$newText;
+		}	
+
+		return $respond;
+	}
+
+	public function getText($book,$para,$start,$end){
+		$query="SELECT text FROM custom_book_sentence WHERE book = ? AND paragraph = ? AND begin=? AND end = ?";
+		$result = $this->fetch($query,array($book,$para,$start,$end));
+		if($result){
+			return $result["text"];
+		}
+		else{
+			return "unkow";
+		}
+	}
+
+}
+
+?>

+ 18 - 0
app/db/table.php

@@ -40,6 +40,24 @@ class Table
 			return false;
 		}
 	}
+
+	function execute($query, $params=null){
+		if (isset($params)) {
+			$stmt = $this->dbh->prepare($query);
+			if($stmt){
+				$stmt->execute($params);
+				return $stmt;				
+			}
+			else{
+				return false;
+			}
+
+		} else {
+			return $this->dbh->query($query);
+		}
+	}
+
+
 	public function syncList($time){
 
 	}

+ 1 - 0
app/path.php

@@ -121,3 +121,4 @@ define("_FILE_DB_USER_SENTENCE_HISTORAY_", "sqlite:" . __DIR__ . "/../tmp/user/u
 define("_FILE_DB_USER_ACTIVE_", "sqlite:" . __DIR__ . "/../tmp/user/user_active.db3");
 define("_FILE_DB_USER_ACTIVE_LOG_", "sqlite:" . __DIR__ . "/../tmp/user/user_active_log.db3");
 define("_FILE_DB_USER_SHARE_", "sqlite:" . __DIR__ . "/../tmp/user/share.db3");
+define("_FILE_DB_USER_CUSTOM_BOOK_", "sqlite:" . __DIR__ . "/../tmp/user/custom_book.db3");

File diff ditekan karena terlalu besar
+ 3 - 52
app/studio/svg/icon.svg


+ 25 - 10
app/term/channal_list.php

@@ -6,6 +6,12 @@ require_once "../path.php";
 require_once '../channal/function.php';
 require_once '../ucenter/function.php';
 require_once '../share/function.php';
+require_once '../db/custom_book.php';
+require_once '../redis/function.php';
+
+$redis = redis_connect();
+
+$custom_book = new CustomBookSentence($redis);
 
 $log = "";
 $timeStart = microtime(true);
@@ -95,16 +101,25 @@ foreach ($_data as $key => $value) {
     try {
         # 查询句子长度
         $pali_letter["id"] = $arrInfo[0];
-        $query = "SELECT length FROM pali_sent WHERE book= ? AND paragraph= ? AND begin= ? AND end= ?  ";
-        $stmt = $db_pali_sent->prepare($query);
-        $stmt->execute(array($bookId, $para, $begin, $end));
-        $Fetch = $stmt->fetch(PDO::FETCH_ASSOC);
-        if ($Fetch) {
-            $pali_letter["len"] = $Fetch["length"];
-            $article_len += $Fetch["length"];
-        } else {
-            $pali_letter["len"] = 0;
-        }
+
+		if($bookId<1000){
+			$query = "SELECT length FROM pali_sent WHERE book= ? AND paragraph= ? AND begin= ? AND end= ?  ";
+			$stmt = $db_pali_sent->prepare($query);
+			$stmt->execute(array($bookId, $para, $begin, $end));
+			$Fetch = $stmt->fetch(PDO::FETCH_ASSOC);
+			if ($Fetch) {
+				$pali_letter["len"] = $Fetch["length"];
+				$article_len += $Fetch["length"];
+			} else {
+				$pali_letter["len"] = 0;
+			}			
+		}
+		else{
+			$sentInfo = $custom_book->getAll($bookId, $para, $begin, $end);
+			$pali_letter["len"] = $sentInfo["length"];
+			$article_len += $sentInfo["length"];
+		}
+
 
         #公开 或 channel有权限的
         $query = "SELECT channal FROM sentence WHERE book= ? AND paragraph= ? AND begin= ? AND end= ?  AND strlen >0 and (status = 30 {$channel_query} ) group by channal  limit 0 ,20 ";

+ 3 - 3
app/term/note.js

@@ -217,7 +217,7 @@ function render_read_mode_sent(iterator) {
 		"' end='" +
 		iterator.end +
 		"' >" +
-		iterator.palitext +
+		marked(iterator.palitext) +
 		"</pali>";
 
 	if (
@@ -971,9 +971,9 @@ function render_one_sent_tran_a(iterator, diff = false) {
 		html += iterator.channalinfo.name;
 	}
 	html += "</span>";
-	html += '<span class="name editor_name" '
+	html += '<span class="name editor_name" ';
 	if (typeof iterator.channalinfo == "undefined") {
-		html += '>';
+		html += ">";
 		html += "unkown";
 	} else {
 		html += 'title="' + iterator.channalinfo.name + gLocal.gui.recent_update + '">';

+ 13 - 4
app/term/note.php

@@ -7,6 +7,7 @@ require_once "../ucenter/function.php";
 require_once "../usent/function.php";
 require_once "../pali_text/function.php";
 require_once "../redis/function.php";
+require_once "../db/custom_book.php";
 
 $redis = redis_connect();
 
@@ -88,6 +89,7 @@ if (count($channal_list) > 0) {
 }
 
 # 查询有阅读权限的channel 结束
+$custom_book = new CustomBookSentence($redis);
 
 foreach ($_data as $key => $value) {
     # code...
@@ -112,10 +114,17 @@ foreach ($_data as $key => $value) {
     }
 	$pali_sim = 0;
     if ($redis != false) {
-        $result = $redis->hGet('pali://sent/' . $bookId . "_" . $para . "_" . $begin . "_" . $end,"pali");
-		$palitext = $result;
-		$pali_text_id = $redis->hGet('pali://sent/' . $bookId . "_" . $para . "_" . $begin . "_" . $end,"id");
-		$pali_sim = $redis->hGet('pali://sent/' . $bookId . "_" . $para . "_" . $begin . "_" . $end,"sim_count");
+		if($bookId<1000){
+			$result = $redis->hGet('pali://sent/' . $bookId . "_" . $para . "_" . $begin . "_" . $end,"pali");
+			$palitext = $result;
+			$pali_text_id = $redis->hGet('pali://sent/' . $bookId . "_" . $para . "_" . $begin . "_" . $end,"id");
+			$pali_sim = $redis->hGet('pali://sent/' . $bookId . "_" . $para . "_" . $begin . "_" . $end,"sim_count");
+		}
+		else{
+			$palitext = $custom_book->getText($bookId,$para,$begin,$end);
+			$pali_text_id = 0;
+		}
+
     } else {
         $query = "SELECT id,html FROM 'pali_sent' WHERE book = ? AND paragraph = ? AND begin = ? AND end = ? ";
         $sth = $db_pali_sent->prepare($query);

+ 1 - 1
app/term/term.css

@@ -194,7 +194,7 @@ blockquote {
 	padding-left: 5px;
 }
 
-.read_mode blockquote {
+.read blockquote {
 	font-size: 80%;
 	color: var(--main-color1);
 	background-color: #7d7d7d1f;

+ 18 - 0
documents/审校流程.md

@@ -0,0 +1,18 @@
+# 审校流程
+
+```mermaid
+graph LR;
+
+原始版私有--复刻-->编辑1私有库
+原始版私有--复刻-->编辑2私有库
+原始版私有--复刻-->编辑3私有库
+
+编辑1私有库 -- pr --> 润校channel
+编辑2私有库 -- pr --> 润校channel
+编辑3私有库 -- pr --> 润校channel
+
+润校channel -- 统稿人<br>merge --> 待定版
+
+待定版 -- 审稿人推送 --> IAPT正式版-公开
+
+```

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini