Ver código fonte

增加个人空间

visuddhinanda 5 anos atrás
pai
commit
e3bd232878

+ 5 - 2
app/course/course.php

@@ -18,7 +18,7 @@ include "../pcdl/html_head.php";
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
-require_once '../media/function.php';
+require_once '../ucenter/function.php';
 require_once '../public/function.php';
 
 global $PDO;
@@ -35,7 +35,10 @@ $course_info = $Fetch[0];
 echo "<div id='course_head_bar' style='background-color:var(--tool-bg-color1);padding:1em 10px 10px 10px;'>";
 echo "<div class='index_inner '>";
 echo "<div style='font-size:140%'>";
-echo $course_info["teacher"]." > ";
+echo "<a href='../uhome/course.php?userid={$course_info["teacher"]}'>";
+echo ucenter_getA($course_info["teacher"]);
+echo "</a>";
+echo " > ";
 echo $course_info["title"];
 echo "</div>";
 echo '<div class="summary"  style="padding-bottom:5px;">'.$course_info["subtitle"].'</div>';

+ 9 - 1
app/course/course_list.php

@@ -6,9 +6,17 @@ require_once "../public/_pdo.php";
 require_once '../public/load_lang.php';
 require_once '../media/function.php';
 
+if(isset($_GET["teacher"])){
+    $teacher = " teacher = '".$_GET["teacher"]."'";
+}
+else{
+    $teacher = " 1= 1";
+}
+
 global $PDO;
 PDO_Connect("sqlite:"._FILE_DB_COURSE_);
-$query = "select * from course where 1  order by create_time DESC limit 0,100";
+
+$query = "select * from course where $teacher  order by create_time DESC limit 0,100";
 $Fetch = PDO_FetchAll($query);
 echo json_encode($Fetch, JSON_UNESCAPED_UNICODE);
 

+ 6 - 10
app/course/list_new.php

@@ -4,21 +4,13 @@
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/load_lang.php';
-require_once '../media/function.php';
+require_once '../ucenter/function.php';
 
 global $PDO;
 PDO_Connect("sqlite:"._FILE_DB_COURSE_);
 $query = "select * from course where 1  order by create_time DESC limit 0,4";
 $Fetch = PDO_FetchAll($query);
 
-$coverList = array();
-foreach($Fetch as $row){
-    $coverList[] = $row["cover"];
-}
-$covers = media_get($coverList);
-foreach ($covers as $value) {
-    $cover["{$value["id"]}"] = $value["link"];
-}
 foreach($Fetch as $row){
     echo '<div class="content_block">';
     echo '<div class="card">';
@@ -26,7 +18,11 @@ foreach($Fetch as $row){
     echo '<div class="pd-10">';
     echo '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../course/course.php?id='.$row["id"].'">'.$row["title"].'</a></div>';
     echo '<div class="summary"  style="padding-bottom:5px;">'.$row["subtitle"].'</div>';
-    echo '<div class="author"  style="padding-bottom:5px;margin-bottom:0.4em;">主讲:'.$row["teacher"].'</div>';    
+    echo '<div class="author"  style="padding-bottom:5px;margin-bottom:0.4em;">主讲:';
+    echo '<a href="../uhome/course.php?userid='.$row['teacher'].'">';
+    echo ucenter_getA($row["teacher"]);
+    echo '</a>';
+    echo '</div>';    
     echo '<div class="summary"  style="padding-bottom:5px;">'.$row["summary"].'</div>';
     echo '</div>';
     echo '<div class="pd-10" style="display:flex;justify-content: space-between;">';

+ 2 - 2
app/course/teacher_list.php

@@ -4,7 +4,7 @@
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once '../public/load_lang.php';
-require_once '../media/function.php';
+require_once '../ucenter/function.php';
 
 global $PDO;
 PDO_Connect("sqlite:"._FILE_DB_COURSE_);
@@ -14,7 +14,7 @@ $Fetch = PDO_FetchAll($query);
 foreach($Fetch as $value){
     echo '<div class="content_block">';
     echo '<div class="card pd-10">';
-    echo '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../course/course.php?id='.$row["id"].'">'.$value['teacher'].'</a></div>';
+    echo '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../uhome/course.php?userid='.$value['teacher'].'">'.ucenter_getA($value['teacher']).'</a></div>';
     
     $query = "select id, title  from course where teacher = '{$value['teacher']}'  order by create_time DESC limit 0,5";
     $FetchTeacher = PDO_FetchAll($query);

+ 0 - 13
app/palicanon/index.php

@@ -84,7 +84,6 @@ echo '</div>';
     var main_tag="";
     var list_tag=new Array();
     
-
     $("span[tag]").click(function(){
         $(this).siblings().removeClass("select");
         $(this).addClass("select");
@@ -92,18 +91,6 @@ echo '</div>';
         list_tag=new Array();
         tag_changed();
         render_tag_list();
-        /*
-        const tagSelected = document.getElementsByClassName("select");
-        if(tagSelected){
-            let tagList = new Array();
-            for (const iterator of tagSelected) {
-                tagList.push(iterator.getAttributeNode("tag").value);
-            }
-            main_tag = tagList[0];
-
-            tag_changed();
-        }
-        */
   });
   var allTags = new Array();
   function tag_changed(){

+ 4 - 4
app/pcdl/reader.php

@@ -166,7 +166,8 @@ para:hover{
 }
 .sent_toc{
 	font-weight:700;
-	font-size:120%;
+	font-family: Noto serif;
+    font-size: 150%;
 }
 </style>
 		<!-- tool bar begin-->
@@ -356,6 +357,7 @@ else{
 			$toc2Level = 0;
 			echo "<div><div>";
 			foreach ($chapter_toc as $key => $value) {
+				$tocList[$value["paragraph"]] = $value["level"];
 				$classCurrToc="";
 				$classCurrToc2 = "";
 				$classCurrTocTitle2="";
@@ -412,7 +414,7 @@ else{
 				//右侧目录
 				
 				if($value["paragraph"]>$currParaBegin && $value["paragraph"]<$currParaEnd){
-					$tocList[$value["paragraph"]] = $value["level"];
+					//$tocList[$value["paragraph"]] = $value["level"];
 					$htmlToc2 .= "<div><a href='#para_{$value["paragraph"]}'>{$value["toc"]}</a></div>";
 				}
 				
@@ -556,8 +558,6 @@ else{
 		break;
 	}
 	echo "</div>";
-
-
 	//生成一个段落空壳 等会儿查询数据,按照不同数据类型填充进去
 	PDO_Connect("sqlite:"._FILE_DB_PALI_SENTENCE_);
 

+ 1 - 1
app/studio/js/message.js

@@ -889,7 +889,7 @@ function show_tran_net(book, para, begin, end) {
           "<div class='trans_text_info'>" +
           "<span><span class='author'>" +
           iterator.author +
-          "</span><span class='tag'>笔记</span></span>" +
+          "</span><span class='tag'>tag</span></span>" +
           "<span class='tools'>" +
           "<button>采纳</button>" +
           "</span>" +

+ 3 - 3
app/ucenter/function.php

@@ -19,18 +19,18 @@ function ucenter_get($userid,$fields="username"){
 
 }
 
-function ucenter_getA($userid,$fields){
+function ucenter_getA($userid,$fields="nickname"){
     //打开数据库
     $dns = "sqlite:"._FILE_DB_USERINFO_;
     $dbh = new PDO($dns, "", "",array(PDO::ATTR_PERSISTENT=>true));
     $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);  
-    $query = "select username from user where userid= ? ";
+    $query = "select username,nickname from user where userid= ? ";
     $stmt = $dbh->prepare($query);
     $stmt->execute(array($userid));
     $fUser = $stmt->fetchAll(PDO::FETCH_ASSOC);
     $dbh=null;
     if(count($fUser)>0){
-        return($fUser[0]["username"]);
+        return($fUser[0][$fields]);
     }
     else{
         return("");

+ 6 - 0
app/ucenter/user.php

@@ -93,6 +93,12 @@
 					</svg>
 					<?php echo $_local->gui->logout;?>
 				</a>
+				<a href='../uhome/index.php?userid=<?php echo $_COOKIE["userid"];?>'>
+					<svg class="icon">
+						<use xlink:href="../studio/svg/icon.svg#ic_exit_to_app_24px"></use>
+					</svg>
+					<?php echo "我的空间";?>
+				</a>
 			</div>
 
 				<?php

+ 49 - 0
app/uhome/course.php

@@ -0,0 +1,49 @@
+<?PHP
+include "../pcdl/html_head.php";
+?>
+<body>
+
+<?php
+    require_once "../path.php";
+    require_once "../public/_pdo.php";
+    require_once '../public/function.php';
+    require_once '../ucenter/function.php';
+    require_once "../pcdl/head_bar.php";
+    $currChannal = "course";
+    require_once "../uhome/head.php";
+?>
+
+<div class='index_inner'>
+<div id="course_list">
+</div>
+</div>
+<script>
+	$.get("../course/course_list.php",
+    {
+    teacher:"<?php echo $_GET["userid"]; ?>"
+    },
+    function(data,status){
+        let arrData = JSON.parse(data);
+        let html="";
+        for (const iterator of arrData) {
+            html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';
+
+            html += '<div style="flex:7;">';
+            html +=  '<div class="title" style="padding-bottom:5px;font-size:110%;font-weight:600;"><a href="../course/course.php?id='+iterator.id+'">'+iterator.title+'</a></div>';
+            html += '<div class="summary"  style="padding-bottom:5px;">'+iterator.subtitle+'</div>';
+            html += '<div class="summary"  style="padding-bottom:5px;">'+iterator.summary+'</div>';
+
+            html += '</div>';
+
+            html += '<div style="flex:3;max-width:15em;">';
+
+            html += '</div>';
+
+            html += '</div>';
+            $("#course_list").html(html);
+        }
+	});
+</script>
+<?php
+include "../pcdl/html_foot.php";
+?>

+ 54 - 0
app/uhome/head.php

@@ -0,0 +1,54 @@
+<style>
+    #main_video_win iframe{
+        width:100%;
+        height:100%;
+    }
+    #main_tag span{
+        margin: 2px;
+        color:black;
+        padding: 2px 12px 0 12px;
+        font-weight: 500;
+        transition-duration: 0.2s;
+        cursor: pointer;
+        display: inline-flex;
+        align-items: center;
+        flex-wrap: nowrap;
+        justify-content: center;
+        font-size:110%;
+        border: unset;
+        border-radius: 0;
+        border-bottom: 2px solid var(--nocolor);
+    }
+    #main_tag span:hover{
+        background-color:unset;
+        border-color: var(--link-hover-color);
+    }
+    #main_tag .select{
+        border-bottom: 2px solid var(--link-color);
+    }
+</style>
+
+<div id='course_head_bar' style='background-color:var(--tool-bg-color1);padding:1em 10px 0 10px;'>
+    <div class='index_inner '>
+        <div style='display:flex;'>
+            <div style='font-size:280%;flex:7;'>
+                <?php echo ucenter_getA($_GET["userid"]);?>
+            </div>
+            <div  style="display: inline-block;"><button>关注</button><button>分享</button></div>
+        </div>
+
+        <div id="main_tag"  style="">
+            <a href="trans.php?userid=<?php echo $_GET["userid"];?>"><span tag="译文">译文</span></a>
+            <?php 
+                if(isset($currChannal) && $currChannal=="course"){
+                    echo '<span class="select" tag="课程">课程</span>';
+                }
+                else{
+                    echo '<a href="course.php?userid='.$_GET["userid"].'"><span tag="课程">课程</span></a>';
+                }
+            ?>
+            <span tag="经验">经验</span>
+            <span tag="统计">统计</span>
+        </div>
+    </div>
+</div>

+ 19 - 0
app/uhome/index.php

@@ -1,3 +1,22 @@
+<?PHP
+include "../pcdl/html_head.php";
+?>
+<body>
+
 <?php
+    require_once "../path.php";
+    require_once "../public/_pdo.php";
+    require_once '../public/function.php';
+    require_once '../ucenter/function.php';
+    require_once "../pcdl/head_bar.php";
+    require_once "../uhome/head.php";
+?>
+
+<div class='index_inner'>
+</div>
+<script>
 
+</script>
+<?php
+include "../pcdl/html_foot.php";
 ?>

+ 23 - 22
documents/development/functions.md

@@ -11,7 +11,7 @@
 
 # PCD Suite 设计原则
 
-- **可重用的数据** 从逐词解析到整篇译文。所有的数据应该是可重用的。可重用意味着在技术层面应该存储计算机可辨识格式的数据。
+- **可重用的数据** 从逐词解析到整篇译文。所有的数据应该是可重用的。可重用意味着在技术层面应该存储计算机可辨识格式的数据。
 
 ```
 应该存储
@@ -22,12 +22,12 @@
 }
 
 不应存储
-citta:nt. 心;缤纷;
+citta:中性 心;缤纷;
 ```
 
 - **智能重用** 程序应根据经文类型(经藏或律藏)或其他特征,提供提供不同的数据给用户。或将数据列表按信心指数排序。以减少不必要的人工劳动。
 - **公共版权** 有版权的信息与前两条原则违背。所以,一切在本平台公开的数据都应使用公共版权。
-- **平等的发言权** 每个平台的使用者都有权发表自己的观点。平台不应以人工的方式评价观点的正确性或给予排名靠前或靠后的操作。但是平台应该记录和向所有人提供信息发布者的使用经验数值(如:使用平台时间,发表信息量,被点赞量等)供阅读者自己判断信息的可用性。没有实质内容的信息(如:“很好”;“太差了”),管理员应根据过滤规则,将信息隐藏。在读者选择“查看隐藏的内容”时展示。
+- **平等的发言权** 每个平台的使用者都有权发表自己的观点。平台不应以官方的角度用人工的方式评价观点的正确性或给予排名靠前或靠后的操作。但是平台应该记录和向所有人提供统计数据,如:信息发布者的使用经验数值(使用平台时间,发表信息量,被点赞量等),阅读者的阅读数据(阅读量,收藏量)供阅读者自己判断信息的可用性。没有实质内容的信息(如:“很好”;“太差了”等)将对读者造成困扰,增加读者搜寻有用信息的时间。管理员应根据判定规则,将信息隐藏。在读者选择“查看隐藏的内容”时展示。
 
 # 程序架构设计
 
@@ -90,16 +90,13 @@ www.wikipali.org
 
 ### 尚未实现的功能(目前的需求)
 
-#### 最新课程列表
-
-- 报名数字显示和报名功能
-
-#### 最新三藏译文列表
+- **最新课程列表**-报名数字显示和报名功能
 
-#### 手机版 css
+- 最新三藏译文列表
 
-- 写不同的 css 在手机端和 pc 看到不同的页面。
-- 不一定用 css 切换,可以使用不同的技术实现方式。
+- 手机版 css
+  - 写不同的 css 在手机端和 pc 看到不同的页面。
+  - 不一定用 css 切换,可以使用不同的技术实现方式。
 
 ### 未来可能的发展
 
@@ -165,27 +162,31 @@ www.wikipali.org/palicanon
 
 ## 经典阅读器
 
-## 译经楼-欢迎页
+# 译经楼 Studio
+
+## 欢迎页
+
+## 经文选择
 
-## 译经楼-经文选择
+## 最近打开
 
-## 译经楼-最近打开
+## 协作
 
-## 译经楼-协作
+## 课程管理
 
-## 译经楼-课程管理
+## 用户字典管理
 
-## 译经楼-用户字典管理
+## 百科字典管理
 
-## 译经楼-百科字典管理
+## 工作组管理
 
-## 译经楼-工作组管理
+# 用户中心
 
-## 用户中心-登录
+## 登录
 
-## 用户中心-注册
+## 注册
 
-## 用户中心-用户设置
+## 用户设置
 
 # 网站后台管理