瀏覽代碼

显示时间段内的用户操作log

visuddhinanda 5 年之前
父節點
當前提交
85fbf582d0

+ 16 - 8
SUMMARY.md

@@ -1,9 +1,17 @@
-# wikipali文档
+# wikipali 文档
 
-* [关于](documents/about.md)
-* [日志](documents/dev_log.md)
-* [开发](documents/development/join_us.md)
-* [课程](documents/course/join_us.md)
-  * [课程通知模版](documents/course/课程通知.md)
-  * [重播replay](documents/course/课程历史链接.md)
-* [指南](documents/users_guide/readme.md)
+-   [关于我们](documents/about.md)
+-   [更新日志](documents/dev_log.md)
+-   [快速入门](documents/support/readme.md)
+-   [使用指南](documents/support/readme.md)
+
+    -   [工作室](documents/development/join_us.md)
+    -   [圣典列表](documents/development/join_us.md)
+    -   [课程](documents/development/join_us.md)
+    -   [文章文集](documents/development/join_us.md)
+    -   [字典](documents/development/join_us.md)
+    -   [其他工具](documents/development/join_us.md)
+
+-   [开发者](documents/development/join_us.md)
+-   [课程](documents/course/join_us.md)
+-   [指南](documents/users_guide/readme.md)

+ 4 - 0
app/article/collect_get.php

@@ -16,6 +16,10 @@ if(isset($_GET["id"])){
         $userinfo = new UserInfo();
         $user = $userinfo->getName($Fetch["owner"]);
         $Fetch["username"] = $user;
+        #查询文集中文档列表
+        $query = "select level,article_id as article,title from article_list  where collect_id = ? ";
+        $fArticle_list = PDO_FetchAll($query,array($id));    
+        $Fetch["article_list"] = json_encode($fArticle_list, JSON_UNESCAPED_UNICODE);
         echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
         exit;
     }

+ 45 - 35
app/article/index.php

@@ -213,45 +213,55 @@ require_once "../pcdl/html_head.php";
 	<div>
 		<span>
 		<?php
-		echo "<button class='icon_btn'  title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
-		echo "<a href='../article/my_article_edit.php?id=".$_GET["id"];
-		echo "' target='_blank'>{$_local->gui->modify}</a></button>";
-
-		echo "<button class='icon_btn'  title='{$_local->gui->add}{$_local->gui->subfield}'>";
-		echo "<a href='../article/frame.php?id=".$_GET["id"];
-		echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";
-
-		if(isset($_GET["display"]) && $_GET["display"]=="para"){
-			echo "<button class='icon_btn active' title='{$_local->gui->show} {$_local->gui->each_paragraph}'>";
-			echo $_local->gui->each_paragraph;
-			echo "</button>";
-		}
-		else{
-			echo "<button class='icon_btn'>";
-			echo "<a href='../article/?id=".$_GET["id"];
-			if(isset($_GET["channal"])){
-				echo "&channal=".$_GET["channal"];
+		
+		if(isset($_GET["id"])){
+			echo "<button class='icon_btn'  title='{$_local->gui->modify} {$_local->gui->composition_structure}'>";
+			echo "<a href='../article/my_article_edit.php?id=".$_GET["id"];
+			echo "' target='_blank'>{$_local->gui->modify}</a></button>";
+			
+			echo "<button class='icon_btn'  title='{$_local->gui->add}{$_local->gui->subfield}'>";
+			echo "<a href='../article/frame.php?id=".$_GET["id"];
+			echo "'>{$_local->gui->add}{$_local->gui->subfield}</a></button>";	
+			
+			
+			if(isset($_GET["display"]) && $_GET["display"]=="para"){
+				echo "<button class='icon_btn active' title='{$_local->gui->show} {$_local->gui->each_paragraph}'>";
+				echo $_local->gui->each_paragraph;
+				echo "</button>";
 			}
-			echo "&display=para'  title='{$_local->gui->show} {$_local->gui->each_paragraph}'>";		
-			echo $_local->gui->each_paragraph;
-			echo "</a>";
-			echo "</button>";
-		}
-
-		if(isset($_GET["display"]) && $_GET["display"]=="sent"){
-			echo "<button class='icon_btn active'  title='{$_local->gui->show} {$_local->gui->each_sentence}'>";
-			echo $_local->gui->each_sentence;
-			echo "</button>";
-		}
-		else{
-			echo "<button class='icon_btn'><a href='../article/?id=".$_GET["id"];
-			if(isset($_GET["channal"])){
-				echo "&channal=".$_GET["channal"];
+			else{
+				
+				echo "<button class='icon_btn'>";
+				echo "<a href='../article/?id=".$_GET["id"];
+				if(isset($_GET["channal"])){
+					echo "&channal=".$_GET["channal"];
+				}
+				echo "&display=para'  title='{$_local->gui->show} {$_local->gui->each_paragraph}'>";		
+				echo $_local->gui->each_paragraph;
+				echo "</a>";
+				echo "</button>";
+			}
+	
+			if(isset($_GET["display"]) && $_GET["display"]=="sent"){
+				echo "<button class='icon_btn active'  title='{$_local->gui->show} {$_local->gui->each_sentence}'>";
+				echo $_local->gui->each_sentence;
+				echo "</button>";
+			}
+			else{
+				echo "<button class='icon_btn'><a href='../article/?id=".$_GET["id"];
+				if(isset($_GET["channal"])){
+					echo "&channal=".$_GET["channal"];
+				}
+				echo "&display=sent";
+				echo "'  title='{$_local->gui->show} {$_local->gui->each_sentence}'>{$_local->gui->each_sentence}</a></button>";
 			}
-			echo "&display=sent";
-			echo "'  title='{$_local->gui->show} {$_local->gui->each_sentence}'>{$_local->gui->each_sentence}</a></button>";
 		}
 
+
+
+
+
+
 		
 		?>
 			<button class='icon_btn'><a href="#"><?php echo $_local->gui->help; ?></a></button>

+ 80 - 0
app/course/lesson.js

@@ -273,3 +273,83 @@ function render_lesson_list(course_id, currLesson) {
 		}
 	);
 }
+
+function lesson_get_timeline_settime(start, div) {
+	let lessonTime;
+	if (start) {
+		lessonTime = new Date(parseInt(start));
+	} else {
+		lessonTime = new Date();
+	}
+	let month = lessonTime.getMonth() + 1;
+	month = month > 9 ? month : "0" + month;
+	let d = lessonTime.getDate();
+	d = d > 9 ? d : "0" + d;
+	let data = lessonTime.getFullYear() + "-" + month + "-" + d;
+	let strData = "<input type='date'  id='" + div + "_date' value='" + data + "'/>";
+
+	let H = lessonTime.getHours();
+	H = H > 9 ? H : "0" + H;
+	let M = lessonTime.getMinutes();
+	M = M > 9 ? M : "0" + M;
+	let strTime = "<input type='time'  id='" + div + "_time' value='" + H + ":" + M + "'/>";
+
+	$("#form_" + div).html(strData + strTime);
+}
+
+function lesson_get_timeline_submit() {
+	let start_date = new Date();
+	let start_data = $("#start_date").val().split("-");
+	let start_time = $("#start_time").val().split(":");
+
+	start_date.setFullYear(start_data[0], parseInt(start_data[1]) - 1, start_data[2]);
+	start_date.setHours(start_time[0], start_time[1]);
+
+	let end_date = new Date();
+	let end_data = $("#end_date").val().split("-");
+	let end_time = $("#end_time").val().split(":");
+
+	end_date.setFullYear(end_data[0], parseInt(end_data[1]) - 1, end_data[2]);
+	end_date.setHours(end_time[0], end_time[1], 0, 0);
+
+	location.assign("../course/lesson_get_timeline.php?start=" + start_date.getTime() + "&end=" + end_date.getTime());
+}
+
+function lesson_get_timeline_json(start, end) {
+	$.get(
+		"../ucenter/active_log_get.php",
+		{
+			start: start,
+			end: end,
+		},
+		function (data) {
+			$("#timeline_json").val(data);
+			let json = JSON.parse(data);
+			let html = "<table>";
+			for (const row of json) {
+				html += "<tr>";
+				let start_date = new Date(parseInt(row.time));
+				html += "<td>" + start_date.getHours() + ":" + start_date.getMinutes() + "</td>";
+
+				html += "<td>" + gLocal.LogType[row.active] + "</td>";
+				html += "<td>";
+				switch (row.active) {
+					case "30":
+						html += "<a href='../dict/?word=" + row.content + "' target='_blank'>" + row.content + "</a>";
+						break;
+					case "11":
+						break;
+					case "20":
+						break;
+					default:
+						html += row.content;
+						break;
+				}
+				html += "</td>";
+				html += "</tr>";
+			}
+			html += "</table>";
+			$("#timeline_table").html(html);
+		}
+	);
+}

+ 56 - 0
app/course/lesson_get_timeline.php

@@ -0,0 +1,56 @@
+<?PHP
+    include "../pcdl/html_head.php";
+?>
+<body>
+<script src="../course/lesson.js"></script>
+
+<div>
+开始时间:
+<div id="form_start" >
+
+</div>
+</div>
+<div>
+结束时间:
+<div id="form_end">
+
+</div>
+</div>
+<button onclick="lesson_get_timeline_submit()">submit</button>
+
+
+<div id="timeline_table">
+</div>
+
+<div >
+<textarea id="timeline_json">
+</textarea>
+</div>
+
+<script>
+
+<?php  
+if(isset($_GET["start"])){
+	$start=$_GET["start"];
+}
+else{
+	$start=false;
+}
+if(isset($_GET["end"])){
+	$end=$_GET["end"];
+}
+else{
+	$end=false;
+}
+
+echo "lesson_get_timeline_settime('{$start}','start');\n";
+echo "lesson_get_timeline_settime('{$end}','end');\n";
+if($start && $end){
+	echo "lesson_get_timeline_json('{$start}','{$end}')";
+}
+?>
+</script>
+
+<?php
+include "../pcdl/html_foot.php";
+?>

+ 74 - 0
app/course/时间线模版.md

@@ -0,0 +1,74 @@
+### 2021-2-8 08:00:23
+
+
+
+### 2021-2-8 09:00:23
+{{23-45-67-89}}
+
+### 2021-2-8 09:00:23
+{{23-45-89-95}}
+
+### 2021-2-8 08:00:23
+打开{{23-45-89-95}}
+
+### 2021-2-8 09:00:23
+查字典: word1  word2 
+
+### 2021-2-8 09:00:23
+逐词译: word1  word2 
+
+### 2021-2-8 08:00:23
+译文{{23-45-89-95}}
+
+### 2021-2-8 08:00:23
+译文{{23-45-89-95}}
+
+
+### 2021-2-8 09:00:23
+{{23-45-67-89}}
+
+### 2021-2-8 08:00:23
+
+
+
+## article
+[dhammacakka](https://www.wikipali.org/article)
+
+片段开始
+
+pali sentence
+translation
+09:00:23 relation map1
+
+
+pali sentence
+translation
+
+pali sentence
+translation
+
+pali sentence
+translation
+09:00:23 relation map1
+
+片段结束
+
+
+## others
+### extension
+https://www.wikipali.org/reader
+
+### keyword
+https://www.wikipali.org/search/word=word1
+
+### vocabulary:
+- [word1](link?word=word1)
+- [word1](link?word=word1)
+- [word1](link?word=word1)
+- [word1](link?word=word1)
+- [word1](link?word=word1)
+- [word1](link?word=word1)
+
+### term
+- [word1](link?word=word1)
+- [word1](link?word=word1)

+ 22 - 0
app/public/lang/default.json

@@ -1979,5 +1979,27 @@
 		"zh": "cīna",
 		"zh_cn": "Simple cīna",
 		"zh_tw": "Traditional cīna"
+	},
+
+	"LogType": {
+		"10": "edit channel",
+		"11": "new channel",
+		"20": "edit article",
+		"21": "new article",
+		"30": "lookup",
+		"40": "edit term",
+		"41": "lookup term",
+		"42": "_TERM_IN_SENT_",
+		"50": "search",
+		"60": "edit wbw",
+		"61": "realation map",
+		"62": "new wbw",
+		"70": "edit sentence",
+		"71": "new sentence",
+		"80": "edit collection",
+		"81": "new collection",
+		"90": "search nissaya",
+		"100": "open reader",
+		"101": "open studio"
 	}
 }

+ 21 - 0
app/public/lang/en.json

@@ -2162,5 +2162,26 @@
 		"zh": "Chinese",
 		"zh_cn": "Simple Chinese",
 		"zh_tw": "Traditional Chinese"
+	},
+	"LogType": {
+		"10": "edit channel",
+		"11": "new channel",
+		"20": "edit article",
+		"21": "new article",
+		"30": "lookup",
+		"40": "edit term",
+		"41": "lookup term",
+		"42": "_TERM_IN_SENT_",
+		"50": "search",
+		"60": "edit wbw",
+		"61": "realation map",
+		"62": "new wbw",
+		"70": "edit sentence",
+		"71": "new sentence",
+		"80": "edit collection",
+		"81": "new collection",
+		"90": "search nissaya",
+		"100": "open reader",
+		"101": "open studio"
 	}
 }

+ 21 - 0
app/public/lang/my.json

@@ -1971,5 +1971,26 @@
 		"zh": "စီနဘာသ",
 		"zh_cn": "Simple စီနဘာသ",
 		"zh_tw": "Traditional စီနဘာသ"
+	},
+	"LogType": {
+		"10": "edit channel",
+		"11": "new channel",
+		"20": "edit article",
+		"21": "new article",
+		"30": "lookup",
+		"40": "edit term",
+		"41": "lookup term",
+		"42": "_TERM_IN_SENT_",
+		"50": "search",
+		"60": "edit wbw",
+		"61": "realation map",
+		"62": "new wbw",
+		"70": "edit sentence",
+		"71": "new sentence",
+		"80": "edit collection",
+		"81": "new collection",
+		"90": "search nissaya",
+		"100": "open reader",
+		"101": "open studio"
 	}
 }

+ 21 - 0
app/public/lang/si.json

@@ -1864,5 +1864,26 @@
 		"zh": "චීන",
 		"zh_cn": "Simple චීන",
 		"zh_tw": "Traditional චීන"
+	},
+	"LogType": {
+		"10": "edit channel",
+		"11": "new channel",
+		"20": "edit article",
+		"21": "new article",
+		"30": "lookup",
+		"40": "edit term",
+		"41": "lookup term",
+		"42": "_TERM_IN_SENT_",
+		"50": "search",
+		"60": "edit wbw",
+		"61": "realation map",
+		"62": "new wbw",
+		"70": "edit sentence",
+		"71": "new sentence",
+		"80": "edit collection",
+		"81": "new collection",
+		"90": "search nissaya",
+		"100": "open reader",
+		"101": "open studio"
 	}
 }

+ 21 - 0
app/public/lang/zh-cn.json

@@ -2150,5 +2150,26 @@
 		"zh": "中文",
 		"zh_cn": "简体中文",
 		"zh_tw": "正体中文"
+	},
+	"LogType": {
+		"10": "修改版本风格",
+		"11": "新建版本风格",
+		"20": "修改文章",
+		"21": "新建文章",
+		"30": "查字典",
+		"40": "修改百科",
+		"41": "查询百科",
+		"42": "_TERM_IN_SENT_",
+		"50": "搜索",
+		"60": "修改逐词解析",
+		"61": "关系图",
+		"62": "新建逐词解析",
+		"70": "修改句子",
+		"71": "新建句子",
+		"80": "修改文集",
+		"81": "新建文集",
+		"90": "搜索nissaya",
+		"100": "打开阅读器",
+		"101": "打开工作室"
 	}
 }

+ 21 - 0
app/public/lang/zh-tw.json

@@ -2144,5 +2144,26 @@
 		"zh": "中文",
 		"zh_cn": "簡體中文",
 		"zh_tw": "正體中文"
+	},
+	"LogType": {
+		"10": "修改版本风格",
+		"11": "新建版本风格",
+		"20": "修改文章",
+		"21": "新建文章",
+		"30": "查字典",
+		"40": "修改百科",
+		"41": "查询百科",
+		"42": "_TERM_IN_SENT_",
+		"50": "搜索",
+		"60": "修改逐词解析",
+		"61": "关系图",
+		"62": "新建逐词解析",
+		"70": "修改句子",
+		"71": "新建句子",
+		"80": "修改文集",
+		"81": "新建文集",
+		"90": "搜索nissaya",
+		"100": "打开阅读器",
+		"101": "打开工作室"
 	}
 }

+ 6 - 1
app/public/php/define.php

@@ -14,12 +14,17 @@ define("_ARTICLE_NEW_",21);
 define("_DICT_LOOKUP_",30);
 define("_TERM_EDIT_",40);
 define("_TERM_LOOKUP_",41);
+define("_TERM_IN_SENT_",42);
+define("_SEARCH_",50);
 define("_WBW_EDIT_",60);
+define("_WBW_RELATION_",61);
+define("_WBW_NEW_",62);
 define("_SENT_EDIT_",70);
 define("_SENT_NEW_",71);
 define("_COLLECTION_EDIT_",80);
 define("_COLLECTION_NEW_",81);
 define("_NISSAYA_FIND_",90);
-
+define("_OPEN_READER_",100);
+define("_OPEN_STUDIO_",101);
 
 ?>

+ 19 - 0
app/ucenter/active_log_get.php

@@ -0,0 +1,19 @@
+<?php 
+//显示log
+require_once '../path.php';
+
+if(isset($_COOKIE["uid"]) && isset($_GET["start"]) && isset($_GET["end"])){
+	
+	$dns = "sqlite:"._FILE_DB_USER_ACTIVE_LOG_;
+	$dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
+	$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+	$query = "SELECT time , active,content,timezone  FROM log WHERE user_id = ? AND (time BETWEEN ? AND ?) ";
+	$stmt = $dbh->prepare($query);
+	$stmt->execute(array($_COOKIE["uid"],$_GET["start"],$_GET["end"]));
+	$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
+	echo json_encode($row, JSON_UNESCAPED_UNICODE);
+}
+else{
+	echo json_encode(array(), JSON_UNESCAPED_UNICODE);
+}
+?>

+ 1 - 0
app/ucenter/active_list.php → app/ucenter/active_log_list.php

@@ -7,6 +7,7 @@ require_once "../public/function.php";
 require_once "../public/php/define.php";
 
 if(isset($_COOKIE["uid"])){
+	
 	$active_type[10] = "_CHANNEL_EDIT_";
 	$active_type[11] = "_CHANNEL_NEW_";
 	$active_type[20] = "_ARTICLE_EDIT_";

+ 21 - 0
app/ucenter/log_type.js

@@ -0,0 +1,21 @@
+var gLogType = {
+	10: "edit channel",
+	11: "new channel",
+	20: "edit article",
+	21: "new article",
+	30: "lookup",
+	40: "edit term",
+	41: "lookup term",
+	42: "_TERM_IN_SENT_",
+	50: "search",
+	60: "edit wbw",
+	61: "realation map",
+	62: "new wbw",
+	70: "edit sentence",
+	71: "new sentence",
+	80: "edit collection",
+	81: "new collection",
+	90: "search nissaya",
+	100: "open reader",
+	101: "open studio",
+};

+ 21 - 0
book.json

@@ -0,0 +1,21 @@
+{
+	"title": "wikipali手册",
+	"description": "wikipali手册",
+	"structure": {
+		"glossory": "glossory.md",
+		"langs": "langs.md"
+	},
+	"introduction": {
+		"path": "readme.md",
+		"title": "wikipali手册"
+	},
+	"styles": {
+		"website": "styles/website.css",
+		"ebook": "styles/ebook.css",
+		"pdf": "styles/pdf.css",
+		"mobi": "styles/mobi.css",
+		"epub": "styles/epub.css"
+	},
+	"plugins": ["mermaid-gb3"],
+	"language": "zh-hans"
+}

+ 1 - 0
documents/en/readme.md

@@ -0,0 +1 @@
+# welcome to wikipali

+ 0 - 0
documents/en/summary.md


+ 1 - 0
documents/zh/readme.md

@@ -0,0 +1 @@
+# 欢迎来到 wikipali

+ 0 - 0
documents/zh/summary.md


+ 2 - 0
langs.md

@@ -0,0 +1,2 @@
+-   [English](en/)
+-   [中文](zh/)