Browse Source

我的空间界面完成 自动切分优化

visuddhinanda 5 years ago
parent
commit
011efc75e5

+ 1 - 0
app/course/course.js

@@ -38,6 +38,7 @@ function course_load(course_id) {
 				// end of course_info_head_2
 				html += "</div>";
 				//end of head
+
 				//summary
 				if (course_info.summary.length > 0) {
 					html += "<div id='course_info_summary' class='course_info_block'>";

+ 1 - 142
app/course/course.php

@@ -11,148 +11,7 @@ include "../pcdl/html_head.php";
     ?>
 
     <link type="text/css" rel="stylesheet" href="./style.css" />
-    <style>
-        .disable {
-            cursor: not-allowed;
-            opacity: 0.5;
-        }
-
-        .padding_2_1rem {
-            padding: 2rem 1rem;
-        }
-
-        #main_video_win iframe {
-            width: 100%;
-            height: 100%;
-        }
-
-        #course_frame {
-            display: flex;
-        }
-
-        #course_content {
-            margin: 0;
-            padding: 0;
-        }
-
-        #course_info_head_1 {
-            display: grid;
-            grid-template-columns: 200px 1fr;
-            grid-gap: 20px;
-        }
-
-        #course_info_head_face img {
-            width: 200px;
-            height: 200px;
-            border-radius: 12px;
-            object-fit: cover;
-        }
-
-        .section_inner {
-            max-width: 960px;
-            margin: 0 auto;
-        }
-
-        #course_info_head_title {
-            display: flex;
-            flex-direction: column;
-            word-wrap: break-word;
-        }
-
-        #course_title {
-            font-size: 22px;
-            font-weight: 700;
-        }
-
-        #course_subtitle {
-            font-size: 13px;
-            padding: 10px 0;
-            word-wrap: break-word;
-        }
-
-        #course_button {
-            margin-top: auto;
-        }
-
-        #lesson_list_shell {
-            padding: 2rem 1rem;
-            background-color: #f5f5f5;
-        }
-
-        .course_info_block {
-            padding: 1rem 0;
-        }
-
-        #course_info_summary {
-            border-top: 1px solid var(--border-line-color);
-            border-bottom: 1px solid var(--border-line-color);
-        }
-
-        .course_info_block h2 {
-            font-size: 16px;
-        }
-
-        #lesson_list {
-            column-count: 2;
-            position: relative;
-        }
-
-        #lesson_list .lesson_card {
-            padding: 10px 10px 10px 0;
-            -webkit-column-break-inside: avoid;
-            page-break-inside: avoid;
-            break-inside: avoid;
-        }
-
-        .datatime {
-            display: inline;
-        }
-
-        .not_started {
-            background-color: orangered;
-            color: var(--bg-color);
-        }
-
-        .in_progress,
-        .already_over {
-            color: var(--btn-hover-bg-color);
-        }
-
-        .lesson_card .title {
-            margin-top: 5px;
-            font-size: 17px;
-            font-weight: 600;
-            display: -webkit-box;
-            -webkit-box-orient: vertical;
-            overflow: hidden;
-            text-overflow: ellipsis;
-            width: 100%;
-            -webkit-line-clamp: 2;
-        }
-
-        #course_info_head_2 {
-            margin: 1rem 0;
-        }
-
-        @media screen and (max-width:800px) {
-            #lesson_list {
-                column-count: 1;
-            }
-
-            #course_info_head_1 {
-                grid-template-columns: 100px 1fr;
-                grid-gap: 10px;
-            }
-
-            #course_info_head_face,
-            #course_info_head_face img {
-                width: 100px;
-                height: 100px;
-                border-radius: 6px;
-            }
-        }
-    </style>
-
+    <link type="text/css" rel="stylesheet" href="./mobile.css" media="screen and (max-width:800px)" />
 
 
     <div id='course_content'>

+ 15 - 0
app/course/mobile.css

@@ -0,0 +1,15 @@
+#lesson_list {
+	column-count: 1;
+}
+
+#course_info_head_1 {
+	grid-template-columns: 100px 1fr;
+	grid-gap: 10px;
+}
+
+#course_info_head_face,
+#course_info_head_face img {
+	width: 100px;
+	height: 100px;
+	border-radius: 6px;
+}

+ 123 - 1
app/course/style.css

@@ -87,4 +87,126 @@
     padding: 1rem 0;
     border-top: 1px solid var(--border-line-color);
     border-bottom: 1px solid var(--border-line-color);
-}
+}
+
+.disable {
+	cursor: not-allowed;
+	opacity: 0.5;
+}
+
+.padding_2_1rem {
+	padding: 2rem 1rem;
+}
+
+#main_video_win iframe {
+	width: 100%;
+	height: 100%;
+}
+
+#course_frame {
+	display: flex;
+}
+
+#course_content {
+	margin: 0;
+	padding: 0;
+}
+
+#course_info_head_1 {
+	display: grid;
+	grid-template-columns: 200px 1fr;
+	grid-gap: 20px;
+}
+
+#course_info_head_face img {
+	width: 200px;
+	height: 200px;
+	border-radius: 12px;
+	object-fit: cover;
+}
+
+.section_inner {
+	max-width: 960px;
+	margin: 0 auto;
+}
+
+#course_info_head_title {
+	display: flex;
+	flex-direction: column;
+	word-wrap: break-word;
+}
+
+#course_title {
+	font-size: 22px;
+	font-weight: 700;
+}
+
+#course_subtitle {
+	font-size: 13px;
+	padding: 10px 0;
+	word-wrap: break-word;
+}
+
+#course_button {
+	margin-top: auto;
+}
+
+#lesson_list_shell {
+	padding: 2rem 1rem;
+	background-color: #f5f5f5;
+}
+
+.course_info_block {
+	padding: 1rem 0;
+}
+
+#course_info_summary {
+	border-top: 1px solid var(--border-line-color);
+	border-bottom: 1px solid var(--border-line-color);
+}
+
+.course_info_block h2 {
+	font-size: 16px;
+}
+
+#lesson_list {
+	column-count: 2;
+	position: relative;
+}
+
+#lesson_list .lesson_card {
+	padding: 10px 10px 10px 0;
+	-webkit-column-break-inside: avoid;
+	page-break-inside: avoid;
+	break-inside: avoid;
+}
+
+.datatime {
+	display: inline;
+}
+
+.not_started {
+	background-color: orangered;
+	color: var(--bg-color);
+}
+
+.in_progress,
+.already_over {
+	color: var(--btn-hover-bg-color);
+}
+
+.lesson_card .title {
+	margin-top: 5px;
+	font-size: 17px;
+	font-weight: 600;
+	display: -webkit-box;
+	-webkit-box-orient: vertical;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	width: 100%;
+	-webkit-line-clamp: 2;
+}
+
+#course_info_head_2 {
+	margin: 1rem 0;
+}

+ 1 - 1
app/dict/dict.js

@@ -215,7 +215,7 @@ function render_parts_select(part_list) {
 	let html = "<div>";
 	let firstWord = new Array();
 	if (part_list.length > 0 && part_list[0].length > 0) {
-		html += "拆分";
+		html += "组成";
 		let level1Count = 0;
 		for (const part of part_list) {
 			firstWord.push(part[0].word);

+ 25 - 0
app/dict/redis_split_part.php

@@ -0,0 +1,25 @@
+<?php
+require_once "../path.php";
+require_once "../redis/function.php";
+
+if (PHP_SAPI == "cli") {
+	$redis = redis_connect();
+	if($redis!==false){
+		// 打开文件并读取数据
+		if (($fp = fopen(_DIR_DICT_TEXT_ . "/system/part.csv", "r")) !== false) {
+            while (($data = fgets($fp)) !== false) {
+				$word = explode(",",$data);
+				$len = mb_strlen($word[0], "UTF-8");
+				$len_correct = 1.2;
+				$count2 = 1.1 + pow($word[1], 1.18);
+				$conf_num = pow(1 / $count2, pow(($len - 0.5), $len_correct));
+				$cf = round(1 / (1 + 640 * $conf_num), 9);
+				$redis->hSet("dict://part.hash",$word[0],$cf);
+            }
+			fclose($fp);
+			echo "do:".$redis->hLen("dict://part.hash"). PHP_EOL;
+        } else {
+            echo "can not open csv file. ". PHP_EOL;
+        }
+	}
+}

+ 1 - 1
app/dict/split.php

@@ -203,7 +203,7 @@ foreach ($arrWords as $currword) {
         }
         $iCount = 0;
         foreach ($result as $row => $value) {
-            if ($iCount > 100) {
+            if ($iCount > 10) {
                 break;
             }
             $iCount++;

+ 109 - 21
app/dict/turbo_split.php

@@ -16,6 +16,9 @@ $dbh = new PDO($dns, "", "", array(PDO::ATTR_PERSISTENT => true));
 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 
 global $path;
+#当前搜索路径信心指数,如果过低,马上终止这个路径的搜索
+global $currPathCf;
+#内存信心指数表
 global $confidence;
 global $result;
 global $part;
@@ -168,19 +171,80 @@ function microtime_float()
     return ((float) $usec + (float) $sec);
 }
 
+
+function dict_lookup2($word){
+	global $redis;
+	global $case;	
+    if (strlen($word) <= 0) {
+        return 0;
+    }
+	if(mb_substr($word,0,1)==="["){
+		$search = $word;
+	}
+	else{
+		$search = str_replace("[","",$word);
+		$search = str_replace("]","",$search);		
+	}
+	$cf = $redis->hGet("dict://part.hash",$search);
+	if($cf==false){
+		//去除尾查
+		$newWord = array();
+		for ($row = 0; $row < count($case); $row++) {
+			$len = mb_strlen($case[$row][1], "UTF-8");
+			$end = mb_substr($search, 0 - $len, null, "UTF-8");
+			if ($end == $case[$row][1]) {
+				$base = mb_substr($search, 0, mb_strlen($search, "UTF-8") - $len, "UTF-8") . $case[$row][0];
+				if ($base != $search) {
+					$newWord[$base] = mb_strlen($case[$row][1],"UTF-8");
+				}
+			}
+		}
+		#找到最高频的base
+		$base_weight = 0;
+		$isFound = false;
+		if(count($newWord)>0){
+			foreach ($newWord as $x => $x_value) {
+				$row = $redis->hGet("dict://part.hash",$x);
+				if ($row !=false) {
+					$isFound=true;
+					if ($row > $base_weight) {
+						$base_weight = $row;
+					}
+				}
+			}
+			if($isFound){
+				$base_weight*=0.9999;
+				$redis->hSet("dict://part.hash",$search,$base_weight);
+				if (isset($_POST["debug"])) {
+					echo "查到变格:{$search}:{$base_weight}\n";
+				}				
+			}
+		}
+		return $base_weight;
+	}
+	else{
+		if (isset($_POST["debug"])) {
+			echo "查到:{$search}:{$cf}\n";
+		}
+		return $cf;
+	}
+}
 function dict_lookup($word)
 {
     if (strlen($word) <= 1) {
         return 0;
     }
     global $case;
-    global $dbh;
-    $str = strstr($word, "[");
-    if ($str === false) {
-        $search = $word;
-    } else {
-        $search = $str;
-    }
+	global $dbh;
+
+	if(mb_substr($word,0,1)==="["){
+		$search = $word;
+	}
+	else{
+		$search = str_replace("[","",$word);
+		$search = str_replace("]","",$search);		
+	}
+
     $query = "SELECT weight from part where word = ? ";
     $stmt = $dbh->prepare($query);
     $stmt->execute(array($search));
@@ -192,10 +256,10 @@ function dict_lookup($word)
         $newWord = array();
         for ($row = 0; $row < count($case); $row++) {
             $len = mb_strlen($case[$row][1], "UTF-8");
-            $end = mb_substr($word, 0 - $len, null, "UTF-8");
+            $end = mb_substr($search, 0 - $len, null, "UTF-8");
             if ($end == $case[$row][1]) {
-                $base = mb_substr($word, 0, mb_strlen($word, "UTF-8") - $len, "UTF-8") . $case[$row][0];
-                if ($base != $word) {
+                $base = mb_substr($search, 0, mb_strlen($search, "UTF-8") - $len, "UTF-8") . $case[$row][0];
+                if ($base != $search) {
                     $newWord[$base] = mb_strlen($case[$row][1],"UTF-8");
                 }
             }
@@ -229,14 +293,15 @@ function isExsit($word, $adj_len = 0)
 {
 
     global $auto_split_times;
-    global $result;
     global $part;
     global $confidence;
     $auto_split_times++;
 
     if (isset($_POST["debug"])) {
         echo "<div>正在查询:{$word}</div>";
-    }
+	}
+	//return dict_lookup2($word);
+
     $isFound = false;
     $count = 0;
     if (isset($part["{$word}"])) {
@@ -303,17 +368,22 @@ function mySplit2($strWord, $deep = 0, $express = false, $adj_len = 0, $c_thresh
     global $result;
     global $sandhi;
     $output = array();
-
+	#当前搜索路径信心指数,如果过低,马上终止这个路径的搜索
+	global $currPathCf;
+	if($deep == 0){
+		$currPathCf = 1;
+	}
     //达到最大搜索深度,返回
     if ($deep >= 16) {
         $word = "";
         $cf = 1.0;
         for ($i = 0; $i < $deep; $i++) {
             if (!empty($path[$i][0])) {
-                $word .= $path[$i][0] . "+";
+                $word .= $path[$i][0] ;
                 if (isset($_POST["debug"])) {
-                    $word .= "(" . $path[$i][1] . ")-";
-                }
+                    $word .= "(" . $path[$i][1] . ")";
+				}
+				$word .= "+";
                 $cf = $cf * $path[$i][1];
             }
         }
@@ -332,12 +402,12 @@ function mySplit2($strWord, $deep = 0, $express = false, $adj_len = 0, $c_thresh
     }
     //直接找到
     $confidence = isExsit($strWord, $adj_len);
-    if ($confidence >= 0) {
+    if ($confidence > $c_threshhold) {
         $output[] = array($strWord, "", $confidence);
 	} 
 	else {
         $confidence = isExsit("[" . $strWord . "]");
-        if ($confidence >= 0) {
+        if ($confidence > $c_threshhold) {
             $output[] = array("[" . $strWord . "]", "", $confidence);
         }
     }
@@ -411,7 +481,8 @@ function mySplit2($strWord, $deep = 0, $express = false, $adj_len = 0, $c_thresh
             $remainder = $part[1];
 
             $path[$deep][0] = $checked;
-            $path[$deep][1] = $part[2];
+			$path[$deep][1] = $part[2];
+
             if (empty($remainder)) {
                 #全切完了
                 $word = "";
@@ -442,8 +513,25 @@ function mySplit2($strWord, $deep = 0, $express = false, $adj_len = 0, $c_thresh
                     }
                 }
             } else {
-                #接着切
-                mySplit2($remainder, ($deep + 1), $express, $adj_len, $c_threshhold, $w_threshhold, $forward, $sandhi_advance);
+				#计算当前信心指数
+				$cf = 1.0;
+				for ($i = 0; $i < $deep; $i++) {
+					$cf = $cf * $path[$i][1];
+				}
+				if($cf<$w_threshhold)
+				{
+					if (isset($_POST["debug"])) {
+						echo "信心指数过低,提前返回 {$cf}<br>";
+					}
+					return;
+
+				}
+				else
+				{
+					#接着切
+					mySplit2($remainder, ($deep + 1), $express, $adj_len, $c_threshhold, $w_threshhold, $forward, $sandhi_advance);					
+				}
+
             }
         }
 	} 

+ 4 - 4
app/doc/coop.js

@@ -40,14 +40,14 @@ function username_search(keyword) {
 				}
 				let html = "<ul id='user_search_list'>";
 				if (result.length > 0) {
-					for (x in result) {
+					for (const iterator of result) {
 						html +=
 							"<li><a onclick=\"coop_add('" +
-							result[x].id +
+							iterator.id +
 							"',0)\">" +
-							result[x].username +
+							iterator.username +
 							"[" +
-							result[x].email +
+							iterator.email +
 							"]</a></li>";
 					}
 				}

+ 6 - 3
app/install/step3.php

@@ -136,7 +136,7 @@ function run_sys_dict(index,onlyOne=false){
 }
 
 var iCurrThinDictIndex=0;
-function run_ref_dict(index){
+function run_ref_dict(index,once=false){
     if(index >= thin_file_list.length){
         $("#response").html($("#response").html()+"All Down");
     }
@@ -151,8 +151,11 @@ function run_ref_dict(index){
         },
         function(data,status){
             $("#response").html($("#response").html()+data+"<br>");
-            iCurrThinDictIndex++;
-            run_ref_dict(iCurrThinDictIndex);
+			if(!once){
+				iCurrThinDictIndex++;
+            	run_ref_dict(iCurrThinDictIndex);
+			}
+
         });
     }
 }

+ 9 - 2
app/ucenter/get.php

@@ -6,7 +6,13 @@ $dns = "" . _FILE_DB_USERINFO_;
 $dbh = new PDO($dns, "", "", array(PDO::ATTR_PERSISTENT => true));
 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
 if (isset($_GET["id"])) {
-    $query = "select userid as id ,username,nickname from user where userid = ? ";
+	if(isset($_GET["bio"])){
+		$query = "select bio,email from profile where user_id = ? ";
+	}
+	else{
+		$query = "select userid as id ,username,nickname from user where userid = ? ";
+	}
+    
     $stmt = $dbh->prepare($query);
     $stmt->execute(array($_GET["id"]));
     $fUser = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -16,7 +22,8 @@ if (isset($_GET["id"])) {
     $username = "%" . $_GET["username"] . "%";
     $stmt->execute(array($username));
     $fUser = $stmt->fetchAll(PDO::FETCH_ASSOC);
-} else {
+}
+else {
     $fUser = array();
 }
 

+ 41 - 18
app/uhome/course.php

@@ -17,35 +17,58 @@ include "../pcdl/html_head.php";
     require_once "../uhome/head.php";
 ?>
 
-<div class='index_inner'>
-<div id="course_list">
-</div>
-</div>
+<div class='section_inner'>
+	<div class="course_info_block">
+		<h2>你发布的课程</h2>
+		<div id="course_list" >
+		</div>
+	</div>
+	<div class="course_info_block">
+		<h2>你关注的课程</h2>
+		<div id="my_like" >
+		</div>
+	</div>
+</div>	
+
 <script>
 	$.get("../course/course_list.php",
     {
     teacher:"<?php echo $_GET["userid"]; ?>"
     },
     function(data,status){
-        let arrData = JSON.parse(data);
-        let html='<iframe style="width: 100%;height: 67em;" src="../fullcalendar/examples/time-zones.php"></iframe>';
-        for (const iterator of arrData) {
-            html += '<div class="card" style="display:flex;margin:1em;padding:10px;">';
+		let arrData = JSON.parse(data);
+		let html='';
+		html +="<div style='display:flex;'>";
+		html +="<div style='flex:5;'>"
+		html +='<iframe style="width:100%;height: 550px;" src="../fullcalendar/examples/time-zones.php"></iframe>';
+		html +="</div>";
+		html +="<div style='flex:5;'>";
+		if(arrData.length>0){
+			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 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>';
+				html += '<div style="flex:3;max-width:15em;">';
 
-            html += '<div style="flex:3;max-width:15em;">';
+				html += '</div>';
 
-            html += '</div>';
+				html += '</div>';
+				
+			}			
 
-            html += '</div>';
-            $("#course_list").html(html);
-        }
+		}
+		else{
+			html += '尚未发布任何课程';
+		}
+		html +="</div>";
+		html +="</div>";
+		$("#course_list").html(html);
 	});
 </script>
 <?php

+ 6 - 14
app/uhome/foot_step.php

@@ -20,9 +20,9 @@ include "../pcdl/html_head.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";
+	require_once "../pcdl/head_bar.php";
+    $currChannal = "foot-step";
+	require_once "../uhome/head.php";
 ?>
 
 <link href='../lib/fullcalendar/main.css' rel='stylesheet' />
@@ -32,9 +32,9 @@ include "../pcdl/html_head.php";
 <script src="https://code.highcharts.com/stock/modules/data.js"></script>
 <script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
 
-
+<div class='section_inner'>
 <div id="container" style="height: 400px; min-width: 310px"></div>
-
+</div>
 <script>
 
   document.addEventListener('DOMContentLoaded', function() {
@@ -190,13 +190,6 @@ Highcharts.setOptions({
 </script>
 <style>
 
-  body {
-    margin: 0;
-    padding: 0;
-    font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
-    font-size: 14px;
-  }
-
   #script-warning {
     display: none;
     background: #eee;
@@ -224,13 +217,12 @@ Highcharts.setOptions({
 
 </style>
 
-<div class='index_inner'>
+<div class='section_inner'>
   <div id='script-warning'>
     <code>php/get-events.php</code> must be running.
   </div>
 
   <div id='loading'>loading...</div>
-
   <div id='calendar'></div>
 </div>
 <?php

+ 92 - 39
app/uhome/head.php

@@ -1,3 +1,7 @@
+	<link type="text/css" rel="stylesheet" href="../course/style.css" />
+	<link type="text/css" rel="stylesheet" href="../course/mobile.css" media="screen and (max-width:800px)" />
+	<link type="text/css" rel="stylesheet" href="./style.css" />
+
 <style>
     #main_video_win iframe{
         width:100%;
@@ -35,48 +39,97 @@
     #footer_nav{
         display: none;
     }
+	.user_home_category{
+		display:flex;
+	}
+	.user_home_category li{
+		font-size: 16px;
+		margin-right:2em;
+		padding:5px;
+	}
+
 </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 class="icon_btn" title=<?php echo $_local->gui->watch;?>>
-                    <svg class="icon">
-						<use xlink:href="../studio/svg/icon.svg#eye_enable"></use>
-					</svg>
-                </button>
-                <button class="icon_btn" title=<?php echo $_local->gui->share_to;?>>
-                    <svg class="icon">
-						<use xlink:href="../studio/svg/icon.svg#share_to"></use>
-					</svg>
-                </button>
-            </div>
-        </div>
+<script src="./uhome.js"></script>
+
+<div id='course_head_bar' >
+    <div class='section_inner'>
+			<div id='course_info_head' class='course_info_block <?php if(isset($currChannal) && $currChannal!="index"){echo "compact";}?>'>
+				<div id='course_info_head_1'>
+					<div id='course_info_head_face'>
+						<img src='../../tmp/images/user/<?php echo $_GET["userid"];?>.jpg' />
+					</div>
+					<div id='course_info_head_title'>
+						<div id='course_title'><?php echo ucenter_getA($_GET["userid"]);?></div>
+						<div id='course_subtitle'></div>
+						<div id='course_button'>
+							<button class='disable'>+<?php echo $_local->gui->watch;?></button>
+						</div>
+					</div>
+				</div>
+			</div>
+
+			<div id='' class='course_info_block'>
+				<ul class="user_home_category">
+					<li>
+					<?php 
+						if(isset($currChannal) && $currChannal=="index"){
+							echo '<span class="select">'.$_local->gui->home.'</span>';
+						}
+						else{
+							echo "<a href='index.php?userid={$_GET["userid"]}'>{$_local->gui->home}</a>";
+						}
+					?>
+					</li>
+					<li>
+					<?php 
+						if(isset($currChannal) && $currChannal=="palicanon"){
+							echo '<span class="select">'.$_local->gui->translation.'</span>';
+						}
+						else{
+							echo '<a href="palicanon.php?userid='.$_GET["userid"].'">'.$_local->gui->translation.'</a>';
+						}
+					?>		
+					</li>
+					<li>
+					<?php 
+						if(isset($currChannal) && $currChannal=="course"){
+							echo '<span class="select">'.$_local->gui->lesson.'</span>';
+						}
+						else{
+							echo '<a href="course.php?userid='.$_GET["userid"].'">'.$_local->gui->lesson.'</a>';
+						}
+					?>			
+					</li>
+					<li>
+					<?php 
+						if(isset($_GET["userid"]) && isset($_COOKIE["userid"]) ){
+							if($_COOKIE["userid"]==$_GET["userid"]){
+								$id = $_GET["userid"];
+							}
+							else{
+								$id=false;
+							}
+						}
+						else if(isset($_COOKIE["userid"])){
+							$id=$_COOKIE["userid"];
+						}
+						else{
+							$id = false;
+						}
+						if($id){
+							if(isset($currChannal) && $currChannal=="foot-step"){
+								echo '<span class="select">'.$_local->gui->EXP.'</span>';
+							}
+							else{
+								echo '<a href="foot_step.php?userid='.$id.'">'.$_local->gui->EXP.'</a>';
+							}							
+						}
 
-        <div id="main_tag"  style="">
-            <span tag=<?php echo "jianjie";?>><?php echo $_local->gui->introduction;?></span>
+					?>		
+					</li>			
+				</ul>
+			</div>
 
-            <a href="trans.php?userid=<?php echo $_GET["userid"];?>">
-                <span tag=<?php echo $_local->gui->translation;?>>  
-                    <?php echo $_local->gui->translation;?>
-                </span>
-            </a>
-            <?php 
-                if(isset($currChannal) && $currChannal=="course"){
-                    echo '<span class="select" tag="'.$_local->gui->lesson.'">'.$_local->gui->lesson.'</span>';
-                }
-                else{
-                    echo '<a href="course.php?userid='.$_GET["userid"].'"><span tag="'.$_local->gui->lesson.'">'.$_local->gui->lesson.'</span></a>';
-                }
-            ?>
-            <a href="foot_step.php?userid=<?php echo $_GET["userid"];?>">
-            <span tag=<?php echo $_local->gui->EXP;?>><?php echo $_local->gui->EXP;?></span>
-            </a>
-            <span tag=<?php echo $_local->gui->statistical_data;?>><?php echo $_local->gui->statistical_data;?></span>
-        </div>
     </div>
 </div>

+ 10 - 2
app/uhome/index.php

@@ -1,6 +1,7 @@
 <?PHP
 include "../pcdl/html_head.php";
 ?>
+
 <body>
 
 <?php
@@ -8,13 +9,20 @@ include "../pcdl/html_head.php";
     require_once "../public/_pdo.php";
     require_once '../public/function.php';
     require_once '../ucenter/function.php';
-    require_once "../pcdl/head_bar.php";
+	require_once "../pcdl/head_bar.php";
+	$currChannal = "index";
     require_once "../uhome/head.php";
 ?>
 
-<div class='index_inner'>
+<div class='section_inner'>
+	<div id='bio' class='course_info_block'></div>
+	<div id='wikipali_step' class='course_info_block'></div>
 </div>
+
 <script>
+$(document).ready(function(){
+  getUserBio('<?php if(isset($_GET["userid"])){echo $_GET["userid"];} ?>')
+});
 
 </script>
 <?php

+ 30 - 0
app/uhome/palicanon.php

@@ -0,0 +1,30 @@
+<?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 = "palicanon";
+    require_once "../uhome/head.php";
+?>
+
+<div class='section_inner'>
+	<div id='bio' class='course_info_block'></div>
+	<div id='wikipali_step' class='course_info_block'></div>
+</div>
+
+<script>
+$(document).ready(function(){
+  getUserPalicanon('<?php if(isset($_GET["userid"])){echo $_GET["userid"];} ?>')
+});
+
+</script>
+<?php
+include "../pcdl/html_foot.php";
+?>

+ 15 - 0
app/uhome/style.css

@@ -0,0 +1,15 @@
+.compact #course_info_head_face img {
+	width: 100px;
+	height: 100px;
+}
+
+.compact #course_info_head_1 {
+	grid-template-columns: 100px 1fr;
+}
+
+.compact #course_info_head_title {
+	padding: 0;
+}
+.user_home_category {
+	border-bottom: 1px solid var(--border-line-color);
+}

+ 29 - 0
app/uhome/uhome.js

@@ -0,0 +1,29 @@
+function getUserBio(userid) {
+	if (userid == "") {
+		userid = getCookie("userid");
+		if (userid == "") {
+			return;
+		}
+	}
+	$.get(
+		"../ucenter/get.php",
+		{
+			id: userid,
+			bio: true,
+		},
+		function (data, status) {
+			let result = JSON.parse(data);
+			let html = "<div>";
+			if (result.length > 0) {
+				html += marked(result[0].bio);
+			} else {
+				html += gLocal.gui.not_found;
+			}
+			html += "</div>";
+
+			$("#bio").html(html);
+		}
+	);
+}
+
+function getUserPalicanon(userid) {}