Jelajahi Sumber

:bug: 经验值计算bug

visuddhinanda 5 tahun lalu
induk
melakukan
f077445f9b
4 mengubah file dengan 26 tambahan dan 12 penghapusan
  1. 2 1
      app/ucenter/active.php
  2. 21 10
      app/uhome/foot_step.php
  3. 1 1
      app/uhome/foot_step_data.php
  4. 2 0
      app/uhome/head.php

+ 2 - 1
app/ucenter/active.php

@@ -4,6 +4,7 @@ require_once '../path.php';
 require_once "../public/function.php";
 
 define("MAX_INTERVAL",600000);
+define("MIN_INTERVAL",10000);
 
 if(isset($_COOKIE["userid"])){
 	$dns = "sqlite:"._FILE_DB_USER_ACTIVE_;
@@ -38,7 +39,7 @@ if(isset($_COOKIE["userid"])){
 	if($new_record){
 		$query="INSERT INTO edit ( user_id, start , end  , duration , hit )  VALUES  ( ? , ? , ? , ? , ? ) ";
 		$sth = $dbh->prepare($query);
-		$sth->execute(array($_COOKIE["userid"] , $currTime , $currTime , 10000,1) );
+		$sth->execute(array($_COOKIE["userid"] , $currTime , ($currTime+MIN_INTERVAL) , MIN_INTERVAL,1) );
 		if (!$sth || ($sth && $sth->errorCode() != 0)) {
 			$error = $dbh->errorInfo();
 		}

+ 21 - 10
app/ucenter/foot_step.php → app/uhome/foot_step.php

@@ -9,13 +9,25 @@ else{
 	echo "no user id";
 	exit;
 }
+
+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";
 ?>
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset='utf-8' />
+
 <link href='../lib/fullcalendar/main.css' rel='stylesheet' />
 <script src='../lib/fullcalendar/main.js'></script>
+
 <script>
 
   document.addEventListener('DOMContentLoaded', function() {
@@ -27,7 +39,6 @@ else{
         center: 'title',
         right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
       },
-      initialDate: '2021-01-31',
       editable: true,
       navLinks: true, // can click day/week names to navigate views
       dayMaxEvents: true, // allow "more" link when too many events
@@ -82,9 +93,8 @@ else{
   }
 
 </style>
-</head>
-<body>
 
+<div class='index_inner'>
   <div id='script-warning'>
     <code>php/get-events.php</code> must be running.
   </div>
@@ -92,6 +102,7 @@ else{
   <div id='loading'>loading...</div>
 
   <div id='calendar'></div>
-
-</body>
-</html>
+</div>
+<?php
+include "../pcdl/html_foot.php";
+?>

+ 1 - 1
app/ucenter/foot_step_data.php → app/uhome/foot_step_data.php

@@ -24,7 +24,7 @@ function covertTimeToString($time){
 	else{
 		$hour = floor($time/3600);
 		$min = floor(($time-($hour*3600))/60);
-		return "$hour小时$min分钟";
+		return "{$hour}小时{$min}分钟";
 	}
 }
 

+ 2 - 0
app/uhome/head.php

@@ -73,7 +73,9 @@
                     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>