Преглед изворни кода

Merge pull request #1016 from visuddhinanda/laravel

圣典栏目与最新更新分离
visuddhinanda пре 3 година
родитељ
комит
6174b5a982

+ 55 - 0
app/Console/Commands/TestMq.php

@@ -0,0 +1,55 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+use PhpAmqpLib\Connection\AMQPStreamConnection;
+use PhpAmqpLib\Message\AMQPMessage;
+
+
+class TestMq extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'test:mq ';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+		$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
+		$channel = $connection->channel();
+		$channel->queue_declare('hello', false, false, false, false);
+
+		$msg = new AMQPMessage('Hello World!');
+		$channel->basic_publish($msg, '', 'hello');
+		
+		echo " [x] Sent 'Hello World!'\n";
+		$channel->close();
+		$connection->close();
+        return 0;
+    }
+}

+ 60 - 0
app/Console/Commands/TestMqWorker.php

@@ -0,0 +1,60 @@
+<?php
+
+namespace App\Console\Commands;
+
+use Illuminate\Console\Command;
+
+use PhpAmqpLib\Connection\AMQPStreamConnection;
+
+class TestMqWorker extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'test:mqworker';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = 'Command description';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle()
+    {
+		$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
+		$channel = $connection->channel();
+
+		$channel->queue_declare('hello', false, false, false, false);
+
+		echo " [*] Waiting for messages. To exit press CTRL+C\n";
+
+		$callback = function ($msg) {
+			echo ' [x] Received ', $msg->body, "\n";
+		  };
+		  
+		$channel->basic_consume('hello', '', false, true, false, false, $callback);
+		  
+		while ($channel->is_open()) {
+			  $channel->wait();
+		  }
+        return 0;
+    }
+}

+ 9 - 1
app/Http/Controllers/ProgressChapterController.php

@@ -2,6 +2,8 @@
 
 namespace App\Http\Controllers;
 
+require_once __DIR__.'/../../../public/app/ucenter/function.php';
+
 use Illuminate\Support\Str;
 use Illuminate\Support\Facades\DB;
 use App\Models\ProgressChapter;
@@ -53,7 +55,13 @@ class ProgressChapterController extends Controller
                 break;
 			case 'studio':
                 #查询该studio的channel
-                $channels = Channel::where('owner_uid',$request->get('id'))->select('uid')->get();
+				$name = $request->get('name');
+				$userinfo = new \UserInfo();
+				$studio = $userinfo->getUserByName($name);
+				if($studio == false){
+					return $this->error('no user');
+				}
+                $channels = Channel::where('owner_uid',$studio['userid'])->select('uid')->get();
                 $aChannel = [];
                 foreach ($channels as $channel) {
                     # code...

+ 3 - 1
change-logs.md

@@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
-## [Unreleased]
+## [1.0.11] - 2022-09-6
+
+add doctrine/dbal
 
 ## [1.0.10] - 2022-07-31
 

+ 3 - 1
composer.json

@@ -6,12 +6,14 @@
     "license": "MIT",
     "require": {
         "php": "^7.3|^8.0",
+        "doctrine/dbal": "^3.4",
         "fruitcake/laravel-cors": "^2.0",
         "godruoyi/php-snowflake": "^2.0",
         "guzzlehttp/guzzle": "^7.0.1",
         "laravel/framework": "^8.75",
         "laravel/sanctum": "^2.11",
-        "laravel/tinker": "^2.5"
+        "laravel/tinker": "^2.5",
+		"php-amqplib/php-amqplib": ">=3.0"
     },
     "require-dev": {
         "facade/ignition": "^2.5",

+ 1 - 1
dashboard/.umirc.ts

@@ -4,7 +4,7 @@ export default defineConfig({
 	nodeModulesTransform: {
 		type: 'none',
 	},
-	base: '/my/',
+	base: '/',
 	fastRefresh: {},
 
 });

+ 1 - 0
dashboard/package.json

@@ -22,6 +22,7 @@
   "dependencies": {
     "@ant-design/pro-layout": "^6.5.0",
     "@umijs/preset-react": "1.x",
+    "lua-in-js": "^2.2.0",
     "umi": "^3.4.25"
   },
   "devDependencies": {

+ 49 - 0
dashboard/src/components/chapterlistitem.tsx

@@ -0,0 +1,49 @@
+import {Link} from 'umi';
+import { Breadcrumb} from "antd";
+import { WarningOutlined,LoadingOutlined  } from '@ant-design/icons';
+import { Col, Row } from 'antd';
+
+type IWidgetChapterListItem ={
+	title: string,
+	path:string,
+	summary:string,
+	url:string,
+	like:number,
+	hit:number,
+	favorite:number,
+	watch:number,
+	created_at:string,
+	updated_at:string,
+  }
+  
+  export const ChapterListItem = (item: IWidgetChapterListItem) => {
+	let routes = new Array;
+	for (const iterator of JSON.parse(item.path)) {
+		routes.push({
+			path:'/app/article/?view=chapter&book='+iterator.book+'&par='+iterator.paragraph,
+			breadcrumbName:iterator.title,
+		}) ;
+	}
+	function itemRender(route,params,routes,paths){
+		return (
+			<Link to={route.path}>{route.breadcrumbName}</Link>
+		)
+	}
+	return (
+	  <div>
+		<Row>
+			<Col xs={24} xl={14}><Link to={item.url}>{item.title}</Link></Col>
+			<Col xs={0} xl={10}>点赞(1)</Col>
+		</Row>
+		<Row>
+			<Col xs={24} xl={0}>点赞(1)</Col>
+			<Col xs={0} xl={0}></Col>
+		</Row>
+		<Row>
+			<Col xs={24} xl={0}><Breadcrumb itemRender={itemRender} routes={routes} /></Col>
+			<Col xs={0} xl={0}></Col>
+		</Row>
+		<div>{item.summary}</div>
+	  </div>
+	);
+  }

+ 30 - 9
dashboard/src/pages/[username]/index.tsx

@@ -1,10 +1,31 @@
-import {Link} from 'umi';
-
-export default ({match}) => {
-  return (
-    <div>
-      <h1>welcome to  {match.params.username} zone</h1>
-      <Link to="/demo">Go home</Link>
-    </div>
-  )
+import React from 'react';
+import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor, List, Avatar } from "antd";
+import { Row, Col } from "antd";
+import { UserOutlined, LaptopOutlined, NotificationOutlined } from "@ant-design/icons";
+import { Footer } from "antd/lib/layout/layout";
+import { useState } from 'react';
+import { MessageOutlined, LikeOutlined, StarOutlined } from '@ant-design/icons';
+import { Link, history } from 'umi';
+
+const { Header, Content, Sider } = Layout;
+
+export default ({ match }) => {
+	return (
+
+		<Layout>
+			<Layout>
+				<h1>welcome to  {match.params.username} zone</h1>
+			</Layout>
+			<Header className="header">
+				<Menu theme="dark" mode="horizontal" defaultSelectedKeys={['1']}>
+					<Menu.Item key="1" >首页</Menu.Item>
+					<Menu.Item key="2" onClick={() => history.push('/' + match.params.username + '/translation')}>译文</Menu.Item>
+					<Menu.Item key="3" onClick={() => history.push('/' + match.params.username + '/course')}>课程</Menu.Item>
+					<Menu.Item key="4" onClick={() => history.push('/' + match.params.username + '/article')}>文集</Menu.Item>
+				</Menu>
+			</Header>
+
+		</Layout>
+
+	)
 }

+ 139 - 0
dashboard/src/pages/[username]/translation/index.tsx

@@ -0,0 +1,139 @@
+import React, { useEffect } from 'react';
+import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor, List, Avatar } from "antd";
+import { Row, Col } from "antd";
+import { UserOutlined, LaptopOutlined, NotificationOutlined } from "@ant-design/icons";
+import { Footer } from "antd/lib/layout/layout";
+import { useState } from 'react';
+import { MessageOutlined, LikeOutlined, StarOutlined } from '@ant-design/icons';
+import { Link, history } from 'umi';
+import { ChapterListItem } from '@/components/chapterlistitem'
+
+const { SubMenu } = Menu;
+const { Header, Content, Sider } = Layout;
+
+const it = [
+	{ lable: 'menu1', key: 'menu1' }
+];
+const items = [
+	{
+		label: '经藏',
+		key: 'sutta',
+		tag: 'sutta',
+		children: [
+			{ label: '长部', key: 'sutta-digha', tag: 'sutta,digha' },
+			{ label: '中部', key: 'sutta-majjima', tag: 'sutta,majjima' },
+		]
+	},
+	{
+		label: '律藏',
+		key: 'vinaya',
+		tag: 'vinaya',
+		children: [
+			{ label: '大分别', key: 'vinaya-maha', tag: 'sutta,digha' },
+			{ label: '比库尼分别', key: 'vinaya-bhikkhuni', tag: 'sutta,majjima' },
+		]
+	},
+]
+
+export default ({ match }) => {
+	const [tableData, setTableData] = useState();
+
+
+	function getTableData() {
+		let url = 'http://127.0.0.1:8000/api/v2/progress?view=studio&name=' + match.params.username;
+		fetch(url)
+			.then(function (response) {
+				console.log("ajex:", response);
+				return response.json();
+			})
+			.then(function (myJson) {
+				console.log("ajex", myJson.data);
+				for (let iterator of myJson.data.rows) {
+					if (iterator.title == '') {
+						iterator.title = iterator.toc;
+					}
+					iterator.description = iterator.summary;
+					iterator.href = "/app/article/?view=chapter&book=" + iterator.book + "&par=" + iterator.para + '&channel=' + iterator.channel_id;
+					iterator.avatar = 'https://joeschmoe.io/api/v1/random';
+				}
+				setTableData(myJson.data.rows);
+			});
+	}
+	window.onload = function () {
+		getTableData();
+	}
+	return (
+		<Layout>
+			<Layout>
+				<h1>welcome to  {match.params.username} zone</h1>
+			</Layout>
+			<Header className="header">
+				<Menu theme="dark" mode="horizontal" defaultSelectedKeys={['2']}>
+					<Menu.Item key="1" onClick={() => history.push('/' + match.params.username)}>首页</Menu.Item>
+					<Menu.Item key="2" >译文</Menu.Item>
+					<Menu.Item key="3" onClick={() => history.push('/' + match.params.username + '/course')}>课程</Menu.Item>
+					<Menu.Item key="4">文集</Menu.Item>
+				</Menu>
+			</Header>
+			<Layout onClick={getTableData}>
+				<Affix offsetTop={0}>
+					<Sider
+						className="site-layout-background"
+						breakpoint="lg"
+						collapsedWidth="0"
+						onBreakpoint={broken => {
+							console.log(broken);
+						}}
+						onCollapse={(collapsed, type) => {
+							console.log(collapsed, type);
+						}}
+					>
+						<Menu
+							mode="inline"
+							defaultSelectedKeys={['1']}
+							defaultOpenKeys={['sub1']}
+							style={{ height: '100%', borderRight: 0 }}
+							items={items}
+						/>
+
+					</Sider>
+				</Affix>
+
+				<List
+					itemLayout="vertical"
+					size="large"
+					pagination={{
+						pageSize: 10,
+					}}
+					dataSource={tableData}
+					renderItem={item => (
+						<List.Item>
+							<ChapterListItem
+								title={item.title}
+								summary={item.summary}
+								path={item.path}
+								url={item.href}
+							/>
+						</List.Item>
+					)
+					}
+					footer={
+						<div>
+							<b>ant design</b> footer part
+						</div>
+					}
+				/>
+
+				<Affix offsetTop={0}>
+					<Sider
+						className="site-layout-background"
+						breakpoint="lg"
+						collapsedWidth="0"
+					>
+					</Sider>
+				</Affix>
+			</Layout>
+		</Layout>
+
+	)
+}

+ 86 - 101
dashboard/src/pages/demo/day-4.tsx

@@ -1,5 +1,5 @@
 import React from 'react';
-import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor,List, Avatar } from "antd";
+import { Affix, Layout, Menu, Breadcrumb, Table, Tag, Space, Pagination, message, notification, Anchor, List, Avatar } from "antd";
 import { Row, Col } from "antd";
 import { UserOutlined, LaptopOutlined, NotificationOutlined } from "@ant-design/icons";
 import { Footer } from "antd/lib/layout/layout";
@@ -17,38 +17,38 @@ message.config({
 });
 
 const data = [
-  {
-    title: '梵网经',
-  },
-  {
-    title: '沙门果经',
-  },
-  {
-    title: '盐块经',
-  },
-  {
-    title: '根修习经',
-  },
+	{
+		title: '梵网经',
+	},
+	{
+		title: '沙门果经',
+	},
+	{
+		title: '盐块经',
+	},
+	{
+		title: '根修习经',
+	},
 ];
 
 const listData = [];
 for (let i = 0; i < 23; i++) {
-  listData.push({
-    href: 'https://ant.design',
-    title: `ant design part ${i}`,
-    avatar: 'https://joeschmoe.io/api/v1/random',
-    description:
-      'Ant Design, a design language for background applications, is refined by Ant UED Team.',
-    content:
-      'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
-  });
+	listData.push({
+		href: 'https://ant.design',
+		title: `ant design part ${i}`,
+		avatar: 'https://joeschmoe.io/api/v1/random',
+		description:
+			'Ant Design, a design language for background applications, is refined by Ant UED Team.',
+		content:
+			'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
+	});
 }
 
 const IconText = ({ icon, text }) => (
-  <Space>
-    {React.createElement(icon)}
-    {text}
-  </Space>
+	<Space>
+		{React.createElement(icon)}
+		{text}
+	</Space>
 );
 
 function handleClick(e) {
@@ -80,26 +80,26 @@ export default () => {
 	const [tableData, setTableData] = useState();
 
 
-	function getTableData(e){
-        //let url='https://gorest.co.in/public-api/posts';
-        let url='http://127.0.0.1:8000/api/v2/progress?view=tag';
+	function getTableData(e) {
+		//let url='https://gorest.co.in/public-api/posts';
+		let url = 'http://127.0.0.1:8000/api/v2/progress?view=tag';
 		fetch(url)
 			.then(function (response) {
 				console.log("ajex:", response);
 				return response.json();
 			})
 			.then(function (myJson) {
-				console.log("ajex",myJson.data);
-                for (let iterator of myJson.data.rows) {
-                    if(iterator.title==''){
-                        iterator.title = iterator.toc;
-                    }
-                    iterator.description = iterator.toc;
-                    iterator.href="http://127.0.0.1:8000/app/article/?view=chapter&book="+iterator.book+"&par="+iterator.para+'&channel='+iterator.channel_id;
-                    iterator.avatar = 'https://joeschmoe.io/api/v1/random';
-                }
+				console.log("ajex", myJson.data);
+				for (let iterator of myJson.data.rows) {
+					if (iterator.title == '') {
+						iterator.title = iterator.toc;
+					}
+					iterator.description = iterator.toc;
+					iterator.href = "http://127.0.0.1:8000/app/article/?view=chapter&book=" + iterator.book + "&par=" + iterator.para + '&channel=' + iterator.channel_id;
+					iterator.avatar = 'https://joeschmoe.io/api/v1/random';
+				}
 				setTableData(myJson.data.rows);
-			});		
+			});
 	}
 	function pageChange(page: number, pagesize?: number | undefined) {
 		setcommitTime(page);
@@ -136,25 +136,26 @@ export default () => {
 					</SubMenu>
 				</Menu>
 			</Header>
+			
 			<Layout>
 				<Affix offsetTop={top}>
-					<Sider 
-                        className="site-layout-background"
-                        breakpoint="lg"
-                        collapsedWidth="0"
-                        onBreakpoint={broken => {
-                            console.log(broken);
-                        }}
-                        onCollapse={(collapsed, type) => {
-                            console.log(collapsed, type);
-                        }}
-                    >
+					<Sider
+						className="site-layout-background"
+						breakpoint="lg"
+						collapsedWidth="0"
+						onBreakpoint={broken => {
+							console.log(broken);
+						}}
+						onCollapse={(collapsed, type) => {
+							console.log(collapsed, type);
+						}}
+					>
 						<Menu
 							mode="inline"
 							defaultSelectedKeys={['1']}
 							defaultOpenKeys={['sub1']}
 							style={{ height: '100%', borderRight: 0 }}
-                            onClick={getTableData}
+							onClick={getTableData}
 						>
 							<SubMenu key="sutta" icon={<UserOutlined />} title="经藏">
 								<Menu.Item key="dn">长部</Menu.Item>
@@ -200,61 +201,45 @@ export default () => {
 							width: "100%",
 							overflowX: "auto",
 						}}>
-<List
-    itemLayout="vertical"
-    size="large"
-    pagination={{
-      onChange: page => {
-        console.log(page);
-      },
-      pageSize: 10,
-    }}
-    dataSource={tableData}
-    footer={
-      <div>
-        <b>ant design</b> footer part
-      </div>
-    }
-    renderItem={item => (
-      <List.Item
-        key={item.title}
-        actions={[
-          <IconText icon={StarOutlined} text={item.progress} key="list-vertical-star-o" />,
-          <IconText icon={LikeOutlined} text={item.created_at} key="list-vertical-like-o" />,
-          <IconText icon={MessageOutlined} text="2" key="list-vertical-message" />,
-        ]}
+						<List
+							itemLayout="vertical"
+							size="large"
+							pagination={{
+								onChange: page => {
+									console.log(page);
+								},
+								pageSize: 10,
+							}}
+							dataSource={tableData}
+							footer={
+								<div>
+									<b>ant design</b> footer part
+								</div>
+							}
 
-      >
-        <List.Item.Meta
-          avatar={<Avatar src={item.avatar} />}
-          title={<a href={item.href} target='_blank'>{item.title}</a>}
-          description={item.description}
-        />
-      </List.Item>
-    )}
-  />
+						/>
 					</Content>
 				</Layout>
 				<Affix offsetTop={top}>
 					<Sider
-                    className="site-layout-background"
-                        breakpoint="lg"
-                        collapsedWidth="0"
-                    >
-<List
-    header={<div>本周最新</div>}
-    itemLayout="horizontal"
-    dataSource={data}
-    renderItem={item => (
-      <List.Item>
-        <List.Item.Meta
-          avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
-          title={<a href="https://ant.design">{item.title}</a>}
-          description="Ant Design, a design language for background applications, is refined by Ant UED Team"
-        />
-      </List.Item>
-    )}
-  />
+						className="site-layout-background"
+						breakpoint="lg"
+						collapsedWidth="0"
+					>
+						<List
+							header={<div>本周最新</div>}
+							itemLayout="horizontal"
+							dataSource={data}
+							renderItem={item => (
+								<List.Item>
+									<List.Item.Meta
+										avatar={<Avatar src="https://joeschmoe.io/api/v1/random" />}
+										title={<a href="https://ant.design">{item.title}</a>}
+										description="Ant Design, a design language for background applications, is refined by Ant UED Team"
+									/>
+								</List.Item>
+							)}
+						/>
 					</Sider>
 				</Affix>
 			</Layout>

BIN
documents/images/module.png


+ 0 - 2
documents/proto/dictionary.proto

@@ -13,7 +13,6 @@ package pcds.dictionary.v1;
 service Dictionary{
 	//词典管理
 	rpc GetDictListForStudio (DictListRequest) returns (DictListReply){} //列出 studio 里面的全部字典
-	rpc GetDictListForChannel (DictListRequest) returns (DictListReply){} //列出 channel 里面的全部字典
 	rpc GetDict (DictRequest) returns (DictReply){}
 	rpc SetDict (DictRequest) returns (DictReply){}
 	rpc AddDict (DictRequest) returns (DictReply){}
@@ -22,7 +21,6 @@ service Dictionary{
 	//单词管理
 	rpc GetWordListForStudio (WordListRequest) returns (WordListReply){}
 	rpc GetWordListForDict (WordListRequest) returns (WordListReply){}
-	rpc GetWordListForChannel (WordListRequest) returns (WordListReply){} //这个 channel 里面的全部术语
 	rpc GetWord (WordRequest) returns (DictReply){}
 	rpc SetWord (WordRequest) returns (DictReply){}
 	rpc AddWord (WordRequest) returns (DictReply){}

+ 321 - 0
public/app/community/index.php

@@ -0,0 +1,321 @@
+<?PHP
+require_once "../pcdl/html_head.php";
+?>
+
+<body>
+    <script src="../palicanon/palicanon.js"></script>
+    <script src="../term/term.js"></script>
+
+<?php
+    require_once "../pcdl/head_bar.php";
+?>
+
+	<link type="text/css" rel="stylesheet" href="../palicanon/style.css" />
+	<link type="text/css" rel="stylesheet" href="../palicanon/style_mobile.css" media="screen and (max-width:800px)">
+
+
+    <script>
+        var tag_level = <?php echo file_get_contents("../public/book_tag/tag_list.json"); ?>;
+    </script>
+<?php
+//
+
+require_once "../config.php";
+require_once '../media/function.php';
+require_once '../public/function.php';
+?>
+
+<link href="../../node_modules/jquery.fancytree/dist/skin-win7/ui.fancytree.css" rel="stylesheet" type="text/css" class="skinswitcher">
+<script src="../tree/jquery.fancytree.js" type="text/javascript"></script>
+
+	<script src="../widget/like.js"></script>
+	<link type="text/css" rel="stylesheet" href="../widget/like.css"/>
+	<script src="../palicanon/chapter_channel.js"></script>
+	<link type="text/css" rel="stylesheet" href="../palicanon/chapter_channel.css"/>
+	<link type="text/css" rel="stylesheet" href="../palicanon/loading.css"/>
+
+    <script src="../palicanon/router.js"></script>
+    <script src="../palicanon/test.js"></script>
+    <script src="../palicanon/my_space.js"></script>
+
+<style>
+
+
+</style>
+
+<?php
+    if(isset($_GET["view"])){
+        $_view = $_GET["view"];
+    }else{
+        $_view = "community";
+    }
+?>
+
+<div id='main_view' >
+    <div id='left-bar' >
+        <div id='left-bar-inner'>
+            <div class="filter submenu">
+                <div class="title submenu_title" style="flex;">
+                    <span>分类</span>
+                    <span>
+                        <select id="tag_category_index" onchange="TagCategoryIndexchange(this)"></select>
+                    </span>
+                </div>
+                <div class='inner' style='max-height: unset;'>
+                    <div id='tag-category' ></div>
+                </div>
+            </div>
+            <div class="filter submenu">
+                <div class="title submenu_title"><span>作者</span></div>
+                <div class='inner' id='filter-author' >
+                    <div  class="lds-ellipsis" ><div></div><div></div><div></div><div></div></div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div id='course_head_bar' >
+        <div class='index_inner '>
+            <div style='display:flex;justify-content: space-between;display:none;'>
+                <div> </div>
+                <div style=''>
+                    <select onchange='viewChanged(this)'>
+                        <option value='list'>列表</option>                    
+                        <option value='card'>卡片</option>
+                    </select>
+                </div>
+            </div>
+			<div>
+				<div id='tag_list_setting_div'>
+                            
+                    <div class='inner' id='filter-setting' style='display: flex;'>
+							<button id='btn-filter' onclick="tag_list_slide_toggle(this)">
+								标签过滤
+                    		</button>
+							<div class='settting-item'>
+								<span></span>
+								<span>
+									<select id='setting_lang'>
+										<option value='auto'>自动选择语言</option>
+										<option value=''>全部语言</option>
+										<option value='zh'>中文</option>
+										<option value='en'>英文</option>
+									</select>
+								</span>
+							</div>
+                                <div class='settting-item'>
+                                    <span></span>
+                                    <span>
+                                        <select id='setting_channel_type'>
+                                            <option value=''>全部类型</option>
+                                            <option value='translation' selected >译文</option>
+                                            <option value='nissaya'>Nissaya</option>
+                                            <option value='commentray'>注疏</option>
+                                        </select>
+                                    </span>
+                                </div>
+                                <div class='settting-item'>
+                                    <span>完成度</span>
+                                    <span>
+                                        <select id='setting_progress'>
+                                            <option value='0.9'>90</option>
+                                            <option value='0.8'>80</option>
+                                            <option value='0.5'>50</option>
+                                            <option value='0.2'>20</option>
+                                        </select>
+                                    </span>
+                                </div>
+                                <div style='display:flex;justify-content: space-between;'><button>还原默认</button><button onclick="updateSetting()">应用</button></div>
+                            </div>
+                        </div>
+                </div>			
+			</div>
+            <div>
+                <div class='main_menu' id = 'main_menu'>
+
+            </div>
+            <div id="main_tag"  style="display:none;">
+                <span tag="sutta" title="sutta"></span>
+                <span tag="vinaya"  title="vinaya"></span>
+                <span tag="abhidhamma" title="abhidhamma"></span>
+                <span tag="mūla" title="mūla"></span>
+                <span tag="aṭṭhakathā" title="aṭṭhakathā"></span>
+                <span tag="ṭīkā" title="ṭīkā"></span>
+                <span tag="añña" title="añña"></span>
+            </div>
+            <div>
+                <div id="tag_list" style='display:none;'>
+                    <div id="tag_list_head" style="display:flex;justify-content: space-between;border-bottom: 1px solid var(--border-line-color);">
+                        <div style='width:20em;'>
+                            
+                        </div>
+                        <div>
+                            <button id="btn-tag_list_close" onclick='close_tag_list()'>X</button>
+                        </div>
+                    </div>
+
+                    <div id='tag_list_inner'>
+                        <div id='tag_list_tag_div'>
+                            <h2>标签</h2>
+                            <div><input id="tag_input" type="input" placeholder="tag search" size="20"></div>
+                            <div level="0" class="tag_others"></div>
+                            <div level="1" class="tag_others"></div>
+                            <div level="2" class="tag_others"></div>
+                            <div level="3" class="tag_others"></div>
+                            <div level="4" class="tag_others"></div>
+                            <div level="5" class="tag_others"></div>
+                            <div level="100" class="tag_others"></div>
+                            <div level="8" class="tag_others"></div>
+                        </div>
+
+                    </div>
+                </div>
+            </div>
+            <div id="select_bar" >
+                <div id="select_bar_home" onclick='categoryGoHome()'>
+                <span>
+                    <svg class='icon' style='fill: var(--box-bg-color1)'>
+                        <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#house'>
+                    </svg>
+                </span>
+                <span>
+                    <svg class='icon' style='fill: var(--box-bg-color1)'>
+                        <use xlink:href='../../node_modules/bootstrap-icons/bootstrap-icons.svg#chevron-compact-right'>
+                    </svg>
+                </span>
+                </div>
+                <div id="channel_selected"></div>
+                <div id="tag_selected"></div>
+            </div>
+
+            <div id='palicanon-category'></div>
+
+            
+            <div id='filter_bar'>
+                <div id='filter_bar_left'></div>
+                <div id='filter_bar_right'>
+
+                </div>
+            </div>
+
+			<div id="index_div">
+				<div id='file_background'></div>
+				<div id = "file_list_div">
+					<div id='bread-crumbs'></div>
+					<div class='index_inner'>
+						<div id="chapter_shell" class="chapter_list" >
+							<div id="list_shell_1" class="show" level="1">
+								<ul id="list-1" class="grid" level="1" >
+								</ul>
+							</div>
+
+							<div id="list_shell_2" level="2">
+								<ul id="list-2" class="hidden" level="2"  >
+								</ul>
+							</div>
+
+							<div id="list_shell_3" level="3">
+								<ul id="list-3" class="hidden" level="3" >
+								</ul>
+							</div>
+
+							<div id="list_shell_4" level="4">
+								<ul id="list-4" class="hidden" level="4" >
+								</ul>
+							</div>
+
+							<div id="list_shell_5" level="5">
+								<ul id="list-5" class="hidden" level="5" >
+								</ul>
+							</div>
+
+							<div id="list_shell_6" level="6">
+								<ul id="list-6" class="hidden" level="6" >
+								</ul>
+							</div>
+
+							<div id="list_shell_7" level="7">
+								<ul id="list-7" class="hidden" level="7" >
+								</ul>
+							</div>
+
+							<div id="list_shell_8" level="8">
+								<ul id="list-8" class="hidden" level="8" >
+								</ul>
+							</div>
+
+						</div>
+					</div>
+				</div>
+			</div>
+        </div>
+    </div>
+    <div style="flex:2;">
+    <div class='bangdan' id = "user_recent">
+        <div class='title'>最近阅读</div>
+        <div class='list'>
+            <div class="lds-ellipsis" ><div></div><div></div><div></div><div></div></div>
+        </div>
+    </div>
+    <div class='bangdan' id='contribution'>
+        <div class='title'>月度贡献</div>
+        <div class='list'>
+            <div class="lds-ellipsis" ><div></div><div></div><div></div><div></div></div>
+        </div>
+    </div>
+    </div>
+</div>
+
+
+
+    <script>
+        $(document).ready(function() {
+			$("#nav_community").addClass('active');
+            
+            let indexFilename = localStorage.getItem('palicanon_tag_category');
+            if(!indexFilename){
+                indexFilename = "defualt";
+            }
+            loadTagCategory(indexFilename);
+            loadTagCategoryIndex();
+            loadFilterSetting();//载入上次的过滤器配置
+            LoadAllLanguage();
+			_view = 'community';
+            updataHistory();
+            <?php
+
+            if(isset($_GET["tag"])){
+                echo "_tags = '{$_GET["tag"]}';";
+            }
+            if(isset($_GET["channel"])){
+                echo "_channel = '{$_GET["channel"]}';";
+            }
+            
+            switch ($_view) {
+                case 'community':
+                    //echo "community_onload();";
+                    break;
+                case 'category':
+                    //echo "palicanon_onload();";
+                    break;
+                case 'my';
+                default:
+                    # code...
+                    break;
+            }
+            ?>
+            list_tag = _tags.split(',');
+            refresh_selected_tag();
+            //ReanderMainMenu();
+            updateFirstListView();
+            //载入用户最近的阅读列表
+            loadUserRecent();
+            loadContribution();
+			//TODO 处理标签搜索
+			$("#tag_input").keypress(function () {
+				tag_render_others();
+			});
+        });
+    </script>
+<?php
+include "../pcdl/html_foot.php";
+?>

+ 1 - 1
public/app/palicanon/category/cscd.json

@@ -748,7 +748,7 @@
                     },
                     {
                         "name":"Abhidhammatthasaṅgaho",
-                        "tag":["ṭīkā","abhidhamma","abhidhammatthasaṅgaho"]
+                        "tag":["ṭīkā","abhidhamma","abhidhammatthasaṅgaha"]
                     },
                     {
                         "name":"Abhidhammāvatāra-Purāṇaṭīkā",

+ 34 - 0
public/app/palicanon/category/defualt.json

@@ -294,6 +294,40 @@
                     {
                         "name":"Paṭṭhāna",
                         "tag":["abhidhamma","paṭṭhāna"]
+                    },
+                    {
+                        "name":"Añña",
+                        "tag":[],
+						"children":[
+							{
+								"name":"Abhidhammatthasaṅgaho",
+								"tag":["abhidhamma","abhidhammatthasaṅgaha"]
+							},
+							{
+								"name":"Abhidhammāvatāra",
+								"tag":["abhidhamma","abhidhammāvatāra"]
+							},
+							{
+								"name":"Nāmarūpaparicchedo",
+								"tag":["abhidhamma","nāmarūpapariccheda"]
+							},
+							{
+								"name":"Paramatthavinicchayo",
+								"tag":["abhidhamma","paramatthavinicchaya"]
+							},
+							{
+								"name":"Saccasaṅkhepo",
+								"tag":["abhidhamma","saccasaṅkhepa"]
+							},
+							{
+								"name":"Abhidhammamātikāpāḷi",
+								"tag":["abhidhamma","abhidhammamātikāpāḷi"]
+							},
+							{
+								"name":"Mohavicchedanī",
+								"tag":["abhidhamma","mohavicchedanī"]
+							}
+						]
                     }
                 ]
             },

+ 3 - 7
public/app/palicanon/index.php

@@ -278,13 +278,9 @@ require_once '../public/function.php';
             loadTagCategoryIndex();
             loadFilterSetting();//载入上次的过滤器配置
             LoadAllLanguage();
+			_view = 'category';
+            updataHistory();
             <?php
-            if(isset($_GET["view"])){
-                echo "_view = '{$_GET["view"]}';";
-            }else{
-                echo "_view = 'community';";
-                echo "updataHistory();";
-            }
 
             if(isset($_GET["tag"])){
                 echo "_tags = '{$_GET["tag"]}';";
@@ -308,7 +304,7 @@ require_once '../public/function.php';
             ?>
             list_tag = _tags.split(',');
             refresh_selected_tag();
-            ReanderMainMenu();
+            //ReanderMainMenu();
             updateFirstListView();
             //载入用户最近的阅读列表
             loadUserRecent();

+ 4 - 4
public/app/palicanon/palicanon.js

@@ -1123,7 +1123,7 @@ function renderPalicanonCategoryList(){
 }
 
 function loadTagCategory(name="defualt"){
-    $.getJSON("./category/"+name+".json",function(result){
+    $.getJSON("../palicanon/category/"+name+".json",function(result){
 
         _palicanonCategory = result;
         _palicanonCategoryCurrent = _palicanonCategory.slice();
@@ -1166,7 +1166,7 @@ function tocGetTagCategory(data){
 }
 
 function loadTagCategoryIndex(){
-    $.getJSON("./category/index.json",function(result){
+    $.getJSON("../palicanon/category/index.json",function(result){
             let indexFilename = localStorage.getItem('palicanon_tag_category');
             if(!indexFilename){
                 indexFilename = "defualt";
@@ -1259,8 +1259,8 @@ function LoadAllLanguage(){
 		{},
 		function (data, status) {
             let html = "";
-            html += "<option value='auto'>自动</option>";
-            html += "<option value=''>全部</option>";
+            html += "<option value='auto'>自动选择语言</option>";
+            html += "<option value=''>全部语言</option>";
             for (const iterator of data.data.rows) {
                 if(iterator.lang!=''){
                     html += "<option value='"+iterator.lang+"' ";

+ 1 - 1
public/app/palicanon/style.css

@@ -324,7 +324,7 @@ li.level_1.selected {
 .bangdan li{
     list-style-type:unset;
     white-space: nowrap;
-    /*overflow: auto; 单独列表取消滚动条*/
+    overflow: hidden;
 }
 .bangdan ol{
     padding-left: 1.5em;

+ 3 - 2
public/app/pcdl/head_bar.php

@@ -452,6 +452,7 @@
 	}
 </style>
 <?php
+//根据用户界面语言设置显示对应的帮助文件
 $help_lang = '';
 switch($_COOKIE['language']){
 	case "zh-cn":
@@ -461,7 +462,7 @@ switch($_COOKIE['language']){
 		$help_lang = "zh-Hans";
 		break;
 	default:
-		$help_lang = "zh-Hans";
+		$help_lang = "en-US";
 }
 ?>
 <!-- new tool bar begin-->
@@ -487,9 +488,9 @@ switch($_COOKIE['language']){
 	<input type="checkbox" id="nav-toggle" class="nav-toggle">
 	<nav>
 		<ul>
+			<li class="nav_link" id="nav_community"><a href="../community/"><?php echo "最新"; ?></a></li>
 			<li class="nav_link" id="nav_palicanon"><a href="../palicanon/"><?php echo $_local->gui->pali_canon; ?></a></li>
 			<li class="nav_link" id="nav_course"><a href="../course/"><?php echo $_local->gui->lesson; ?></a></li>
-			<li class="nav_link" id="nav_wiki"><a href="../wiki/"><?php echo $_local->gui->encyclopedia; ?></a></li>
 			<li class="nav_link" id="nav_dict"><a href="../dict/"><?php echo $_local->gui->dictionary; ?></a></li>
 			<li class="nav_link" id="nav_collection"><a href="../collect/"><?php echo $_local->gui->composition; ?></a></li>
 			<li class="nav_link"><a href="<?php echo URL_HELP.'/'.$help_lang ?>"  target="_blank"><?php echo $_local->gui->help; ?></a></li>

+ 3 - 3
public/app/reader/get_para1.php

@@ -178,10 +178,10 @@ if ($FetchParInfo) {
 				}
 				$urlChannel = "&channel={$_channel}";
 			}
-			$sToc = str_replace("[[","",$sToc);
-			$sToc = str_replace("]]","",$sToc);
+			$sToc = str_replace("[","",$sToc);
+			$sToc = str_replace("]","",$sToc);
 			$sTocOutput .= $space . "- [{$sToc}](../article/index.php?view=chapter&book={$_book}&par={$value["paragraph"]}{$urlChannel}){$progress}\n";
-		}		
+		}
 	}
 	$sTocOutput .= "\n\n";
 

+ 17 - 0
public/app/ucenter/function.php

@@ -93,6 +93,23 @@ class UserInfo
             return 0;
         }
 	}
+	public function getUserByName($name)
+    {
+        if (empty($name)) {
+            return false;
+        }
+        if ($this->dbh) {
+            $query = "SELECT id,userid,nickname,username FROM user WHERE  username= ? ";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($name));
+            $user = $stmt->fetch(PDO::FETCH_ASSOC);
+            if ($user) {
+                return $user;
+            }
+        } else {
+            return false;
+        }
+	}
 	public function check_password($userid,$password){
 		if ($this->dbh) {
             $query = "SELECT username FROM user WHERE  userid= ? and password = ? ";

+ 22 - 33
public/documents/dashboard/README.md

@@ -91,8 +91,9 @@ term -->|嵌入| wbw
 
 ```mermaid
 graph LR
-
-subgraph 前端
+home --> api_course
+home --> api_term
+home --> api_article
 	subgraph 藏经阁-Libray
     	home[首页]
 		palicanon[三藏]
@@ -101,6 +102,23 @@ subgraph 前端
 		search[搜索]
 		myzone[个人空间]
 	end
+
+	subgraph API
+	api_user[用户]
+	api_channel[版本]
+	api_term[术语]
+	api_dict[字典]
+	api_course[课程]
+	api_group[工作组]
+	api_palicanon[语料库]
+	api_translation[译文]
+	api_article[文章文集]
+	api_wbw[逐词解析]
+	api_search[全文搜索]
+	api_history[浏览记录]
+	api_others[其他工具表]
+end
+
 	subgraph 译经楼-Studio
 		stu_home[首页]
 		stu_pali[三藏分类]
@@ -115,43 +133,14 @@ subgraph 前端
 		stu_article[文章]
 		stu_collection[文集]
 		统计数据
+		用户认证
 	end
-	subgraph 用户-User
-		sign_up[注册]
-		sign_in[登陆]
-		找回密码
-		个性化设置
-	end
+
 	subgraph 实用工具
 		佛历
 		圣典编码转换
 	end
-	subgraph 后台管理
-		栏目内容管理
-		用户管理
-		数据表管理
-	end
-end
 
-subgraph API
-	api_user(用户)
-	api_channel(版本)
-	api_term[术语]
-	api_dict[字典]
-	api_course[课程]
-	api_group[工作组]
-	api_palicanon[语料库]
-	api_translation[译文]
-	api_article[文章文集]
-	api_wbw[逐词解析]
-	api_search[全文搜索]
-	api_history[浏览记录]
-	api_others[其他工具表]
-end
-
-home --> api_course
-home --> api_term
-home --> api_article
 
 palicanon --> api_palicanon
 palicanon --> api_term