diff --git a/discussion.php b/discussion.php
new file mode 100644
index 0000000..235c28b
--- /dev/null
+++ b/discussion.php
@@ -0,0 +1,172 @@
+window.location.href = "' . $redirectUrl . '";';
+ exit;
+ }
+}
+
+// 检查登录状态
+$isLoggedIn = isset($dt['Data']['User']['Nickname']) && $dt['Data']['User']['Nickname'] !== '点击登录';
+
+function getCommunityData() {
+ $baseUrl = "http://nlm-api-cn.turtlesim.com/";
+
+ // 准备请求数据
+ $requestData = [
+ 'Identifier' => 'Discussions',
+ 'Language' => "Chinese"
+ ];
+
+ // 准备请求头
+ $headers = [
+ 'Content-Type: application/json',
+ 'Accept: application/json',
+ 'Accept-Language: zh-CN',
+ ];
+
+ // 添加认证头(修复了多余的大括号)
+ $headers[] = 'x-API-Token: ' . $_SESSION['token'];
+ $headers[] = 'x-API-AuthCode: ' . $_SESSION['authCode'];
+
+ // 发送POST请求
+ $url = $baseUrl . 'Contents/GetLibrary';
+
+ $ch = curl_init();
+ curl_setopt_array($ch, [
+ CURLOPT_URL => $url,
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => json_encode($requestData, JSON_UNESCAPED_UNICODE),
+ CURLOPT_HTTPHEADER => $headers,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false,
+ CURLOPT_TIMEOUT => 30,
+ ]);
+
+ $response = curl_exec($ch);
+ curl_close($ch);
+ $data = json_decode($response, true);
+ return $data;
+}
+
+// 处理日期格式
+function formatDate($id) {
+ return (strlen($id) >= 8) ? date('m/d', hexdec(substr($id, 0, 8)) * 1000 / 1000) : '未知日期';
+}
+
+// 获取数据
+$communityData = getCommunityData();
+
+// 模块配置
+$modules = [
+ ['title' => '海水公告', 'count' => 3, 'featured' => true, 'type' => 'explore', 'category' => 'Discussion'],
+ ['title' => '海水精选', 'count' => 3, 'featured' => true, 'type' => 'featured', 'category' => 'Discussion'],
+ ['title' => '热门交流', 'count' => 4, 'featured' => false, 'type' => 'daily', 'category' => 'Discussion'],
+ ['title' => '最新交流', 'count' => 4, 'featured' => false, 'type' => 'hot', 'category' => 'Discussion'],
+ ['title' => '社区知识库', 'count' => 4, 'featured' => false, 'type' => 'new', 'category' => 'Discussion'],
+ ['title' => '海水模版', 'count' => 4, 'featured' => false, 'type' => 'visual', 'category' => 'Discussion']
+];
+?>
+
+
+
+
+
+ Turtle Universe Web - Discussion
+
+
+
+
+
+
+
+
+
+
+
+
+
无法加载社区数据,请检查网络连接或稍后重试
+
+
+
+
+
+
+
+
+
+
diff --git a/index.php b/index.php
index 60a1648..6b63a84 100644
--- a/index.php
+++ b/index.php
@@ -92,7 +92,7 @@ function formatDate($id) {
$author = $exp['User']['Nickname'] ?? '未知作者';
$date = formatDate($exp['ID'] ?? '');
$tags = $exp['Tags'] ?? [];
- $imgSrc = 'http://netlogo-static-cn.turtlesim.com/experiments/images/' .
+ $imgSrc = 'http://netlogo-cn.oss-cn-hongkong.aliyuncs.com/experiments/images/' .
substr($exp['ID'] ?? '0000000000000000', 0, 4) . '/' .
substr($exp['ID'] ?? '0000000000000000', 4, 2) . '/' .
substr($exp['ID'] ?? '0000000000000000', 6, 2) . '/' .
@@ -133,8 +133,8 @@ function formatDate($id) {
diff --git a/med.php b/med.php
index e09d144..f12fc52 100644
--- a/med.php
+++ b/med.php
@@ -133,7 +133,7 @@ function formatDate($timestamp) {
= htmlspecialchars($content['LocalizedSubject']['Chinese'] ?? $content['Subject']) ?>
- = htmlspecialchars($content['Category'] === 'Model' ? 'Model' : 'Experiment') ?>
+ = htmlspecialchars($content['Category']) ?>
= $content['Visits'] ?? 0 ?>
diff --git a/model.php b/model.php
new file mode 100644
index 0000000..2682e62
--- /dev/null
+++ b/model.php
@@ -0,0 +1,176 @@
+window.location.href = "' . $redirectUrl . '";';
+ exit;
+ }
+}
+
+// 检查登录状态
+$isLoggedIn = isset($dt['Data']['User']['Nickname']) && $dt['Data']['User']['Nickname'] !== '点击登录';
+
+function getCommunityData() {
+ $baseUrl = "http://nlm-api-cn.turtlesim.com/";
+
+ // 准备请求数据
+ $requestData = [
+ 'Identifier' => 'Library',
+ 'Language' => "Chinese"
+ ];
+
+ // 准备请求头
+ $headers = [
+ 'Content-Type: application/json',
+ 'Accept: application/json',
+ 'Accept-Language: zh-CN',
+ ];
+
+ // 添加认证头(修复了多余的大括号)
+ $headers[] = 'x-API-Token: ' . $_SESSION['token'];
+ $headers[] = 'x-API-AuthCode: ' . $_SESSION['authCode'];
+
+ // 发送POST请求
+ $url = $baseUrl . 'Contents/GetLibrary';
+
+ $ch = curl_init();
+ curl_setopt_array($ch, [
+ CURLOPT_URL => $url,
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => json_encode($requestData, JSON_UNESCAPED_UNICODE),
+ CURLOPT_HTTPHEADER => $headers,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false,
+ CURLOPT_TIMEOUT => 30,
+ ]);
+
+ $response = curl_exec($ch);
+ curl_close($ch);
+ $data = json_decode($response, true);
+ return $data;
+}
+
+// 处理日期格式
+function formatDate($id) {
+ return (strlen($id) >= 8) ? date('m/d', hexdec(substr($id, 0, 8)) * 1000 / 1000) : '未知日期';
+}
+
+// 获取数据
+$communityData = getCommunityData();
+
+// 模块配置
+$modules = [
+ ['title' => '每日模型', 'count' => 4, 'featured' => false, 'type' => 'explore', 'category' => 'Model'],
+ ['title' => '最新模型', 'count' => 4, 'featured' => false, 'type' => 'featured', 'category' => 'Model'],
+ ['title' => '生物学', 'count' => 4, 'featured' => false, 'type' => 'daily', 'category' => 'Model'],
+ ['title' => '地球科学', 'count' => 4, 'featured' => false, 'type' => 'hot', 'category' => 'Model'],
+ ['title' => '艺术', 'count' => 4, 'featured' => false, 'type' => 'new', 'category' => 'Model'],
+ ['title' => '化学', 'count' => 4, 'featured' => false, 'type' => 'visual', 'category' => 'Model'],
+ ['title' => '物理学', 'count' => 4, 'featured' => false, 'type' => 'explore', 'category' => 'Model'],
+ ['title' => '数学', 'count' => 4, 'featured' => false, 'type' => 'featured', 'category' => 'Model'],
+ ['title' => '社会科学', 'count' => 4, 'featured' => false, 'type' => 'daily', 'category' => 'Model'],
+ ['title' => '游戏', 'count' => 4, 'featured' => false, 'type' => 'new', 'category' => 'Model']
+];
+?>
+
+
+
+
+
+
Turtle Universe Web - Model Library
+
+
+
+
+
+
+
+
+
+
+
+
+
无法加载社区数据,请检查网络连接或稍后重试
+
+
+
+
+
+
+
+
+
+