@@ -28,6 +29,8 @@
10
+ +
admin->pluginRecommendation?>
@@ -40,34 +43,38 @@
+ +
admin->officialAccount?>
-
-
-
-
admin->followUs?>
+
+
+
+
admin->followUs?>
admin->followUsContent?>
+
admin->publicClass?>
-
-
-
-
-
-
-
-
+
+ +
+
+
name;?>
+
+
+
admin->zentaoInfo?>
+
From 85ee9918c09457a3000d61600b747b414cd20452 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 31 Jan 2023 15:25:46 +0800 Subject: [PATCH 7/8] * Modify website check. --- module/admin/control.php | 21 ++++++--------------- module/admin/model.php | 23 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/module/admin/control.php b/module/admin/control.php index 52e29309a3..8a7a31e2c4 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -34,24 +34,15 @@ class admin extends control $this->loadModel('misc'); - /* Check internet. */ - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, 'https://api.zentao.net/extension-apiGetExtensions.json'); - curl_setopt($curl, CURLOPT_TIMEOUT_MS, 1000); - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, 1000); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); - $connected = (bool)curl_exec($curl); - curl_close($curl); - - $clientLang = $this->app->getClientLang(); + $hasInternet = $this->admin->checkInternet(); + $clientLang = $this->app->getClientLang(); $this->view->title = $this->lang->admin->common; $this->view->position[] = $this->lang->admin->index; - $this->view->extensions = $this->admin->getExtensionsByAPI('extension', 6, $connected); - $this->view->hasInternet = $connected; - $this->view->publicClass = ($connected and strpos($clientLang, 'zh') === 0) ? $this->admin->getPublicClassByAPI() : array(); + $this->view->extensions = $this->admin->getExtensionsByAPI('extension', strpos($clientLang, 'zh') === 0 ? 6 : 5, $hasInternet); + $this->view->patches = $this->admin->getExtensionsByAPI('patch', 3, $hasInternet); + $this->view->hasInternet = $hasInternet; + $this->view->publicClass = ($hasInternet and strpos($clientLang, 'zh') === 0) ? $this->admin->getPublicClassByAPI() : array(); $this->view->clientLang = $clientLang; $this->display(); } diff --git a/module/admin/model.php b/module/admin/model.php index bab50d297b..04e69e624c 100755 --- a/module/admin/model.php +++ b/module/admin/model.php @@ -377,7 +377,7 @@ class adminModel extends model * * @param int $limit * @access public - * @return void + * @return array */ public function getPublicClassByAPI($limit = 2) { @@ -399,4 +399,25 @@ class adminModel extends model } return $publicClass; } + + /** + * Check internet. + * + * @access public + * @return bool + */ + public function checkInternet() + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_URL, 'https://api.zentao.net/extension-apiGetExtensions.json'); + curl_setopt($curl, CURLOPT_TIMEOUT_MS, 1000); + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, 1000); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); + $connected = curl_exec($curl); + curl_close($curl); + + return (bool)$connected; + } } From 746bb0da844318aca78218799181248106e62240 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 31 Jan 2023 16:14:18 +0800 Subject: [PATCH 8/8] * Modify language check. --- module/admin/control.php | 7 ++++--- module/admin/view/index.html.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/admin/control.php b/module/admin/control.php index 8a7a31e2c4..bde9def349 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -36,14 +36,15 @@ class admin extends control $hasInternet = $this->admin->checkInternet(); $clientLang = $this->app->getClientLang(); + $langNotCN = common::checkNotCN(); $this->view->title = $this->lang->admin->common; $this->view->position[] = $this->lang->admin->index; - $this->view->extensions = $this->admin->getExtensionsByAPI('extension', strpos($clientLang, 'zh') === 0 ? 6 : 5, $hasInternet); + $this->view->extensions = $this->admin->getExtensionsByAPI('extension', $langNotCN ? 5 : 6, $hasInternet); $this->view->patches = $this->admin->getExtensionsByAPI('patch', 3, $hasInternet); $this->view->hasInternet = $hasInternet; - $this->view->publicClass = ($hasInternet and strpos($clientLang, 'zh') === 0) ? $this->admin->getPublicClassByAPI() : array(); - $this->view->clientLang = $clientLang; + $this->view->publicClass = ($hasInternet and !$langNotCN) ? $this->admin->getPublicClassByAPI() : array(); + $this->view->langNotCN = $langNotCN; $this->display(); } diff --git a/module/admin/view/index.html.php b/module/admin/view/index.html.php index 921593cb0a..1688bddff6 100755 --- a/module/admin/view/index.html.php +++ b/module/admin/view/index.html.php @@ -71,7 +71,7 @@
- +
admin->zentaoInfo?>