From 42ec96044d48e80b15dee57f769c7a099c655c5d Mon Sep 17 00:00:00 2001 From: Eltrac Koalar Date: Thu, 5 Mar 2020 16:35:05 +0800 Subject: =?UTF-8?q?=F0=9F=A4=AF=20Perf:=20=E4=BF=AE=E6=94=B9=E8=BF=BD?= =?UTF-8?q?=E7=95=AA=E9=A1=B5=E9=9D=A2=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bangumi.php | 144 ++++++++++++++++--------------------- libs/Bangumi.php | 211 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 272 insertions(+), 83 deletions(-) create mode 100644 libs/Bangumi.php diff --git a/bangumi.php b/bangumi.php index 8705129..2feb290 100755 --- a/bangumi.php +++ b/bangumi.php @@ -3,19 +3,17 @@ * 追番页面 * * @author Kengwang - * @version 1.0.1alpha * @for BigCoke233/miracles - * @description 目前暂时用了FormatList,这样效率可能较低,下个版本会修复 * * @package custom */ $this->need('includes/head.php'); $this->need('includes/header.php'); -$this->need('includes/bgmapi.php'); +$this->need('libs/Bangumi.php'); if ($this->fields->uid == !'' && $this->fields->sessdata == !'') { bilibili::setUserInfo($this->fields->uid, $this->fields->sessdata); if (empty($_GET['page']) || $_GET['page'] == 0) $page = 1; else $page = $_GET['page']; - $bgmdataraw = bilibili::getFollowingListRaw($page); + $bgmdataraw = bilibili::getFollowingListRaw($page,16); $bgmlist = bilibili::getFormatList($bgmdataraw['data']['list']); } else { $bgmdataraw = array(); @@ -35,93 +33,73 @@ if ($_GET['dbg'] == 'rawlist') { echo ""; } */ + ?>
-
-


-
-
- - options->avatar == ''): echo $this->author->gravatar(500); - else : ?><?php echo $this->author(); ?> -

author(); ?> の 追番

-
-
- - fields->uid == !''): ?> - - -
-
-
- - - content(); ?> -
-
- -
+
+ + //content + + //if nothing + +**/ +?> +
-
-
+
+
+
+ + + + +
+
need('includes/comments.php'); ?>
diff --git a/libs/Bangumi.php b/libs/Bangumi.php new file mode 100644 index 0000000..e8d6305 --- /dev/null +++ b/libs/Bangumi.php @@ -0,0 +1,211 @@ + '第' . $total . '话 ' . (isset($bangumi['new_ep']['long_title']) ? $bangumi['new_ep']['long_title'] : $bangumi['new_ep']['title']), //紫罗兰的永恒花园为例子,最后一集没有long_title + 'ep' => $total, + 'finish' => $bangumi['is_finish'] + ); + + $ret[] = $temp; + //循环尾 看清楚 + } + return $ret; + } + + private static function getSubstr($str, $leftStr, $rightStr) + { + $left = strpos($str, $leftStr); + //echo '左边:'.$left; + $right = strpos($str, $rightStr, $left); + //echo '
右边:'.$right; + if ($left < 0 or $right < $left) return ''; + return substr($str, $left + strlen($leftStr), $right - $left - strlen($leftStr)); + } +} \ No newline at end of file -- cgit v1.2.3