From 6abb57ee017c235b2f593c26495be8fb410a375c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Wed, 24 May 2023 12:14:11 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AB=E3=83=86=E3=82=B4=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/index.php | 68 ++++++++++++++++++++++++++++++++++++++++++++------- www/style.css | 64 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 122 insertions(+), 10 deletions(-) diff --git a/www/index.php b/www/index.php index ad55f17..e168b2e 100644 --- a/www/index.php +++ b/www/index.php @@ -19,14 +19,57 @@ return strip_tags($res); } + /* カテゴリーかの確認 */ + function iscategory (string $url): bool { + $chk = explode("=", $url); + if (isset($chk[0])) $chk = explode("?", $chk[0]); + return isset($chk[0]) && $chk[0] == "list_news_category.pl"; + } + /* 記事かの確認 */ function isarticle (string $url): bool { $chk = explode("=", $url); - if (isset($chk[0]) && $chk[0] == "view_news.pl?id" && isset($chk[1]) && isset($chk[2])) { - $chk2 = explode("&", $chk[1]); - if (isset($chk2[1]) && $chk2[1] == "media_id") return true; - } - return false; + return isset($chk[0]) && $chk[0] == "view_news.pl?id" && isset($chk[1]) && isset($chk[2]); + } + + /* カテゴリーだけが残るまで消す */ + function rmcbloat (string $body): string { + //$res = preg_replace('/(.*?)
/s', "", $body); + $res = preg_replace('/(.*?)/s', "", $body); + $res = preg_replace('/(.*?)<\/html>/s', "", $res); + $res = preg_replace('/
(.*?)<\/div>/s', "", $res); + $res = preg_replace('/