Bläddra i källkod

Merge commit '44296d4365e077eff89b98bf4d93dd68b0c7d662' of http://10.168.1.228/mint/

Bhikkhu-Kosalla 5 år sedan
förälder
incheckning
014bab0ae9

+ 3 - 6
app/admin/db_update_cs6_para.php

@@ -1,16 +1,13 @@
 <?php
+#将cscd4 段落编号插入数据库 用于义注跳转
 require_once "../public/_pdo.php";
 require_once "../path.php";
 
-$db_file = _FILE_DB_PALITEXT_;
-PDO_Connect("$db_file");
-
+PDO_Connect(_FILE_DB_PALITEXT_);
 $query = "SELECT * from books where 1";
 $books = PDO_FetchAll($query);
 
-$db_file = _FILE_DB_PAGE_INDEX_;
-PDO_Connect("$db_file");
-
+PDO_Connect(_FILE_DB_PAGE_INDEX_);
 // 打开文件并读取数据
 $irow = 0;
 if (($fp = fopen("./cs6_para.csv", "r")) !== false) {

+ 3 - 4
app/admin/update_user_active_time.php

@@ -1,4 +1,5 @@
 <?php
+#已经废弃
 require_once '../path.php';
 
 date_default_timezone_set("UTC");
@@ -8,12 +9,10 @@ $start = strtotime($last . " +1 day");
 $end = strtotime($last . " +2 day");
 $today = strtotime("today");
 
-$dns = "" . _FILE_DB_USER_ACTIVE_;
-$dbh = new PDO($dns, "", "", array(PDO::ATTR_PERSISTENT => true));
+$dbh = new PDO(_FILE_DB_USER_ACTIVE_, "", "", array(PDO::ATTR_PERSISTENT => true));
 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 
-$dns = "" . _FILE_DB_USER_ACTIVE_INDEX_;
-$dbh_index = new PDO($dns, "", "", array(PDO::ATTR_PERSISTENT => true));
+$dbh_index = new PDO(_FILE_DB_USER_ACTIVE_INDEX_, "", "", array(PDO::ATTR_PERSISTENT => true));
 $dbh_index->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 /* 开始一个事务,关闭自动提交 */
 $dbh_index->beginTransaction();

+ 7 - 6
app/admin/word_index_weight_refresh.php

@@ -6,8 +6,8 @@ require_once '../path.php';
 require_once './word_index_weight_table.php';
 
 if (isset($_GET["from"])) {
-    $from = $_GET["from"];
-    $to = $_GET["to"];
+    $from = (int)$_GET["from"];
+    $to = (int)$_GET["to"];
 } else {
     if ($argc != 3) {
         echo "无效的参数 ";
@@ -20,18 +20,19 @@ if (isset($_GET["from"])) {
     }
 }
 
-$dh_word = new PDO("" . _FILE_DB_WORD_INDEX_, "", "");
+$dh_word = new PDO( _FILE_DB_WORD_INDEX_, "", "");
 $dh_word->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 
-$dh_pali = new PDO("" . _FILE_DB_PALI_INDEX_, "", "");
+$dh_pali = new PDO( _FILE_DB_PALI_INDEX_, "", "");
 $dh_pali->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 
 echo "from=$from to = $to \n";
 for ($i = $from; $i <= $to; $i++) {
     $time_start = microtime(true);
     echo "正在处理 book= $i ";
-    $query = "SELECT max(paragraph) from word where book={$i}";
-    $stmt = $dh_pali->query($query);
+    $query = "SELECT max(paragraph) from word where book=?";
+	$stmt = $dh_pali->prepare($query);
+    $stmt->execute(array($i));
     $row = $stmt->fetch(PDO::FETCH_NUM);
     if ($row) {
         $max_para = $row[0];

+ 2 - 2
app/article/add_article_to_collect.php

@@ -1,5 +1,5 @@
 <?php
-//查询term字典
+//添加文章到文集
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
@@ -16,7 +16,7 @@ if(isset($_POST["id"])){
     $dirty_collect = array();
     $data = json_decode($_POST["data"]);
     $title = $_POST["title"];
-    PDO_Connect(""._FILE_DB_USER_ARTICLE_);
+    PDO_Connect(_FILE_DB_USER_ARTICLE_);
     $article_id=$_POST["id"];
     //找出脏的collect
     $query = "SELECT collect_id FROM article_list  WHERE article_id = ? ";

+ 25 - 6
app/article/article.js

@@ -4,11 +4,12 @@ var _lang = "";
 var _author = "";
 var _display = "";
 var _collect_id = "";
+var _collection_id = "";
 
 function article_onload() {
 	historay_init();
 }
-function articel_load(id) {
+function articel_load(id, collection_id) {
 	if (id == "") {
 		return;
 	}
@@ -16,6 +17,7 @@ function articel_load(id) {
 		"../article/get.php",
 		{
 			id: id,
+			collection_id: collection_id,
 			setting: "",
 		},
 		function (data, status) {
@@ -64,7 +66,7 @@ function collect_load(id) {
 						$("#contents").html(marked(result.summary));
 
 						let article_list = JSON.parse(result.article_list);
-						render_article_list(article_list);
+						render_article_list(article_list, id);
 					}
 				} catch (e) {
 					console.error(e);
@@ -93,7 +95,7 @@ function articel_load_collect(article_id) {
 						$("#pali_pedia").html(strTitle);
 
 						let article_list = JSON.parse(result[0].article_list);
-						render_article_list(article_list);
+						render_article_list(article_list, result[0].id);
 					}
 				} catch (e) {
 					console.error(e);
@@ -105,7 +107,8 @@ function articel_load_collect(article_id) {
 	);
 }
 
-function render_article_list(article_list) {
+//在collect 中 的article列表
+function render_article_list(article_list, collection_id) {
 	let html = "";
 	html += "<ul>";
 	let display = "";
@@ -114,16 +117,31 @@ function render_article_list(article_list) {
 	}
 	let prevArticle = "无";
 	let nextArticle = "无";
+	let urlCollection = "&collection=" + collection_id;
 	for (let index = 0; index < article_list.length; index++) {
 		const element = article_list[index];
 		if (element.article == _articel_id) {
 			if (index > 0) {
 				const prev = article_list[index - 1];
-				prevArticle = "<a href='../article/index.php?id=" + prev.article + display + "'>" + prev.title + "</a>";
+				prevArticle =
+					"<a href='../article/index.php?id=" +
+					prev.article +
+					display +
+					urlCollection +
+					"'>" +
+					prev.title +
+					"</a>";
 			}
 			if (index < article_list.length - 1) {
 				const next = article_list[index + 1];
-				nextArticle = "<a href='../article/index.php?id=" + next.article + display + "'>" + next.title + "</a>";
+				nextArticle =
+					"<a href='../article/index.php?id=" +
+					next.article +
+					display +
+					urlCollection +
+					"'>" +
+					next.title +
+					"</a>";
 			}
 			$("#contents_nav_left").html(prevArticle);
 			$("#contents_nav_right").html(nextArticle);
@@ -135,6 +153,7 @@ function render_article_list(article_list) {
 			"<a href='../article/index.php?id=" +
 			element.article +
 			display +
+			urlCollection +
 			"'>" +
 			element.title +
 			"</a></li>";

+ 13 - 3
app/article/collect_get.php

@@ -1,14 +1,24 @@
 <?php
-//查询term字典
+#获取文集信息
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../ucenter/function.php';
+require_once '../collect/function.php';
+require_once '../redis/function.php';
 
-
+$redis = redis_connect();
 if(isset($_GET["id"])){
-    PDO_Connect(""._FILE_DB_USER_ARTICLE_);
+	//查询权限
+
+	$collection = new CollectInfo($redis); 
+	$power = $collection->getPower($_GET["id"]);
+	if($power<10){
+		echo json_encode(array(), JSON_UNESCAPED_UNICODE);
+        exit;
+	}
+    PDO_Connect(_FILE_DB_USER_ARTICLE_);
     $id=$_GET["id"];
     $query = "select * from collect  where id = ? ";
     $Fetch = PDO_FetchRow($query,array($id));

+ 3 - 3
app/article/collect_list.php

@@ -1,5 +1,5 @@
 <?php
-//查询term字典
+#某用户的文章列表
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
@@ -10,8 +10,8 @@ require_once '../ucenter/function.php';
 if(isset($_GET["userid"])){
     PDO_Connect(""._FILE_DB_USER_ARTICLE_);
     $userid=$_GET["userid"];
-    $query = "SELECT * from collect  where owner = ".$PDO->quote($userid)." and status <> 0 order by modify_time DESC";
-    $Fetch = PDO_FetchAll($query);
+    $query = "SELECT * from collect  where owner = ? and status <> 0 order by modify_time DESC";
+    $Fetch = PDO_FetchAll($query,array($userid));
     echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
     exit;
 }

+ 34 - 12
app/article/function.php

@@ -72,16 +72,27 @@ class Article
             return false;
         }
 	}
-	public function getPower($id){
-		#查询用户对此是否有权限		
-
+	public function getPower($id,$collectionId=""){
+		#查询用户对此是否有权限	
+		if(isset($_COOKIE["userid"])){
+			$userId = $_COOKIE["userid"];
+		}
+		else{
+			$userId=0;
+		}
+		if($this->_redis!==false){
+			$power = $this->_redis->hGet("power://article/".$id,$userId);
+			if($power!==FALSE){
+				return $power;
+			}
+		}
 		$iPower = 0;
 		$query = "SELECT owner,status FROM article WHERE id=?  ";
 		$stmt = $this->dbh->prepare($query);
 		$stmt->execute(array($id));
 		$channel = $stmt->fetch(PDO::FETCH_ASSOC);
 		if($channel){
-			if(!isset($_COOKIE["userid"])  ){
+			if(!isset($_COOKIE["userid"])){
 				#未登录用户
 				if($channel["status"]==30){
 					#全网公开有读取和建议权限
@@ -91,24 +102,35 @@ class Article
 					#其他状态没有任何权限
 					return 0;
 				}
-				
 			}
-			if($channel["owner"]==$_COOKIE["userid"]){
-				return 30;
-			}
-			else if($channel["status"]>=30){
-				#全网公开的 可以提交pr
-				$iPower = 10;
+			else{
+				if($channel["owner"]==$_COOKIE["userid"]){
+					#自己的
+					return 30;
+				}
+				else if($channel["status"]>=30){
+					#全网公开的 可以提交pr
+					$iPower = 10;
+				}				
 			}
 		}
 		#查询共享权限,如果共享权限更大,覆盖上面的的
 		$sharePower = share_get_res_power($_COOKIE["userid"],$id);
+		if($collectionId!=""){
+			$sharePowerCollection = share_get_res_power($_COOKIE["userid"],$collectionId);
+		}
+		else{
+			$sharePowerCollection =0;
+		}
 		if($sharePower>$iPower){
 			$iPower=$sharePower;
 		}
+		if($sharePowerCollection>$iPower){
+			$iPower=$sharePowerCollection;
+		}
+		$this->_redis->hSet("power://article/".$id,$_COOKIE["userid"],$iPower);
 		return $iPower;
 	}
-
 }
 
 ?>

+ 3 - 2
app/article/get.php

@@ -1,5 +1,5 @@
 <?php
-//查询term字典
+//获取article内容
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
@@ -12,9 +12,10 @@ require_once "../article/function.php";
 
 if(isset($_GET["id"])){
 	//查询权限
+	$collectionId = $_GET["collection_id"];
 	$redis = redis_connect();
 	$article = new Article($redis); 
-	$power = $article->getPower($_GET["id"]);
+	$power = $article->getPower($_GET["id"],$collectionId);
 	if($power<10){
 		$output = array();
 		$output["title"]="error";

+ 4 - 3
app/article/index.php

@@ -24,6 +24,9 @@ require_once "../pcdl/html_head.php";
 	if(isset($_GET["collect"])){
 		echo "_collect_id='".$_GET["collect"]."';";
 	}
+	if(isset($_GET["collection"])){
+		echo "_collection_id='".$_GET["collection"]."';";
+	}
 	if(isset($_GET["display"])){
 		echo "_display='".$_GET["display"]."';";
 	}
@@ -161,7 +164,7 @@ require_once "../pcdl/html_head.php";
 	note_create();
 	historay_init();
 	if(_collect_id==""){
-		articel_load(_articel_id);
+		articel_load(_articel_id,_collection_id);
 		articel_load_collect(_articel_id);
 	}
 	else{
@@ -169,8 +172,6 @@ require_once "../pcdl/html_head.php";
 	}
 	});
 
-
-
 	 window.addEventListener('scroll',winScroll);
 	function winScroll(e){ 
 		if(GetPageScroll().y>220){

+ 1 - 1
app/article/list_new.php

@@ -24,7 +24,7 @@ require_once '../collect/function.php';
     else{
         $begin = 0;
     }
-    PDO_Connect(""._FILE_DB_USER_ARTICLE_);
+    PDO_Connect(_FILE_DB_USER_ARTICLE_);
     $query = "SELECT id,title,subtitle,summary,owner,modify_time from article  where status >= 30 ";
     
     if(isset($_GET["orderby"])){

+ 1 - 0
app/article/my_article.js

@@ -71,6 +71,7 @@ function my_article_list() {
 						html += "</svg>";
 						html += "</button>";
 						html += "</div>";
+
 						html += "</div>";
 					}
 					$("#article_list").html(html);

+ 1 - 0
app/article/my_article_post.php

@@ -129,6 +129,7 @@ if (!$sth || ($sth && $sth->errorCode() != 0)) {
 else{
 	if($redis){
 		$redis->del("article://".$_POST["id"]);
+		$redis->del("power://article/".$_POST["id"]);
 	}
 	
 }

+ 14 - 0
app/article/my_article_put.php

@@ -9,6 +9,20 @@ require_once '../hostsetting/function.php';
 require_once "../ucenter/active.php";
 
 $respond=array("status"=>0,"message"=>"");
+if(!isset($_COOKIE["userid"])){
+	#不登录不能新建
+	$respond['status']=1;
+	$respond['message']="no power create article";
+	echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+	exit;
+}
+if(!isset($_POST["title"])){
+	#无标题不能新建
+	$respond['status']=1;
+	$respond['message']="no title";
+	echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+	exit;
+}
 PDO_Connect(_FILE_DB_USER_ARTICLE_);
 
 $query="INSERT INTO article ( id,  title  , subtitle  , summary , content   , tag  , owner, setting  , status  , create_time , modify_time , receive_time   )  VALUES  ( ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? ) ";

+ 221 - 212
app/article/my_collect.js

@@ -1,229 +1,238 @@
+var share_win;
+
 function my_collect_init() {
-  my_collect_list();
-  collect_add_dlg_init("collect_add_div");
+	my_collect_list();
+	share_win = iframe_win_init({ container: "share_win", name: "share", width: "500px" });
+	collect_add_dlg_init("collect_add_div");
 }
 function my_collect_list() {
-  $.get(
-    "../article/collect_list.php",
-    {
-      userid: getCookie("userid"),
-      setting: "",
-    },
-    function (data, status) {
-      if (status == "success") {
-        try {
-          let html = "";
-          let result = JSON.parse(data);
-          let key = 1;
-          for (const iterator of result) {
-            html += '<div class="file_list_row" style="padding:5px;">';
-            html +=
-              '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
-            html += "<div style='flex:1;'>" + key++ + "</div>";
-            html += "<div style='flex:2;'>" + iterator.title + "</div>";
-            html +=
-              "<div style='flex:2;'>" +
-              render_status(iterator.status) +
-              "</div>";
-            html += "<div style='flex:1;'>"+gLocal.gui.copy_link+"</div>";
-            html +=
-              "<div style='flex:1;'><a href='../article/my_collect_edit.php?id=" +
-              iterator.id +
-              "'>"+gLocal.gui.edit+"</a></div>";
-            html +=
-              "<div style='flex:1;'><a href='../article/?collect=" +
-              iterator.id +
-              "' target='_blank'>"+gLocal.gui.preview+"</a></div>";
-            html += "<div style='flex:1;'>15</div>";
-            html += "</div>";
-          }
-          $("#article_list").html(html);
-        } catch (e) {
-          console.error(e);
-        }
-      } else {
-        console.error("ajex error");
-      }
-    }
-  );
+	$.get(
+		"../article/collect_list.php",
+		{
+			userid: getCookie("userid"),
+			setting: "",
+		},
+		function (data, status) {
+			if (status == "success") {
+				try {
+					let html = "";
+					let result = JSON.parse(data);
+					let key = 1;
+					for (const iterator of result) {
+						html += '<div class="file_list_row" style="padding:5px;">';
+						html += '<div style="max-width:2em;flex:1;"><input type="checkbox" /></div>';
+						html += "<div style='flex:1;'>" + key++ + "</div>";
+						html += "<div style='flex:2;'>" + iterator.title + "</div>";
+						html += "<div style='flex:2;'>" + render_status(iterator.status) + "</div>";
+						html += "<div style='flex:1;'>" + gLocal.gui.copy_link + "</div>";
+						html +=
+							"<div style='flex:1;'><a href='../article/my_collect_edit.php?id=" +
+							iterator.id +
+							"'>" +
+							gLocal.gui.edit +
+							"</a></div>";
+						html +=
+							"<div style='flex:1;'><a href='../article/?collect=" +
+							iterator.id +
+							"' target='_blank'>" +
+							gLocal.gui.preview +
+							"</a></div>";
+						html += "<div style='flex:1;'>";
+						html += "<a onclick=\"collection_share('" + iterator.id + "')\">share</a>";
+						html += "</div>";
+						html += "</div>";
+					}
+					$("#article_list").html(html);
+				} catch (e) {
+					console.error(e);
+				}
+			} else {
+				console.error("ajex error");
+			}
+		}
+	);
 }
 var _arrArticleList;
 var _arrArticleOrder = new Array();
 function my_collect_edit(id) {
-  $.get(
-    "../article/collect_get.php",
-    {
-      id: id,
-      setting: "",
-    },
-    function (data, status) {
-      if (status == "success") {
-        try {
-          let html = "";
-          let result = JSON.parse(data);
-          $("#article_collect").attr("a_id", result.id);
-          html += '<div class="" style="padding:5px;">';
-          html += '<div style="max-width:2em;flex:1;"></div>';
-          html += "<input type='hidden' name='id' value='" + result.id + "'/>";
-          html +=
-            "<input type='hidden' name='subtitle' value='" +
-            result.subtitle +
-            "'/>";
-          html +=
-            "<input type='hidden' name='summary' value='" +
-            result.summary +
-            "'/>";
-          html +=
-            "<input type='hidden' name='status' value='" +
-            result.status +
-            "'/>";
-          html +=
-            "<input type='hidden' name='lang' value='" + result.lang + "'/>";
-          html +=
-            "<input id='form_article_list' type='hidden' name='article_list' value='" +
-            result.article_list +
-            "'/>";
-          html += "</div>";
-          html += "<div style='display:flex;'>";
-          html += "<div style='flex:4;'>";
-
-          _arrArticleList = JSON.parse(result.article_list);
-          html += "<ul id='ul_article_list'>";
-          for (let index = 0; index < _arrArticleList.length; index++) {
-            const element = _arrArticleList[index];
-            html += my_collect_render_article(index, element);
-            _arrArticleOrder.push(index);
-          }
-
-          html += "</ul>";
-
-          html += "</div>";
-
-          html += "<div id='preview_div'>";
-          html += "<div id='preview_inner' ></div>";
-          html += "</div>";
-
-          html += "</div>";
-
-          $("#article_list").html(html);
-          $("#collect_title").val(result.title);
-
-          $("#ul_article_list").sortable({
-            update: function (event, ui) {
-              let sortedIDs = $("#ul_article_list").sortable("toArray");
-              _arrArticleOrder = new Array();
-              for (const iSorted of sortedIDs) {
-                let newindex = parseInt($("#" + iSorted).attr("article_index"));
-                _arrArticleOrder.push(_arrArticleList[newindex]);
-              }
-              $("#form_article_list").val(JSON.stringify(_arrArticleOrder));
-            },
-          });
-
-          $("#aritcle_status").html(render_status(result.status));
-          let html_title =
-            "<input id='input_article_title' type='input' name='title' value='" +
-            result.title +
-            "' />";
-          $("#article_title").html(html_title);
-        } catch (e) {
-          console.error(e);
-        }
-      } else {
-        console.error("ajex error");
-      }
-    }
-  );
+	$.get(
+		"../article/collect_get.php",
+		{
+			id: id,
+			setting: "",
+		},
+		function (data, status) {
+			if (status == "success") {
+				try {
+					let html = "";
+					let result = JSON.parse(data);
+					$("#article_collect").attr("a_id", result.id);
+					html += '<div class="" style="padding:5px;">';
+					html += '<div style="max-width:2em;flex:1;"></div>';
+					html += "<input type='hidden' name='id' value='" + result.id + "'/>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.title + "</div>";
+					html += "<div style='flex:8;'>";
+					html += "<input type='input' name='title' value='" + result.title + "'/>";
+					html += "</div></div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.sub_title + "</div>";
+					html += "<div style='flex:8;'>";
+					html += "<input type='input' name='subtitle' value='" + result.subtitle + "'/>";
+					html += "</div></div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.summary + "</div>";
+					html += "<div style='flex:8;'>";
+					html += "<input type='input' name='summary' value='" + result.summary + "'/>";
+					html += "</div></div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.status + "</div>";
+					html += "<div style='flex:8;'>";
+					html += render_status(result.status, false);
+					html += "</div></div>";
+
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:2;'>" + gLocal.gui.language + "</div>";
+					html += "<div style='flex:8;'>";
+					html += "<input type='input' name='lang' value='" + result.lang + "'/>";
+					html += "</div></div>";
+
+					html +=
+						"<input id='form_article_list' type='hidden' name='article_list' value='" +
+						result.article_list +
+						"'/>";
+					html += "</div>";
+					html += "<div style='display:flex;'>";
+					html += "<div style='flex:4;'>";
+
+					_arrArticleList = JSON.parse(result.article_list);
+					html += "<ul id='ul_article_list'>";
+					for (let index = 0; index < _arrArticleList.length; index++) {
+						const element = _arrArticleList[index];
+						html += my_collect_render_article(index, element);
+						_arrArticleOrder.push(index);
+					}
+
+					html += "</ul>";
+
+					html += "</div>";
+
+					html += "<div id='preview_div'>";
+					html += "<div id='preview_inner' ></div>";
+					html += "</div>";
+
+					html += "</div>";
+
+					$("#article_list").html(html);
+					$("#collection_title").html(result.title);
+
+					$("#ul_article_list").sortable({
+						update: function (event, ui) {
+							let sortedIDs = $("#ul_article_list").sortable("toArray");
+							_arrArticleOrder = new Array();
+							for (const iSorted of sortedIDs) {
+								let newindex = parseInt($("#" + iSorted).attr("article_index"));
+								_arrArticleOrder.push(_arrArticleList[newindex]);
+							}
+							$("#form_article_list").val(JSON.stringify(_arrArticleOrder));
+						},
+					});
+				} catch (e) {
+					console.error(e);
+				}
+			} else {
+				console.error("ajex error");
+			}
+		}
+	);
 }
 
 function my_collect_render_article(index, article) {
-  let html = "";
-  html +=
-    "<li id='article_item_" +
-    index +
-    "' article_index='" +
-    index +
-    "' class='file_list_row'>";
-  html += "<span style='flex:1;'>";
-  html += "<select>";
-  let selected = "";
-  for (let i = 1; i < 9; i++) {
-    if (parseInt(article.level) == i) {
-      selected = "selected";
-    } else {
-      selected = "";
-    }
-    html += "<option " + selected + " value='" + i + "' >H " + i + "</option>";
-  }
-  html += "</select>";
-  html += "</span>";
-  html += "<span style='flex:3;'>";
-  html +=
-    "<a href='../article/my_article_edit.php?id=" + article.article + "'>";
-  html += article.title;
-  html += "</a>";
-  html += "</span>";
-  html +=
-    "<span style='flex:1;' onclick=\"article_preview('" +
-    article.article +
-    "')\">";
-  html += "Preview";
-  html += "</span>";
-  html += "</li>";
-  return html;
+	let html = "";
+	html += "<li id='article_item_" + index + "' article_index='" + index + "' class='file_list_row'>";
+	html += "<span style='flex:1;'>";
+	html += "<select>";
+	let selected = "";
+	for (let i = 1; i < 9; i++) {
+		if (parseInt(article.level) == i) {
+			selected = "selected";
+		} else {
+			selected = "";
+		}
+		html += "<option " + selected + " value='" + i + "' >H " + i + "</option>";
+	}
+	html += "</select>";
+	html += "</span>";
+	html += "<span style='flex:3;'>";
+	html += "<a href='../article/my_article_edit.php?id=" + article.article + "'>";
+	html += article.title;
+	html += "</a>";
+	html += "</span>";
+	html += "<span style='flex:1;' onclick=\"article_preview('" + article.article + "')\">";
+	html += "Preview";
+	html += "</span>";
+	html += "</li>";
+	return html;
 }
 
 function article_preview(id) {
-  $.get(
-    "../article/get.php",
-    {
-      id: id,
-      setting: "",
-    },
-    function (data, status) {
-      if (status == "success") {
-        try {
-          let html = "";
-          let result = JSON.parse(data);
-          $("#preview_inner").html(note_init(result.content));
-          note_refresh_new();
-        } catch (e) {
-          console.error(e.message);
-        }
-      }
-    }
-  );
+	$.get(
+		"../article/get.php",
+		{
+			id: id,
+			setting: "",
+		},
+		function (data, status) {
+			if (status == "success") {
+				try {
+					let html = "";
+					let result = JSON.parse(data);
+					$("#preview_inner").html(note_init(result.content));
+					note_refresh_new();
+				} catch (e) {
+					console.error(e.message);
+				}
+			}
+		}
+	);
 }
 
 function my_collect_save() {
-  $.ajax({
-    type: "POST", //方法类型
-    dataType: "json", //预期服务器返回的数据类型
-    url: "../article/my_collect_post.php", //url
-    data: $("#collect_edit").serialize(),
-    success: function (result) {
-      console.log(result); //打印服务端返回的数据(调试用)
-
-      if (result.status == 0) {
-        alert("保存成功");
-      } else {
-        alert("error:" + result.message);
-      }
-    },
-    error: function (data, status) {
-      alert("异常!" + data.responseText);
-      switch (status) {
-        case "timeout":
-          break;
-        case "error":
-          break;
-        case "notmodified":
-          break;
-        case "parsererror":
-          break;
-        default:
-          break;
-      }
-    },
-  });
+	$.ajax({
+		type: "POST", //方法类型
+		dataType: "json", //预期服务器返回的数据类型
+		url: "../article/my_collect_post.php", //url
+		data: $("#collect_edit").serialize(),
+		success: function (result) {
+			console.log(result); //打印服务端返回的数据(调试用)
+
+			if (result.status == 0) {
+				alert("保存成功");
+			} else {
+				alert("error:" + result.message);
+			}
+		},
+		error: function (data, status) {
+			alert("异常!" + data.responseText);
+			switch (status) {
+				case "timeout":
+					break;
+				case "error":
+					break;
+				case "notmodified":
+					break;
+				case "parsererror":
+					break;
+				default:
+					break;
+			}
+		},
+	});
+}
+function collection_share(id) {
+	share_win.show("../share/share.php?id=" + id + "&type=4");
 }

+ 5 - 2
app/article/my_collect_edit.php

@@ -3,6 +3,7 @@ require_once '../studio/index_head.php';
 ?>
 <body id="file_list_body" >
 
+	<script language="javascript" src="../article/my_article.js"></script>
 	<script language="javascript" src="../article/my_collect.js"></script>
 	<script language="javascript" src="../term/note.js"></script>
 	<script language="javascript" src="../term/term.js"></script>
@@ -17,7 +18,6 @@ require_once '../studio/index_head.php';
 	<style>
 	#collect {
 		background-color: var(--btn-border-color);
-		
 	}
 	#collect:hover{
 		background-color: var(--btn-border-color);
@@ -59,7 +59,7 @@ require_once '../studio/index_head.php';
 		<div class="tool_bar">
 			<div style="display:flex;">
 				<a href="../article/my_collect_index.php">返回</a>
-				<span><input  id="collect_title" type='input' name='title' value="" /></span>
+				<span id='collection_title'></span>
 			</div>
 			<div style="display:flex;">
 				<div id="aritcle_status"></div>
@@ -83,6 +83,9 @@ require_once '../studio/index_head.php';
 			</div>
 		</div>
 
+		<div id="collection_info"  class="file_list_block" style="">
+
+		</div>
 		<div id="article_list"  class="file_list_block" style="">
 
 		</div>

+ 2 - 1
app/article/my_collect_index.php

@@ -57,7 +57,8 @@ require_once '../studio/index_tool_bar.php';
 			</div>
 		</div>
 	</div>
-	
+	<div class="modal_win_bg">
+	<div id="share_win" class="iframe_container"></div>
 <?php
 require_once '../studio/index_foot.php';
 ?>

+ 31 - 3
app/article/my_collect_post.php

@@ -2,14 +2,34 @@
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/function.php';
-require_once '../hostsetting/function.php';
+require_once '../collect/function.php';
 require_once "../ucenter/active.php";
+require_once "../redis/function.php";
 
-add_edit_event(_COLLECTION_EDIT_,$_POST["id"]);
 
 $respond=array("status"=>0,"message"=>"");
+if(!isset($_COOKIE["userid"])){
+	#不登录不能新建
+	$respond['status']=1;
+	$respond['message']="no power create article";
+	echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+	exit;
+}
+# 检查当前用户是否有修改权限
+$redis = redis_connect();
+$collection = new CollectInfo($redis); 
+$power = $collection->getPower($_POST["id"]);
+if($power<20){
+	$respond["status"]=1;
+    $respond["message"]="No Power For Edit";
+    echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+    exit;
+}
+
+
+add_edit_event(_COLLECTION_EDIT_,$_POST["id"]);
 
-PDO_Connect(""._FILE_DB_USER_ARTICLE_);
+PDO_Connect(_FILE_DB_USER_ARTICLE_);
 
 $query="UPDATE collect SET title = ? , subtitle = ? , summary = ?, article_list = ?  ,  status = ? , lang = ? , receive_time= ?  , modify_time= ?   where  id = ?  ";
 $sth = $PDO->prepare($query);
@@ -21,6 +41,10 @@ if (!$sth || ($sth && $sth->errorCode() != 0)) {
 	$respond['message']=$error[2];
 }
 else{
+	if($redis){
+		$redis->del("collection://".$_POST["id"]);
+		$redis->del("power://collection/".$_POST["id"]);
+	}
     # 更新 article_list 表
     $query = "DELETE FROM article_list WHERE collect_id = ? ";
      PDO_Execute($query,array($_POST["id"]));
@@ -32,6 +56,10 @@ else{
         $sth = $PDO->prepare($query);
         foreach ($arrList as $row) {
             $sth->execute(array($_POST["id"],$row->article,$row->level,$row->title));
+			if($redis){
+				#删除article权限缓存
+				$redis->del("power://article/".$row->article);
+			}
         }
         $PDO->commit();
         if (!$sth || ($sth && $sth->errorCode() != 0)) {

+ 14 - 0
app/article/my_collect_put.php

@@ -6,6 +6,20 @@ require_once '../hostsetting/function.php';
 require_once "../ucenter/active.php";
 
 $respond=array("status"=>0,"message"=>"");
+if(!isset($_COOKIE["userid"])){
+	#不登录不能新建
+	$respond['status']=1;
+	$respond['message']="no power create article";
+	echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+	exit;
+}
+if(!isset($_POST["title"])){
+	#无标题不能新建
+	$respond['status']=1;
+	$respond['message']="no title";
+	echo json_encode($respond, JSON_UNESCAPED_UNICODE);
+	exit;
+}
 PDO_Connect(""._FILE_DB_USER_ARTICLE_);
 
 $query="INSERT INTO collect ( id,  title  , subtitle  , summary , article_list   , owner, lang  , status  , create_time , modify_time , receive_time   )  VALUES  ( ? , ? , ? , ?  , ? , ? , ? , ? , ? , ? , ? ) ";

+ 79 - 2
app/collect/function.php

@@ -1,14 +1,19 @@
 <?php
 require_once '../path.php';
+require_once "../share/function.php";
+
 
 class CollectInfo
 {
     private $dbh;
     private $buffer;
-    public function __construct() {
+	private $_redis;
+
+    public function __construct($redis=false) {
         $dns = ""._FILE_DB_USER_ARTICLE_;
         $this->dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
         $this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
+		$this->_redis=$redis;
         $buffer = array();
     }
 
@@ -20,7 +25,7 @@ class CollectInfo
             return $buffer[$id];
         }
         if($this->dbh){
-            $query = "SELECT id,title FROM collect WHERE id= ? limit 0,10";
+            $query = "SELECT id,title,owner,status,lang FROM collect WHERE id= ?";
             $stmt = $this->dbh->prepare($query);
             $stmt->execute(array($id));
 			$collect = $stmt->fetch(PDO::FETCH_ASSOC);
@@ -38,5 +43,77 @@ class CollectInfo
             return $buffer[$id];
         }
     }
+
+	public function getArticleList($id){
+        if(empty($id)){
+            return array();
+        }
+        if($this->dbh){
+            $query = "SELECT article_id FROM article_list WHERE collect_id= ? limit 0,1000";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($id));
+			$article_list = $stmt->fetchAll(PDO::FETCH_ASSOC);
+			$output=array();
+			foreach ($article_list as $key => $value) {
+				# code...
+				$output[]=$value["article_id"];
+			}
+			return $output;
+        }
+        else{
+            return array();
+        }
+    }
+
+	public function getPower($id){
+		#查询用户对此是否有权限	
+		if(isset($_COOKIE["userid"])){
+			$userId = $_COOKIE["userid"];
+		}
+		else{
+			$userId='0';
+		}
+		if($this->_redis!==false){
+			$power = $this->_redis->hGet("power://collection/".$id,$userId);
+			if($power!==FALSE){
+				return $power;
+			}
+		}
+		$iPower = 0;
+		$query = "SELECT owner,status FROM collect WHERE id=?  ";
+		$stmt = $this->dbh->prepare($query);
+		$stmt->execute(array($id));
+		$result = $stmt->fetch(PDO::FETCH_ASSOC);
+		if($result){
+			if(!isset($_COOKIE["userid"])){
+				#未登录用户
+				if($result["status"]==30){
+					#全网公开有读取和建议权限
+					return 10;
+				}
+				else{
+					#其他状态没有任何权限
+					return 0;
+				}
+			}
+			else{
+				if($result["owner"]==$_COOKIE["userid"]){
+					#自己的
+					return 30;
+				}
+				else if($result["status"]>=30){
+					#全网公开的 可以提交pr
+					$iPower = 10;
+				}			
+			}
+			#查询共享权限,如果共享权限更大,覆盖上面的的
+			$sharePower = share_get_res_power($userId,$id);
+			if($sharePower>$iPower){
+				$iPower=$sharePower;
+			}
+			$this->_redis->hSet("power://collection/".$id,$userId,$iPower);			
+		}
+		return $iPower;
+	}
 }
 ?>

+ 2 - 2
app/collect/list.php

@@ -23,8 +23,8 @@ require_once '../ucenter/function.php';
     else{
         $begin = 0;
     }
-    PDO_Connect(""._FILE_DB_USER_ARTICLE_);
-    $query = "SELECT * FROM collect  where  1 ";
+    PDO_Connect(_FILE_DB_USER_ARTICLE_);
+    $query = "SELECT * FROM collect  where  status>=30 ";
     if(isset($_GET["orderby"])){
         switch ($_GET["orderby"]) {
             case 'like':

+ 1 - 0
app/dict/redis_comp_part.php

@@ -1,5 +1,6 @@
 <?php
 #从自动复合词数据库中提取数据到ridis
+#已经废弃
 require_once "../path.php";
 require_once "../redis/function.php";
 

+ 10 - 0
app/group/group.js

@@ -210,6 +210,16 @@ function group_list(id, list) {
 										"' target='_blank'>编辑</a>";
 									break;
 								case 4: //collection
+									html += "<use xlink:href='../studio/svg/icon.svg#collection'></use>";
+									cardUrl = "../collect/card.php";
+									doing +=
+										"<a href='../article/?collect=" +
+										iterator.res_id +
+										"' target='_blank'>查看</a>";
+									doing +=
+										"|<a href='../article/my_collect_edit.php?id=" +
+										iterator.res_id +
+										"' target='_blank'>编辑</a>";
 									break;
 								case 5: //channel片段
 									break;

+ 35 - 1
app/share/coop_del.php

@@ -6,12 +6,15 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../ucenter/function.php';
 require_once '../group/function.php';
+require_once "../redis/function.php";
+require_once "../collect/function.php";
 
 $respond['status']=0;
 $respond['message']="成功";
 if(isset($_POST["res_id"])){
-	PDO_Connect(_FILE_DB_USER_SHARE_);
+	$redis = redis_connect();
 
+	PDO_Connect(_FILE_DB_USER_SHARE_);
     $query = "DELETE FROM share_cooperator WHERE res_id=? and cooperator_id = ? ";
 	$sth = $PDO->prepare($query);
 	if($sth)
@@ -31,6 +34,37 @@ if(isset($_POST["res_id"])){
 		else{
 			$respond['status']=0;
 			$respond['message']="成功";
+			if($redis){
+				switch ((int)$_POST["res_type"]) {
+					case 1:
+						# pcs
+						$redis->del("power://pcs/".$_POST["res_id"]);
+						break;
+					case 2:
+						# channel
+						$redis->del("power://channel/".$_POST["res_id"]);
+						break;
+					case 3:
+						# code...
+						$redis->del("power://article/".$_POST["res_id"]);
+						break;
+					case 4:
+						# 文集
+						$redis->del("power://collection/".$_POST["res_id"]);
+						# 删除文章列表权限缓存
+						$collection = new CollectInfo($redis);
+						$articleList = $collection->getArticleList($_POST["res_id"]);
+						foreach ($articleList as $key => $value) {
+							# code...
+							$redis->del("power://article/".$value);
+						}
+						
+						break;											
+					default:
+						# code...
+						break;
+				}
+			}
 		}							
 	}
 

+ 33 - 1
app/share/coop_post.php

@@ -6,12 +6,14 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../ucenter/function.php';
 require_once '../group/function.php';
+require_once "../redis/function.php";
+require_once "../collect/function.php";
 
 $respond['status']=0;
 $respond['message']="成功";
 if(isset($_POST["res_id"])){
+	$redis = redis_connect();
 	PDO_Connect(_FILE_DB_USER_SHARE_);
-
     $query = "UPDATE share_cooperator set power = ? WHERE res_id=? and cooperator_id = ? ";
 	$sth = $PDO->prepare($query);
 	if($sth)
@@ -32,6 +34,36 @@ if(isset($_POST["res_id"])){
 		else{
 			$respond['status']=0;
 			$respond['message']="成功";
+			if($redis){
+				switch ((int)$_POST["res_type"]) {
+					case 1:
+						# pcs
+						$redis->del("power://pcs/".$_POST["res_id"]);
+						break;
+					case 2:
+						# channel
+						$redis->del("power://channel/".$_POST["res_id"]);
+						break;
+					case 3:
+						# code...
+						$redis->del("power://article/".$_POST["res_id"]);
+						break;
+					case 4:
+						# 文集
+						$redis->del("power://collection/".$_POST["res_id"]);
+						# 删除文章列表权限缓存
+						$collection = new CollectInfo($redis);
+						$articleList = $collection->getArticleList($_POST["res_id"]);
+						foreach ($articleList as $key => $value) {
+							# code...
+							$redis->del("power://article/".$value);
+						}
+						break;											
+					default:
+						# code...
+						break;
+				}
+			}
 		}							
 	}
 

+ 33 - 0
app/share/coop_put.php

@@ -6,10 +6,13 @@ require_once "../public/_pdo.php";
 require_once '../public/function.php';
 require_once '../ucenter/function.php';
 require_once '../group/function.php';
+require_once "../redis/function.php";
+require_once "../collect/function.php";
 
 $respond['status']=0;
 $respond['message']="成功";
 if(isset($_POST["res_id"])){
+	$redis = redis_connect();
 	PDO_Connect(_FILE_DB_USER_SHARE_);
 	$PDO->beginTransaction();
     $query = "INSERT  INTO share_cooperator ('id','res_id','res_type','cooperator_id','cooperator_type','power','create_time','modify_time','is_deleted') VALUES (null,?,?,?,?,?,?,?,?) ";
@@ -41,6 +44,36 @@ if(isset($_POST["res_id"])){
 	else{
 		$respond['status']=0;
 		$respond['message']="成功";
+		if($redis){
+			switch ((int)$_POST["res_type"]) {
+				case 1:
+					# pcs
+					$redis->del("power://pcs/".$_POST["res_id"]);
+					break;
+				case 2:
+					# channel
+					$redis->del("power://channel/".$_POST["res_id"]);
+					break;
+				case 3:
+					# code...
+					$redis->del("power://article/".$_POST["res_id"]);
+					break;
+				case 4:
+					# 文集
+					$redis->del("power://collection/".$_POST["res_id"]);
+					# 删除文章列表权限缓存
+					$collection = new CollectInfo($redis);
+					$articleList = $collection->getArticleList($_POST["res_id"]);
+					foreach ($articleList as $key => $value) {
+						# code...
+						$redis->del("power://article/".$value);
+					}					
+					break;											
+				default:
+					# code...
+					break;
+			}
+		}
 	}	
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
 }

+ 19 - 0
app/share/function.php

@@ -5,6 +5,7 @@ require_once '../public/function.php';
 require_once '../ucenter/function.php';
 require_once '../channal/function.php';
 require_once '../article/function.php';
+require_once '../collect/function.php';
 require_once '../redis/function.php';
 require_once '../doc/function.php';
 /*
@@ -66,6 +67,7 @@ function share_res_list_get($userid,$res_type=-1){
 	}
 	$channel = new Channal(); 
 	$article = new Article($redis); 
+	$collection = new CollectInfo($redis); 
 	foreach ($resList as $key => $res) {
 		# 获取资源标题 和所有者 
 		switch ($res["res_type"]) {
@@ -107,6 +109,19 @@ function share_res_list_get($userid,$res_type=-1){
 				break;
 			case 4:
 				# 4 Collection 文集
+				$aInfo = $collection->get($res["res_id"]);
+				if($aInfo){
+					$resList[$key]["res_title"]=$aInfo["title"];
+					$resList[$key]["res_owner_id"]=$aInfo["owner"];
+					$resList[$key]["status"]=$aInfo["status"];
+					$resList[$key]["lang"]=$aInfo["lang"];
+				}
+				else{
+					$resList[$key]["res_title"]="_unkown_";
+					$resList[$key]["res_owner_id"]="_unkown_";
+					$resList[$key]["status"]="0";
+					$resList[$key]["lang"]="unkow";
+				}
 				break;
 			case 5:
 				# code...
@@ -124,6 +139,10 @@ function share_res_list_get($userid,$res_type=-1){
 
 //获取对某个共享资源的权限
 function share_get_res_power($userid,$res_id){
+		if($userid==='0'){
+			#未登录用户 没有共享资源
+			return 0;
+		}
 		# 找我加入的群
 		$dbhGroup = new PDO(_FILE_DB_GROUP_, "", "");
 		$dbhGroup->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 2
app/studio/index_tool_bar.php


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
app/studio/svg/icon.svg


+ 47 - 15
app/term/note.js

@@ -553,7 +553,7 @@ function note_json_html(in_json) {
 	output += "begin='" + in_json.begin + "' ";
 	output += "end='" + in_json.end + "' ";
 	output += " >";
-	output += "<span class='' onclick='add_new_tran_button_click(this)' title='"+gLocal.gui.add_tran+"'>➕</span>";
+	output += "<span class='' onclick='add_new_tran_button_click(this)' title='" + gLocal.gui.add_tran + "'>➕</span>";
 	output += "<div class='tran_text_tool_bar'>";
 	output += "</div>";
 	output += "</span>";
@@ -563,14 +563,25 @@ function note_json_html(in_json) {
 	output += "<span class='more_tran icon_expand'></span>";
 	//其他译文工具条
 	output += "<span class='other_bar'  >";
-	output += "<span class='other_tran_span' title='" + gLocal.gui.other + gLocal.gui.translation + "'>🧲"+gLocal.gui.translation+"</span>";
+	output +=
+		"<span class='other_tran_span' title='" +
+		gLocal.gui.other +
+		gLocal.gui.translation +
+		"'>🧲" +
+		gLocal.gui.translation +
+		"</span>";
 	output += "<span class='other_tran_num'></span>";
 	output += "</span>";
 	output += "<span class='separate_line'></span>";
 
 	//手工义注
 	output += "<span class='other_bar'  >";
-	output += "<span class='other_tran_span commentray' title='📔" + gLocal.gui.vannana + "'>🪔"+gLocal.gui.commentary+"</span>";
+	output +=
+		"<span class='other_tran_span commentray' title='📔" +
+		gLocal.gui.vannana +
+		"'>🪔" +
+		gLocal.gui.commentary +
+		"</span>";
 	output += "<span class='other_tran_num'></span>";
 	output += "</span>";
 	output += "<span class='separate_line'></span>";
@@ -583,7 +594,9 @@ function note_json_html(in_json) {
 			in_json.pali_sent_id +
 			"')\" title='" +
 			gLocal.gui.similar_sentences +
-			"'>🧬"+gLocal.gui.similar+"</span>";
+			"'>🧬" +
+			gLocal.gui.similar +
+			"</span>";
 		output += "<span class='similar_sent_num'>" + in_json.sim + "</span>";
 		output += "</span>";
 		output += "<span class='separate_line'></span>";
@@ -658,12 +671,21 @@ function render_one_sent_tran_a(iterator) {
 	let tranText;
 	let sid = iterator.book + "-" + iterator.para + "-" + iterator.begin + "-" + iterator.end;
 	if (iterator.text == "") {
-		tranText =
-			"<span style='color:var(--border-line-color);'>" +
-			iterator.channalinfo.name +
-			"-" +
-			iterator.channalinfo.lang +
-			"</span>";
+		if (typeof iterator.channalinfo == "undefined") {
+			tranText =
+				"<span style='color:var(--border-line-color);'>" +
+				"空" +
+				"@" +
+				iterator.editor_name.nickname +
+				"</span>";
+		} else {
+			tranText =
+				"<span style='color:var(--border-line-color);'>" +
+				iterator.channalinfo.name +
+				"-" +
+				iterator.channalinfo.lang +
+				"</span>";
+		}
 	} else {
 		//note_init处理句子链接
 		tranText = note_init(term_std_str_to_tran(iterator.text, iterator.channal, iterator.editor, iterator.lang));
@@ -875,9 +897,21 @@ function render_one_sent_tran_a(iterator) {
 		html += '<span class="name">' + iterator.editor_name.nickname + "</span>";
 	}
 	if (iterator.id != "") {
-		html += '<span class="channel">' + gLocal.gui.updated + " @" + iterator.channalinfo.name + "</span>";
+		html += '<span class="channel">' + gLocal.gui.updated + " @";
+		if (typeof iterator.channalinfo == "undefined") {
+			html += "unkown";
+		} else {
+			html += iterator.channalinfo.name;
+		}
+		html += "</span>";
 	} else {
-		html += '<span class="channel">' + gLocal.gui.no_updated + " @" + iterator.channalinfo.name + "</span>";
+		html += '<span class="channel">' + gLocal.gui.no_updated + " @";
+		if (typeof iterator.channalinfo == "undefined") {
+			html += "unkown";
+		} else {
+			html += iterator.channalinfo.name;
+		}
+		html += "</span>";
 	}
 
 	html += '<ul class="tag_list">';
@@ -1157,9 +1191,7 @@ function set_more_button_display() {
 		} else {
 			//隐藏自己
 			//$(this).hide();
-			$(this)
-				.find(".other_tran_span")
-				.addClass("disable");//gLocal.gui.no + gLocal.gui.other + gLocal.gui.translation
+			$(this).find(".other_tran_span").addClass("disable"); //gLocal.gui.no + gLocal.gui.other + gLocal.gui.translation
 			//$(this).find(".more_tran").hide();
 		}
 	});

+ 0 - 1
app/term/note.php

@@ -272,7 +272,6 @@ foreach ($_data as $key => $value) {
         } else {
             $translation[$key]["channalinfo"] = false;
         }
-
     }
 
     //查询路径

+ 4 - 0
app/usent/get.php

@@ -78,6 +78,10 @@ foreach ($Fetch as $key => $value) {
         $Fetch[$key]["c_owner"] = $user_info->getName($channel["owner"]);
         $Fetch[$key]["channalinfo"] = $channel;
     }
+	else{
+		$Fetch[$key]["c_name"] = "unkow";
+        $Fetch[$key]["c_owner"] = "unkow";
+	}
 	$Fetch[$key]["editor_name"]=$user_info->getName($value["editor"]);
 	$Fetch[$key]["update_time"]=$value["modify_time"];
 

Vissa filer visades inte eftersom för många filer har ändrats