瀏覽代碼

最新文章列表改为 显示最新的文章,而不是文集

visuddhinanda 5 年之前
父節點
當前提交
6698828cb1

+ 1 - 1
.gitignore

@@ -1,4 +1,4 @@
 /tmp
 /.vscode
 .DS_Store
-.vscode/settings.json
+/.debug

+ 1 - 1
.vscode/settings.json

@@ -2,7 +2,7 @@
 	"files.autoSave": "onFocusChange",
 	"workbench.iconTheme": "material-icon-theme",
 	"workbench.colorTheme": "Visual Studio Dark",
-	"editor.fontFamily": "SauceCodePro Nerd Font",
+	/*"editor.fontFamily": "SauceCodePro Nerd Font",*/
 	"editor.mouseWheelZoom": true,
 	"editor.codeActionsOnSave": {
 		"source.fixAll.eslint": true

+ 7 - 6
app/article/list.php

@@ -1,17 +1,15 @@
 <?php
-//查询term字典
+//文章列表
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../ucenter/function.php';
-
-
+PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
 if(isset($_GET["userid"])){
-    PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
     $userid=$_GET["userid"];
-    $query = "SELECT * from article  where owner = ".$PDO->quote($userid)." and status <> 0 order by modify_time DESC";
-    $Fetch = PDO_FetchAll($query);
+    $query = "SELECT * from article  where owner = ? and status <> 0 order by modify_time DESC";
+    $Fetch = PDO_FetchAll($query,array($userid));
     if($Fetch){
         /*
         $userinfo = new UserInfo();
@@ -22,6 +20,9 @@ if(isset($_GET["userid"])){
         exit;
     }
 }
+else{
+
+}
 
 echo json_encode(array(), JSON_UNESCAPED_UNICODE);	
 

+ 63 - 26
app/article/list_new.php

@@ -1,35 +1,72 @@
 <?php
-//
+//文集列表
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
-require_once '../public/load_lang.php';
+require_once '../public/function.php';
 require_once '../ucenter/function.php';
+require_once '../collect/function.php';
 
-global $PDO;
-PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
-$query = "select * from article where 1  order by create_time DESC limit 0,4";
-$Fetch = PDO_FetchAll($query);
 
-foreach($Fetch as $row){
-    echo '<div class="content_block">';
-    echo '<div class="card">';
-
-    echo '<div class="pd-10">';
-    echo '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../article/?id='.$row["id"].'&display=para">'.$row["title"].'</a></div>';
-    echo '<div class="summary"  style="padding-bottom:5px;color: #ad4b00;">'.$row["subtitle"].'</div>';
-    echo '<div class="author"  style="padding-bottom:5px;margin-bottom:0.4em;">';
-    echo '<a href="../uhome/course.php?userid='.$row['owner'].'">';
-    echo ucenter_getA($row["owner"]);
-    echo '</a>';
-    echo '</div>';    
-    echo '<div class="summary"  style="padding-bottom:5px;height: 4.5em;line-height: 1.5em;overflow-y: hidden;">'.$row["summary"].'</div>';
-    echo '</div>';
-    echo '<div class="pd-10" style="display:flex;justify-content: space-between;">';
-    echo '</div>';
+    $onepage = 40;
+    if(isset($_GET["page"])){
+        $onepage = (int)$_GET["page"];
+    }
+    if(isset($_GET["begin"])){
+        if($_GET["begin"]>=0){
+            $begin=(int)$_GET["begin"];
+        }
+        else{
+            echo json_encode(array("data"=>array(),"next"=>-1), JSON_UNESCAPED_UNICODE);
+            exit;
+        }
+    }
+    else{
+        $begin = 0;
+    }
+    PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
+    $query = "SELECT id,title,subtitle,summary,owner,modify_time from article  where status <> 0 ";
     
-    echo '</div>';
-    echo '</div>';
-}
+    if(isset($_GET["orderby"])){
+        switch ($_GET["orderby"]) {
+            case 'like':
+                # code...
+                $query .="ORDER BY  DESC";
+                break;
+            
+            default:
+                # code...
+                break;
+        }
+    }
+    else{
+        $query .="ORDER BY modify_time DESC";
+    }
+    $query .=" LIMIT $begin , $onepage ";
+    $Fetch = PDO_FetchAll($query);
+    $collect_info = new CollectInfo();
+    foreach ($Fetch as $key => $value) {
+        # code...
+        $userinfo = new UserInfo();
+        $user = $userinfo->getName($value["owner"]);
+        $Fetch[$key]["username"] = $user;
+        $query = "SELECT collect_id from article_list  where article_id = ? ";
+        $collect = PDO_FetchRow($query,array($Fetch[$key]["id"]));
+        if($collect){
+            $Fetch[$key]["collect"] = $collect_info->get($collect["collect_id"]);
+        }
+        else{
+            $Fetch[$key]["collect"] =FALSE;
+        }
+    }
+
+    $output = array();
+    $output["data"] =  $Fetch;
+    if(count($Fetch)==$onepage){
+        $output["next"] =  $begin+$onepage;
+    }
+    else{
+        $output["next"] = -1;
+    }
 
-?>
+    echo json_encode($output, JSON_UNESCAPED_UNICODE);

+ 10 - 0
app/article/video.php

@@ -0,0 +1,10 @@
+<html>
+
+<frameset cols="70%,30%">
+
+<frame src="./index.php?<?php echo $_SERVER['QUERY_STRING'];?>">
+<frame src="./webcam.html" name="webcam">
+
+</frameset>
+
+</html>

+ 28 - 0
app/article/webcam.html

@@ -0,0 +1,28 @@
+<html>
+<head>
+</head>
+<body>
+<video id = "video" style='width:100%'></video>
+<script>
+    function full(){
+
+    }
+// 想要获取一个最接近 1280x720 的相机分辨率
+var constraints = { audio: false, video: { width: 320, height: 240 } }; 
+
+navigator.mediaDevices.getUserMedia(constraints)
+.then(function(mediaStream) {
+  var video = document.querySelector('video');
+  video.srcObject = mediaStream;
+  video.onloadedmetadata = function(e) {
+    video.play();
+  };
+})
+.catch(function(err) { console.log(err.name + ": " + err.message); }); // 总是在最后检查错误
+</script>
+<h2>转法轮经详解</h2>
+<h3>第三讲</h3>
+<div>U Kuntadana Sayadow</div>
+<div>2020年12月3日</div>
+</body>
+</html>

+ 42 - 0
app/collect/function.php

@@ -0,0 +1,42 @@
+<?php
+require_once '../path.php';
+
+class CollectInfo
+{
+    private $dbh;
+    private $buffer;
+    public function __construct() {
+        $dns = "sqlite:"._FILE_DB_USER_ARTICLE_;
+        $this->dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
+        $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
+        $buffer = array();
+    }
+
+    public function get($id){
+        if(empty($id)){
+            return array("title"=>"","id"=>"");
+        }
+        if(isset($buffer[$id])){
+            return $buffer[$id];
+        }
+        if($this->dbh){
+            $query = "SELECT id,title FROM collect WHERE id= ? limit 0,10";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($id));
+			$collect = $stmt->fetch(PDO::FETCH_ASSOC);
+            if($collect){
+                $buffer[$id] = $collect;
+                return $buffer[$id];
+            }
+            else{
+                $buffer[$id] =false;
+                return $buffer[$id];
+            }            
+        }
+        else{
+            $buffer[$id] = false;
+            return $buffer[$id];
+        }
+    }
+}
+?>

+ 14 - 14
app/collect/list.php

@@ -1,5 +1,5 @@
 <?php
-//查询term字典
+//文集列表
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
@@ -7,22 +7,22 @@ require_once '../public/function.php';
 require_once '../ucenter/function.php';
 
 
-$onepage = 40;
-if(isset($_GET["page"])){
-    $onepage = $_GET["page"];
-}
-if(isset($_GET["begin"])){
-    if($_GET["begin"]>=0){
-        $begin=$_GET["begin"];
+    $onepage = 40;
+    if(isset($_GET["page"])){
+        $onepage = $_GET["page"];
+    }
+    if(isset($_GET["begin"])){
+        if($_GET["begin"]>=0){
+            $begin=$_GET["begin"];
+        }
+        else{
+            echo json_encode(array("data"=>array(),"next"=>-1), JSON_UNESCAPED_UNICODE);
+            exit;
+        }
     }
     else{
-        echo json_encode(array("data"=>array(),"next"=>-1), JSON_UNESCAPED_UNICODE);
-        exit;
+        $begin = 0;
     }
-}
-else{
-    $begin = 0;
-}
     PDO_Connect("sqlite:"._FILE_DB_USER_ARTICLE_);
     $query = "SELECT * FROM collect  where  1 ";
     if(isset($_GET["orderby"])){

+ 12 - 25
app/pcdl/index.js

@@ -6,7 +6,7 @@ function index_onload() {
 
 function index_load_collect_new() {
   $.get(
-    "../collect/list.php",
+    "../article/list_new.php",
     {
       begin: 0,
       page: 4,
@@ -20,17 +20,25 @@ function index_load_collect_new() {
         html +=
           "<div class='' style='position: absolute;background-color: darkred;color: white;padding: 0 6px;right: 0;'>" + gLocal.gui.ongoing + "</div>";
         html += "</div>";
-        html += "<div class='card' style='padding:10px;'>";
+        html += "<div class='card article_list' style='padding:10px;'>";
           gLocal.gui.ongoing + "</div>";
-        html += "<div style='font-weight:700'>";
+        html += "<div class='title' style='font-weight:700'>";
         html +=
-          "<a href='../article/?collect=" +
+          "<a href='../article/?id=" +
           iterator.id +
           "'>" +
           iterator.title +
           "</a>";
         html += "</div>";
 
+        html += "<div class='collect' style='color:gray'>";
+        if(iterator.collect){
+          html += "<a href='../article/?collect=" +iterator.collect.id + "'>" + iterator.collect.title + "</a>";
+        }
+        else{
+          html += "unkow";
+        }
+        html += "</div>";
         if(iterator.subtitle){
           html += "<div style=''>" + iterator.subtitle + "</div>";
         }
@@ -41,27 +49,6 @@ function index_load_collect_new() {
           html += "<div style=''>" + iterator.summary + "</div>";
         }
         
-        if( iterator.tag){
-          html +="<div style='overflow-wrap: anywhere;'>" + iterator.tag + "</div>";
-        }
-        
-        const article_limit = 4;
-        let article_count = 0;
-        let article_list = JSON.parse(iterator.article_list);
-        for (const article of article_list) {
-          html += "<div>";
-          html +=
-            "<a href='../article/?id=" +
-            article.article +
-            "' target='_blank'>" +
-            article.title +
-            "</a>";
-          html += "</div>";
-          article_count++;
-          if (article_count > article_limit) {
-            break;
-          }
-        }
         html += "</div>";
         html += "</div>";
       }

+ 24 - 5
app/search/paliword.php

@@ -141,11 +141,30 @@ include "../pcdl/html_head.php";
 <div id="contents_view">
 	<div id="contents_div" style="padding: 0 1em 0 30px;">
 		<div id="contents" >
-		<div style="text-align: center;">
-			<svg class='icon_spin' style='fill: saddlebrown; '>
-				<use xlink='http://www.w3.org/1999/xlink' href='../studio/svg/icon.svg#dhammacakkha'></use>
-			</svg>
-		</div>
+			<div id="index_list">
+				<div style="flex:3;margin:12px;">
+					<div class="card" style="padding:10px;">
+						<div>最近搜索</div>
+						<div id="title_histray"></div>
+					</div>
+				</div>
+				<div style="flex:3;margin:12px;">
+					<div class="card" style="padding:10px;">
+						<div>热搜</div>
+						<div id="title_hot"></div>
+					</div>
+				</div>
+				<div style="flex:3;margin:12px;">
+					<div class="card" style="padding:10px;">
+						<div id="guide_title_search_index"></div>
+					</div>
+				</div>
+			</div>
+			<div style="text-align: center;display:none;">
+				<svg class='icon_spin' style='fill: saddlebrown; '>
+					<use xlink='http://www.w3.org/1999/xlink' href='../studio/svg/icon.svg#dhammacakkha'></use>
+				</svg>
+			</div>
 		</div>
 		<div id="contents_foot">
 			<div id="contents_nav" style="">

+ 19 - 8
app/search/toobar.php

@@ -84,14 +84,25 @@
 				$key = "";
 			}
 			?>
-			<li id="dt_all" style="display:none;"><a href="../search/index.php<?php echo $key; ?>"><span><?php echo $_local->gui->all; //全部
-																										?></span><span id="search_all_num"></span></a></li>
-			<li id="dt_title"><a href="../search/title.php<?php echo $key; ?>"><span><?php echo $_local->gui->title; //标题
-																					?></span><span id="search_title_num"></span></a></li>
-			<li id="dt_pali"><a href="../search/paliword.php<?php echo $key; ?>"><span><?php echo $_local->gui->full_text; //巴利原文
-																						?></span><span id="search_palitext_num"></span></a></li>
-			<li id="dt_bold"><a href="../search/bold.php<?php echo $key; ?>"><span><?php echo $_local->gui->vannana; ?></span><span id="search_bold_num"></span></a></li>
-			<li id="dt_trans" style="display:none;"><a href="../search/trans.php<?php echo $key; ?>"><span><?php echo $_local->gui->translate; ?></span><span id="search_trans_num"></span></a></li>
+			<li id="dt_all" style="display:none;">
+				<a href="../search/index.php<?php echo $key; ?>">
+				<span><?php echo $_local->gui->all; /*全部*/?></span>
+				<span id="search_all_num"></span>
+				</a>
+			</li>
+			<li id="dt_pali">
+				<a href="../search/paliword.php<?php echo $key; ?>">
+				<span><?php echo $_local->gui->full_text; /*巴利原文*/?></span>
+				<span id="search_palitext_num"></span>
+				</a>
+			</li>
+			<li id="dt_title">
+				<a href="../search/title.php<?php echo $key; ?>">
+				<span><?php echo $_local->gui->title; //标题?></span>
+				<span id="search_title_num"></span>
+				</a>
+			</li>
+
 		</ul>
 	</div>
 </div>

+ 0 - 1
app/studio/dict_find_one.php

@@ -120,7 +120,6 @@ for($i=0;$i<$lookup_loop;$i++)
 		if($debug){
 			echo "dict connect:{$db_file["file"]}<br>";
 		}
-		//PDO_Connect("sqlite:".$db_file);
 		if($i==0){
 			$query = "select * from dict where \"pali\" in $strQueryWord ORDER BY rowid DESC";
 		}

+ 11 - 0
documents/development/bugs.csv

@@ -0,0 +1,11 @@
+提出日期,提交者,问题标题,模块,类别,紧急程度,责任人,完成情况,完成日期,详细描述details
+2020-12-24,kosalla,拆粘音词关系失效,拆粘音词,bug,4,visuddhinanda,false,,拆粘音词关系失效
+2020-12-24,kosalla,拆分之后集成拆分前的信息,拆粘音词,完善,4,visuddhinanda,false,,拆分之后集成拆分前的信息
+2020-12-24,kosalla,拆分之后集成拆分前的信息,拆粘音词,完善,4,visuddhinanda,false,,拆分之后集成拆分前的信息
+2020-12-24,kosalla,reader支持书签,拆粘音词,新增,4,visuddhinanda,false,,书签在reader中的显示,以帮助下次定位
+2020-12-24,kosalla,再次点击才生效,拆分意思,bug,4,kosalla,false,,再次点击才生效
+2020-12-24,kosalla,“-”连接自动总体意思,拆分意思,完善,4,kosalla,false,,自动合成意思可以用“-”链接
+2020-12-24,kosalla,黑体ti语法信息为空,studio/语法信息,完善,4,kosalla,false,,
+2020-12-24,kosalla,智能自动匹配,studio/自动匹配,新增,1,visuddhinanda,false,,总排名评分0-255;长度评分=含义长度/拼写长度;投诉评分削减
+2020-12-24,kosalla,title搜索字体放大,搜索,完善,1,pannabhinanda,false,,
+2020-12-24,kosalla,译文历史记录,studio,完善,1,visuddhinanda,false,,studio译文历史记录

+ 5 - 0
documents/pali_stepbystep/zh/1.md

@@ -0,0 +1,5 @@
+# 前置条件
+
+# 开始
+
+# 目标

+ 3 - 0
documents/pali_stepbystep/zh/10.md

@@ -0,0 +1,3 @@
+# 前置条件
+
+# 开始

+ 3 - 0
documents/pali_stepbystep/zh/100.md

@@ -0,0 +1,3 @@
+# 前置条件
+
+# 开始

+ 3 - 0
documents/pali_stepbystep/zh/1000.md

@@ -0,0 +1,3 @@
+# 前置条件
+
+# 开始

+ 3 - 0
documents/pali_stepbystep/zh/10000.md

@@ -0,0 +1,3 @@
+# 前置条件
+
+# 开始

+ 29 - 0
documents/pali_stepbystep/zh/readme.md

@@ -0,0 +1,29 @@
+# 关于这个学习方法
+2018年,我在龙树林僧院的时候。中国的澄了尊者(visuddha bhikkhu)告诉我他的学习巴利语的方法。我将他的经验与这个软件结合。编写了这个学习指南。澄了尊者告诉我:他借助双拐学习巴利语。一边是菩提长老的译文,另一边是玛欣德尊者的译文。所以,我将这个方法称为拐杖学习法。
+# 这个教程适合谁?
+- 想要深入学习经典但是面对浩瀚的三藏无从下手的人
+- 学习过巴利语,但是并不能应用所学看懂经文的人
+- 希望掌握真正的翻译技能的人
+
+# 为什么你没学会阅读巴利经文?
+请注意,我没有使用“巴利语”这个字眼,而是用了“阅读巴利经文”这个词。
+
+# 这个方法的核心
+
+# 五个阶段
+
+## 第一个小时
+
+## 10小时
+
+## 100小时
+
+## 1000小时
+
+## 10000小时
+
+## 泼冷水
+
+
+# 开始上路
+**注意**:请**不要**在没有指导老师的情况下使用这个教程。你应该花大量的时间在实践上,但是这并不意味着你不需要指导老师。在初期阶段,有经验的老师能够让你少走弯路。在进阶练习阶段,老师会解除你的疑问。你应该学会查资料并独立思考,但是要避免想当然的猜测。你应该请教,以及把你的探索跟你的老师讨论。老师也会帮助你选择适合你的语料。无论你处在哪一个阶段,请教你的老师都是必要的。