Przeglądaj źródła

首页百科显示作者名

visuddhinanda 5 lat temu
rodzic
commit
d1235c8805
1 zmienionych plików z 3 dodań i 4 usunięć
  1. 3 4
      app/term/new.php

+ 3 - 4
app/term/new.php

@@ -3,11 +3,11 @@
 
 require_once "../path.php";
 require_once "../public/_pdo.php";
-require_once '../public/load_lang.php';
 require_once '../public/function.php';
+require_once '../ucenter/function.php';
 
-global $PDO;
 PDO_Connect(_FILE_DB_TERM_);
+$userInfo = new UserInfo();
 
 $query = "select word,meaning , owner from term where 1  order by create_time DESC limit 0,4";
 $Fetch = PDO_FetchAll($query);
@@ -17,7 +17,6 @@ foreach ($Fetch as $row) {
     echo '<div class="card">';
     echo '<div class="title"><a href="../wiki/wiki.php?word=' . $row["word"] . '">' . $row["word"] . '</a></div>';
     echo '<div class="summary">' . $row["meaning"] . '</div>';
-    echo '<div class="author">' . $row["owner"] . '</div>';
-
+    echo '<div class="author">' . $userInfo->getName($row["owner"])["nickname"] . '</div>';
     echo '</div>';
 }