Просмотр исходного кода

Merge pull request #43 from visuddhinanda/master

install 检查用户是否登陆
visuddhinanda 5 лет назад
Родитель
Сommit
acecce97d9
43 измененных файлов с 185 добавлено и 48 удалено
  1. 2 0
      app/install/analysis.php
  2. 3 0
      app/install/combin_all_word_by_book.php
  3. 3 0
      app/install/combin_union.php
  4. 4 1
      app/install/count.php
  5. 4 1
      app/install/db_collact_para_bookid.php
  6. 4 1
      app/install/db_create.php
  7. 3 0
      app/install/db_insert_bold.php
  8. 3 0
      app/install/db_insert_bookword_from_csv.php
  9. 4 1
      app/install/db_insert_commantry.php
  10. 3 0
      app/install/db_insert_index.php
  11. 2 2
      app/install/db_insert_index_csv.php
  12. 1 1
      app/install/db_insert_index_once.php
  13. 4 1
      app/install/db_insert_palitext.php
  14. 3 0
      app/install/db_insert_sentence.php
  15. 1 0
      app/install/db_insert_templet.php
  16. 4 1
      app/install/db_insert_toc.php
  17. 4 1
      app/install/db_insert_word_from_csv.php
  18. 5 2
      app/install/db_insert_wordindex_from_csv.php
  19. 1 1
      app/install/db_pali_text_export.php
  20. 1 1
      app/install/db_update_palitext.php
  21. 1 8
      app/install/db_update_toc.php
  22. 0 11
      app/install/guid.php
  23. 1 1
      app/install/index.php
  24. 38 0
      app/install/install_head.php
  25. 1 1
      app/install/step1.php
  26. 1 1
      app/install/step2.php
  27. 1 0
      app/install/step3.php
  28. 1 1
      app/install/step4.php
  29. 1 1
      app/install/step5.php
  30. 1 1
      app/install/xmlmaker.php
  31. 8 0
      documents/users_guide/zh-cn/grammar_abl.md
  32. 8 0
      documents/users_guide/zh-cn/grammar_acc.md
  33. 7 0
      documents/users_guide/zh-cn/grammar_dat.md
  34. 4 0
      documents/users_guide/zh-cn/grammar_f.md
  35. 7 0
      documents/users_guide/zh-cn/grammar_gen.md
  36. 7 0
      documents/users_guide/zh-cn/grammar_inst.md
  37. 7 0
      documents/users_guide/zh-cn/grammar_loc.md
  38. 4 5
      documents/users_guide/zh-cn/grammar_m.md
  39. 8 4
      documents/users_guide/zh-cn/grammar_nom.md
  40. 3 0
      documents/users_guide/zh-cn/grammar_nt.md
  41. 6 0
      documents/users_guide/zh-cn/grammar_pl.md
  42. 6 0
      documents/users_guide/zh-cn/grammar_sg.md
  43. 5 0
      documents/users_guide/zh-cn/grammar_voc.md

+ 2 - 0
app/install/analysis.php

@@ -1,4 +1,6 @@
 <?php
+require_once "install_head.php";
+
 $filelist=array();
 $fileNums=0;
 if(($handle=fopen("filelist.csv",'r'))!==FALSE){

+ 3 - 0
app/install/combin_all_word_by_book.php

@@ -1,3 +1,6 @@
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>

+ 3 - 0
app/install/combin_union.php

@@ -1,3 +1,6 @@
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>

+ 4 - 1
app/install/count.php

@@ -1,4 +1,7 @@
-<!DOCTYPE html>
+<?php
+require_once "install_head.php";
+?>
+<!DOCTYPE html>
 <html>
 <head>
 </head>

+ 4 - 1
app/install/db_collact_para_bookid.php

@@ -1,4 +1,7 @@
-<!DOCTYPE html>
+<?php
+require_once "install_head.php";
+?>
+<!DOCTYPE html>
 <html>
 <head>
 </head>

+ 4 - 1
app/install/db_create.php

@@ -1,4 +1,7 @@
-<!DOCTYPE html>
+<?php
+require_once "install_head.php";
+?>
+<!DOCTYPE html>
 <html>
 <head>
 </head>

+ 3 - 0
app/install/db_insert_bold.php

@@ -1,3 +1,6 @@
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>

+ 3 - 0
app/install/db_insert_bookword_from_csv.php

@@ -1,3 +1,6 @@
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>

+ 4 - 1
app/install/db_insert_commantry.php

@@ -1,4 +1,7 @@
-<!DOCTYPE html>
+<?php
+require_once "install_head.php";
+?>
+<!DOCTYPE html>
 <html>
 <head>
 </head>

+ 3 - 0
app/install/db_insert_index.php

@@ -1,3 +1,6 @@
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>

+ 2 - 2
app/install/db_insert_index_csv.php

@@ -1,7 +1,7 @@
 <?php
-include "./_pdo.php";
-include "../path.php";
 
+require_once "install_head.php";
+include "./_pdo.php";
 if (PHP_SAPI  == "cli") {
 	echo $argc;
 	if($argc>=3){

+ 1 - 1
app/install/db_insert_index_once.php

@@ -1,6 +1,6 @@
 <?php
+require_once "install_head.php";
 include "./_pdo.php";
-include "../path.php";
 
 if (PHP_SAPI  == "cli") {
 	echo $argc;

+ 4 - 1
app/install/db_insert_palitext.php

@@ -1,4 +1,7 @@
-<!DOCTYPE html>
+<?php
+require_once "install_head.php";
+?>
+<!DOCTYPE html>
 <html>
 <head>
 </head>

+ 3 - 0
app/install/db_insert_sentence.php

@@ -1,4 +1,7 @@
 <!--句子库生成-->
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>

+ 1 - 0
app/install/db_insert_templet.php

@@ -2,6 +2,7 @@
 /*
 用拆分好的三藏数据 生成模板库
 */
+require_once "install_head.php";
 ?>
 <!DOCTYPE html>
 <html>

+ 4 - 1
app/install/db_insert_toc.php

@@ -1,4 +1,7 @@
-<!DOCTYPE html>
+<?php
+require_once "install_head.php";
+?>
+<!DOCTYPE html>
 <html>
 <head>
 </head>

+ 4 - 1
app/install/db_insert_word_from_csv.php

@@ -1,3 +1,6 @@
+<?php
+require_once "install_head.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>
@@ -7,7 +10,7 @@
 <p><a href="index.php">Home</a></p>
 <?php
 include "./_pdo.php";
-include "../path.php";
+
 if(isset($_GET["from"])==false){
 ?>
 <form action="db_insert_word_from_csv.php" method="get">

+ 5 - 2
app/install/db_insert_wordindex_from_csv.php

@@ -1,3 +1,7 @@
+<?php
+require_once "install_head.php";
+include "./_pdo.php";
+?>
 <!DOCTYPE html>
 <html>
 <head>
@@ -5,8 +9,7 @@
 <body>
 <h2>Insert to Index</h2>
 <?php
-include "./_pdo.php";
-include "../path.php";
+
 if(isset($_GET["from"])==false){
     $from=0;
 }

+ 1 - 1
app/install/db_pali_text_export.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 require_once "../public/_pdo.php";
 ?>
 <!DOCTYPE html>

+ 1 - 1
app/install/db_update_palitext.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 require_once "../public/_pdo.php";
 ?>
 <!DOCTYPE html>

+ 1 - 8
app/install/db_update_toc.php

@@ -1,12 +1,5 @@
 <?php
-//error handler function
-function customError($errno, $errstr)
- { 
- echo "<b>Error:</b> [$errno] $errstr";
- }
-
-//set error handler
-set_error_handler("customError");
+require_once "install_head.php";
 
 require_once '../path.php';
 require_once "../public/_pdo.php";

+ 0 - 11
app/install/guid.php

@@ -1,11 +0,0 @@
-<?php
-if(isset($_GET["num"])){
-	$count=$_GET["num"];
-}
-else{
-	$count=1;
-}
-for($i=0;$i<$count;$i++){
- echo com_create_guid(). "<br>";
-}
-?>

+ 1 - 1
app/install/index.php

@@ -8,7 +8,7 @@ require_once '../path.php';
 <h2>Install wikipali suite</h2>
 <div style="margin:1em;background-color:#f1e7a4;">
 即将安装Pali Canon Database Studio 所需要的数据库。过程中有些数据需要联网获取。生成这些数据库约需要2-4小时。
-您也可以从网络下载已经生成好的数据库。
+您也可以从网络下载已经生成好的数据库。https://www.dropbox.com/s/34w2byt90ij1rlw/mint.7z?dl=0
 </div>
 <hr>
 <h2><a href="step1.php">Install Now</a></h2>

+ 38 - 0
app/install/install_head.php

@@ -0,0 +1,38 @@
+<?php
+    require_once "../path.php";
+//error handler function
+function customError($errno, $errstr)
+ { 
+ echo "<b>Error:</b> [$errno] $errstr";
+ }
+
+//set error handler
+set_error_handler("customError");
+
+    function user_db_is_exist(){
+        $PDO = new PDO("sqlite:"._FILE_DB_USERINFO_, "", "");
+        $PDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
+        $stmt = $PDO->query("SELECT count(*) as co FROM sqlite_master WHERE type=\"table\" AND name = \"user\"");
+        
+        $row = $stmt->fetch(PDO::FETCH_NUM);
+        if ($row) {
+            if($row[0]>0){
+                return true;
+            }
+            else{
+                return false;
+            }
+        } 
+        else 
+        {
+            return false;
+        }        
+    }
+
+    if(user_db_is_exist()){
+        if(!isset($_COOKIE["userid"])){
+            echo "请登陆后执行此操作";
+            exit;
+        }
+    }
+?>

+ 1 - 1
app/install/step1.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 ?>
 <html>
 <head>

+ 1 - 1
app/install/step2.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 ?>
 <html>
 <head>

+ 1 - 0
app/install/step3.php

@@ -1,4 +1,5 @@
 <?php
+require_once "install_head.php";
 require_once '../pcdl/html_head.php';
 ?>
 <body>

+ 1 - 1
app/install/step4.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 ?>
 <html>
 <head>

+ 1 - 1
app/install/step5.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 ?>
 <html>
 <head>

+ 1 - 1
app/install/xmlmaker.php

@@ -1,5 +1,5 @@
 <?php
-require_once '../path.php';
+require_once "install_head.php";
 ?>
 <!DOCTYPE html>
 <html>

+ 8 - 0
documents/users_guide/zh-cn/grammar_abl.md

@@ -0,0 +1,8 @@
+# 来源格
+pāḷi:nissakkavacana,
+
+别名:离格,夺格,从格
+```
+Nissakkavacanaṃ nāma tannissaṭatadapagamaparidīpanattho.
+```
+例句:2000多年前的一个月圆夜,王子为了解脱烦恼,**从祖国**出发,策马前往荒野。

+ 8 - 0
documents/users_guide/zh-cn/grammar_acc.md

@@ -0,0 +1,8 @@
+# 宾格
+pāḷi:upayogavacana
+
+别名:业格,受格、对格
+```
+Upayogavacanaṃ nāma yo yaṃ karoti, tena tadupayuttaparidīpanattho.
+```
+例句:2000多年前的一个月圆夜,王子为了解脱烦恼,从祖国出发,策马前往**荒野**。

+ 7 - 0
documents/users_guide/zh-cn/grammar_dat.md

@@ -0,0 +1,7 @@
+# 目的格
+pāḷi:sampadānavacana
+别名:与格,为格
+```
+Sampadānavacanaṃ nāma tappadānaparidīpanattho.
+```
+例句:2000多年前的一个月圆夜,王子**为了解脱烦恼**,从祖国出发,策马前往荒野。

+ 4 - 0
documents/users_guide/zh-cn/grammar_f.md

@@ -0,0 +1,4 @@
+# 阴性
+pāḷi:itthī
+本意:女性、雌性
+除了表示人等有性别的生物之外,在其他事物的词汇上并没有一定之规。

+ 7 - 0
documents/users_guide/zh-cn/grammar_gen.md

@@ -0,0 +1,7 @@
+# 属格
+pāḷi:sāmivacana
+别名:所有格
+```
+Sāmivacanaṃ nāma tadissaraparidīpanattho.
+```
+例句:**2000多年前的**一个月圆夜,王子为了解脱烦恼,从祖国出发,策马前往**其他国家的**荒野。

+ 7 - 0
documents/users_guide/zh-cn/grammar_inst.md

@@ -0,0 +1,7 @@
+# 工具格
+pāḷi:karaṇavacanaṃ
+别名:具格,具做格
+```
+Karaṇavacanaṃ nāma tajjāpakatanibbattakaparidīpanattho.
+```
+例句:2000多年前的一个月圆夜,王子为了解脱烦恼,从祖国出发,**策马**前往荒野。

+ 7 - 0
documents/users_guide/zh-cn/grammar_loc.md

@@ -0,0 +1,7 @@
+# 处格
+pāḷi:bhummavacana
+别名:位置格,依格
+```
+Bhummavacanaṃ nāma tappatiṭṭhāparidīpanattho.
+```
+例句:2000多年前的**一个月圆夜**,王子为了解脱烦恼,从祖国出发,策马前往荒野。

+ 4 - 5
documents/users_guide/zh-cn/grammar_m.md

@@ -1,5 +1,4 @@
-# 阳性词
-
-巴利语:
-
-巴利语中三种词性的一种
+# 阳性
+pāḷi:puma
+本意:雄性、男性;
+除了表示人等有性别的生物之外,在其他事物的词汇上并没有一定之规。

+ 8 - 4
documents/users_guide/zh-cn/grammar_nom.md

@@ -1,5 +1,9 @@
 # 主格
-巴利语:
-
-动作的发出者。
-
+pāḷi:paccattavacana
+别名:体格
+```
+Tatra paccattavacanaṃ nāma tividhaliṅgavavatthānagatānaṃ itthipumanapuṃsakānaṃ paccattasabhāvaniddesattho.
+——《論語法》
+```
+名词的变化形式之一,大部分情况在句子中扮演动作的发出者,如下文黑体字。
+例句:2000多年前的一个月圆夜,**王子**为了解脱烦恼,从祖国出发,策马前往荒野。

+ 3 - 0
documents/users_guide/zh-cn/grammar_nt.md

@@ -0,0 +1,3 @@
+# 中性
+pāḷi:napuṃsaka
+本意:非雄,不是男的

+ 6 - 0
documents/users_guide/zh-cn/grammar_pl.md

@@ -0,0 +1,6 @@
+# 复数
+pāḷi:bahuvacana
+```
+Bahūnamatthānaṃ vacanaṃ bahuvacanaṃ.
+表达“有多个”含义的用语,为复数。
+```

+ 6 - 0
documents/users_guide/zh-cn/grammar_sg.md

@@ -0,0 +1,6 @@
+# 单数
+pāḷi:ekavacana
+```
+ekassatthassa vacanaṃ ekavacanaṃ.——“Saddanītippakaraṇaṃ”
+表示“一个”含义的用语,为单数。——《论语法》
+```

+ 5 - 0
documents/users_guide/zh-cn/grammar_voc.md

@@ -0,0 +1,5 @@
+# 呼格
+pāḷi:āmantanavacana
+```
+Āmantanavacanaṃ nāma tadāmantanaparidīpanattho.
+```