Selaa lähdekoodia

Merge pull request #750 from visuddhinanda/laravel

🐛 没有判断getChannal是否成功 导致转法轮经channel列表出不来
visuddhinanda 4 vuotta sitten
vanhempi
sitoutus
b48a6809a3

+ 180 - 0
public/app/article/print.php

@@ -0,0 +1,180 @@
+<?php
+require_once __DIR__."/../config.php";
+require_once "../pcdl/html_head.php";
+?>
+<body style="margin: 0;padding: 0;" class="reader_body" >
+	<script>
+		var gCaseTable=<?php echo file_get_contents("../public/js/case.json"); ?>
+	</script>
+
+	<script  src="./article.js"></script>
+
+	<script>
+	<?php
+	$_id = "";
+	$_display = "";
+	$_channal  = "";
+	$_collect = "";
+
+	if(isset($_GET["view"])){
+		echo "_view='".$_GET["view"]."';";
+	}
+	else{
+		echo "_view='article';";
+	}
+
+	if(isset($_GET["collection"])){
+		echo "_collection_id='".$_GET["collection"]."';";
+	}
+
+	if(isset($_GET["channel"])){
+		echo "_channal='".$_GET["channel"]."';";
+	}
+
+
+	
+	if(isset($_GET["mode"]) && $_GET["mode"]=="edit" && isset($_COOKIE["userid"])){
+		#登录状态下 编辑模式
+		$_mode = "edit";
+		echo "_mode='edit';";
+		$classMode="edit_mode";
+	}
+	else{
+		$_mode = "read";
+		echo "_mode='read';";
+		$classMode="read_mode";
+	}
+	if(isset($_GET["display"])){
+		if($_mode == "edit"){
+			$_display = "sent";
+			echo "_display='sent';";	
+		}
+		else{
+			$_display = $_GET["display"];
+			echo "_display='".$_GET["display"]."';";	
+		}
+	}
+	else{
+		if($_mode=="read"){
+			$_display = "para";
+			echo "_display='para';";
+		}
+		else{
+			$_display = "sent";
+			echo "_display='sent';";			
+		}
+
+	}	
+	if(isset($_GET["direction"])){
+		$_direction = $_GET["direction"];
+		echo "_direction='".$_GET["direction"]."';";
+	}
+	else{
+		if($_mode=="read"){
+			$_direction = "row";
+			echo "_direction='row';";
+		}
+		else{
+			$_direction = "col";
+			echo "_direction='col';";
+		}
+	}
+	$contentClass= "";
+	if($_direction=="row"){
+		$contentClass .= ' horizontal ';
+	}
+	else{
+		$contentClass .= ' vertical ';
+	}
+	if($_display=="para"){
+		$contentClass .= ' para_mode ';
+	}
+	else{
+		$contentClass .= ' sent_mode ';
+	}
+	$contentClass .= " $_mode ";
+	
+	?>
+	</script>
+
+
+<link type="text/css" rel="stylesheet" href="style.css"  />
+
+<script src="../article/my_collect.js" type="text/javascript"></script>
+
+<script src="../../node_modules/mustache/mustache.js"></script>
+
+<style>
+ul.fancytree-container{
+	border:unset;
+	width: max-content;
+}
+.fancytree-container .active {
+    font-weight: 700;
+    color: var(--main-color);
+	background: linear-gradient(to right, var(--link-color), var(--nocolor));
+    border-radius: 5px;
+}
+span.fancytree-title{
+	color: var(--main-color1);
+}
+span.fancytree-node{
+	display: flex;
+}
+
+
+#content_toc>ul>li>span.fancytree-node{
+	font-size: 120%;
+    font-weight: 900;
+}
+#article_path chapter{
+	display:unset;
+}
+
+#contents ul, li {
+    margin-block-start: 0.5em;
+    margin-block-end: 0.5em;
+    margin-left: 7px;
+}
+.click_dropdown_div{
+	align-self: center;
+}
+.channel_select_button{
+	color: var(--link-color);
+	
+}
+.channel_select_button:hover{
+	text-decoration-line: underline;
+	
+}
+.sent_tran_div a{
+	white-space: normal;
+	overflow-wrap: anywhere;
+}
+.para_tran_div a{
+	white-space: normal;
+	overflow-wrap: anywhere;
+}
+
+</style>
+
+
+
+<div id="main_view" class="main_view <?php echo $classMode;?>">
+
+</div>
+
+
+
+<script>
+
+$(document).ready(function(){
+	note_create();
+	historay_init();
+    collection_load(_collection_id);
+});
+
+</script>
+
+</body>
+</html>

+ 0 - 0
public/app/article/templiates/footnote.tpl


+ 15 - 18
public/app/article/templiates/main.tpl

@@ -1,22 +1,19 @@
-<div>
-{{title}}
-</div>
-<div>
-{{subtitle}}
-</div>
-<div>
-{{editor.name}} at {{updated_at}}
-</div>
-<div class="content">
-{{content}}
+<div class="article">
+    {{#article}}
+        <div class="title heading{{article.level}}">{{article.title}}</div>
+        <div class="subtitle">{{article.subtitle}}</div>
+        <div class="editor">
+        {{article.editor.name}} at {{article.updated_at}}
+        </div>
+        <content>{{article.content}}</content>
+    {{/article}}
 </div>
 
 <h2>Glossary</h2>
-{{#glossary}}
-<b>{{pali}}</b>:{{meaning}}
-{{/glossary}}
+<glossary></glossary>
+
+<h2>reference</h2>
+<reference></reference>
 
-<h2>ref</h2>
-{{#ref}}
-{{path}}
-{{/ref}}
+<h2>footnote</h2>
+<footnote></footnote>

+ 0 - 0
public/app/article/templiates/reference.tpl


+ 0 - 0
public/app/article/templiates/term.tpl


+ 1 - 1
public/app/studio/project.php

@@ -232,7 +232,7 @@ switch ($op) {
 											$strXml, 
 											mTime(), 
 											mTime(), 
-											$channelInfo["status"], 
+											0, 
 											$_COOKIE['userid'],
 											$_COOKIE['uid']
 										);

+ 20 - 18
public/app/term/channal_list.php

@@ -166,24 +166,26 @@ foreach ($channal as $key => $value) {
         $arr_sent_final[] = $sent_final;
     }
     $channalInfo = $_channal->getChannal($key);
-	
-    $name = $_userinfo->getName($channalInfo["owner_uid"]);
-    $channalInfo["username"] = $name["username"];
-    $channalInfo["nickname"] = $name["nickname"];
-    $channalInfo["count"] = $value;
-    $channalInfo["all"] = count($_data);
-    $channalInfo["final"] = $arr_sent_final;
-	$channalInfo["article_len"] = $article_len;
-	$channalInfo["id"] = $key;
-	$channalInfo["owner"] = $channalInfo["owner_uid"];
-
-	if(isset($channel_power[$key])){
-		$channalInfo["power"] =$channel_power[$key];
-	}
-	else{
-		$channalInfo["power"] =10;
-	}
-    $output[] = $channalInfo;
+	if($channalInfo){
+        $name = $_userinfo->getName($channalInfo["owner_uid"]);
+        $channalInfo["username"] = $name["username"];
+        $channalInfo["nickname"] = $name["nickname"];
+        $channalInfo["count"] = $value;
+        $channalInfo["all"] = count($_data);
+        $channalInfo["final"] = $arr_sent_final;
+        $channalInfo["article_len"] = $article_len;
+        $channalInfo["id"] = $key;
+        $channalInfo["owner"] = $channalInfo["owner_uid"];
+
+        if(isset($channel_power[$key])){
+            $channalInfo["power"] =$channel_power[$key];
+        }
+        else{
+            $channalInfo["power"] =10;
+        }
+        $output[] = $channalInfo;        
+    }
+
 }
 
 $time = microtime(true);

+ 1 - 1
public/app/uwbw/create_wbw.php

@@ -201,7 +201,7 @@ foreach ($_para as $key => $para) {
 				$strXml,
 				mTime(),
 				mTime(),
-				$channelInfo["status"],
+				0,
 				$_COOKIE["userid"],
 				$_COOKIE["uid"]
 			);

+ 4 - 3
public/app/uwbw/update.js

@@ -7,7 +7,7 @@ function user_wbw_push_word_element(xWord) {
 	let wId = wordid.split("-")[2];
 	let mWord = doc_word("#" + wordid);
 	let blockid = mWord.block.info("id");
-	user_wbw_push(blockid, wId, com_xmlToString(xWord));
+	user_wbw_push(blockid, wId, com_xmlToString(xWord),getNodeText(xWord,'status'));
 }
 
 function user_wbw_push_word(wordid) {
@@ -34,11 +34,11 @@ function user_wbw_push_word(wordid) {
 			}
 			wordData += com_xmlToString(xAllWord[i]);
 		}
-		user_wbw_push(blockid, wId, wordData);
+		user_wbw_push(blockid, wId, wordData,getNodeText(xAllWord[i],'status'));
 	}
 }
 
-function user_wbw_push(block_id, wid, data) {
+function user_wbw_push(block_id, wid, data,status=7) {
 	let d = new Date();
 	let objData = new Object();
 	objData.block_id = block_id;
@@ -47,6 +47,7 @@ function user_wbw_push(block_id, wid, data) {
 	objData.time = d.getTime();
 	objData.book = doc_block("#" + block_id).info("book");
 	objData.para = doc_block("#" + block_id).info("paragraph");
+	objData.status = status;
 	user_wbw_data_buffer.push(objData);
 }
 var commitTimes = 0;

+ 7 - 2
public/app/uwbw/update.php

@@ -48,12 +48,17 @@ if (count($aData) > 0) {
 
     /* 开始一个事务,关闭自动提交 */
     $PDO->beginTransaction();
-    $query = "UPDATE "._TABLE_USER_WBW_." SET data= ?  , editor_id = ? , modify_time= ? , updated_at = now()  where block_uid= ?  and wid= ?  ";
+    $query = "UPDATE "._TABLE_USER_WBW_." SET data= ?  , editor_id = ? , status = ?, modify_time= ? , updated_at = now()  where block_uid= ?  and wid= ?  ";
     $sth = $PDO->prepare($query);
 
     foreach ($aData as $data) {
 		if($listBlockId[$data->block_id]>=20){
-			$sth->execute(array($data->data, $_COOKIE['uid'], mTime(), $data->block_id, $data->word_id));
+            if(!isset($data->status) || empty($data->status)){
+                $status = 7;
+            }else{
+                $status = (int)$data->status;
+            }
+			$sth->execute(array($data->data, $_COOKIE['uid'], $status , mTime(), $data->block_id, $data->word_id));
 		}
     }
     $PDO->commit();

+ 1 - 1
v1/scripts/install4.sh

@@ -3,7 +3,7 @@
 date
 
 php ./migrations/20220205084100_group_info_copy.php
-php ./migrations/20220205092400_group_member.php
+php ./migrations/20220205092400_group_member_copy.php
 
 php ./migrations/20220206143600_fileindex_copy.php
 date