Bläddra i källkod

:bug: 数据库修改后产生的bug

visuddhinanda 5 år sedan
förälder
incheckning
cb03288a53
5 ändrade filer med 17 tillägg och 34 borttagningar
  1. 2 2
      app/studio/dict_find_auto.php
  2. 7 5
      app/studio/project.php
  3. 1 1
      app/studio/setting.php
  4. 4 23
      app/studio/term.php
  5. 3 3
      app/uwbw/update.php

+ 2 - 2
app/studio/dict_find_auto.php

@@ -44,7 +44,7 @@ global $PDO;
 	$db_file = _DIR_PALICANON_TEMPLET_."/p".$in_book."_tpl.db3";
 	
 	PDO_Connect("sqlite:$db_file");
-	$query="SELECT paragraph,vri,real FROM \"main\" WHERE (\"paragraph\" in ".$strQueryPara." ) and \"real\"<>\"\" and \"type\"<>'.ctl.' ";
+	$query="SELECT paragraph,wid,real FROM \"main\" WHERE (\"paragraph\" in ".$strQueryPara." ) and \"real\"<>\"\" and \"type\"<>'.ctl.' ";
 	if($debug){
 		echo "filename:".$db_file."<br>";
 		echo $query."<br>";
@@ -378,7 +378,7 @@ foreach($FetchAllWord as $word){
 	array_push($output,
 			array("book"=>$in_book,
 				 "paragraph"=>$word["paragraph"],
-				 "num"=>$word["vri"],
+				 "num"=>$word["wid"],
 			     "pali"=>$word["real"],
 				 "type"=>$type,
 				 "gramma"=>$gramma,

+ 7 - 5
app/studio/project.php

@@ -89,7 +89,7 @@ switch($op){
 			$language=$res[$iRes]->language;
 			$author=$res[$iRes]->author;
 			
-			$db_file = _FILE_DB_RES_INDEX_;
+			$db_file = _FILE_DB_RESRES_INDEX_;
 			PDO_Connect("sqlite:$db_file");
 			$query = "select guid,owner from 'album' where id='{$res_album_id}'";
 			$Fetch = PDO_FetchAll($query);
@@ -154,7 +154,8 @@ switch($op){
 							$strXml="<word>";
 							$strXml.="<pali>{$result["word"]}</pali>";
 							$strXml.="<real>{$result["real"]}</real>";
-							$strXml.="<id>{$result["wid"]}</id>";
+							$wordid = "p{$result["book"]}-{$result["paragraph"]}-{$result["wid"]}"; 
+							$strXml.="<id>{$wordid}</id>";
 							$strXml.="<type s=\"0\">{$result["type"]}</type>";
 							$strXml.="<gramma s=\"0\">{$wGrammar}</gramma>";
 							$strXml.="<mean s=\"0\"></mean>";
@@ -164,7 +165,7 @@ switch($op){
 							$strXml.="<style>{$result["style"]}</style>";
 							$strXml.="<status>0</status>";
 							$strXml.="</word>";
-							$wbw_data[] = array(UUID::v4(),$block_id,$book,$iPar,$result["vri"],$result["real"],$strXml,time(),time(),1,$USER_NAME);
+							$wbw_data[] = array(UUID::v4(),$block_id,$book,$iPar,$result["wid"],$result["real"],$strXml,time(),time(),1,$USER_NAME);
 						}
 							
 						}
@@ -235,13 +236,14 @@ switch($op){
 									VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
 					$stmt = $PDO->prepare($query);
 					$doc_id=UUID::v4();
+					$file_name = $book . '_' . $create_para . '_' . time();
 					$newData=array(
 								   $doc_id,
 								   "",
 								   $uid,
 								   $book,
 								   $create_para,
-								   "",
+								   $file_name,
 								   $user_title,
 								   $tag,
 								   1,
@@ -351,7 +353,7 @@ switch($op){
 			$language=$res[$iRes]->language;
 			$author=$res[$iRes]->author;
 			
-			$db_file = _FILE_DB_RES_INDEX_;
+			$db_file = _FILE_DB_RESRES_INDEX_;
 			PDO_Connect("sqlite:$db_file");
 			$query = "select guid,owner from 'album' where id='{$res_album_id}'";
 			$Fetch = PDO_FetchAll($query);

+ 1 - 1
app/studio/setting.php

@@ -366,7 +366,7 @@ $album_power["2"]="编辑";
 			echo "<a href='login.php?op=logout'>Logout</a>";
 			break;
 		case "album":
-			$db_file = _FILE_DB_RES_INDEX_;
+			$db_file = _FILE_DB_RESRES_INDEX_;
 			PDO_Connect("sqlite:$db_file");		
 			if(isset($_GET["id"])){
 				if(isset($_GET["power"])){

+ 4 - 23
app/studio/term.php

@@ -1,29 +1,10 @@
 <?php
 //查询term字典
-include "../path.php";
-include "../public/_pdo.php";
-include "./public.inc";
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once "./public.inc";
+require_once "../public/load_lang.php";
 
-if(isset($_GET["language"])){
-	$currLanguage=$_GET["language"];
-	$_COOKIE["language"]=$currLanguage;
-}
-else{
-	if(isset($_COOKIE["language"])){
-		$currLanguage=$_COOKIE["language"];
-	}
-	else{
-		$currLanguage="en";
-		$_COOKIE["language"]=$currLanguage;
-	}
-}
-//load language file
-if(file_exists($dir_language.$currLanguage.".php")){
-	require $dir_language.$currLanguage.".php";
-}
-else{
-	include $dir_language."default.php";
-}
 
 $username = "";
 if(isset($_COOKIE["username"]) && !empty($_COOKIE["username"])){

+ 3 - 3
app/uwbw/update.php

@@ -2,9 +2,9 @@
 /*
 get xml doc from db
 */
-include "../path.php";
-include "../public/_pdo.php";
-include "../public/function.php";
+require_once "../path.php";
+require_once "../public/_pdo.php";
+require_once "../public/function.php";
 
 
 $aData=json_decode($_POST["data"]);