From 7d44dc86d2c35bcc1f7cf422382440be2c7f855f Mon Sep 17 00:00:00 2001 From: quenousimporte Date: Mon, 11 Mar 2024 13:58:27 +0100 Subject: [PATCH] add stats --- index.php | 6 +++++- note.php | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index d8286d3..0b6c217 100644 --- a/index.php +++ b/index.php @@ -109,8 +109,12 @@ { $content = file_get_contents($dir . '/' . $title); } + + $lines = substr_count($content, "\r\n"); + $words = substr_count($content, " ") + $lines; + $chars = strlen($content); - $rows = max(20, substr_count($content, "\r\n")) * 2; + $rows = max(20, $lines) * 2; require('note.php'); diff --git a/note.php b/note.php index f67e51d..bf47fa3 100644 --- a/note.php +++ b/note.php @@ -4,6 +4,9 @@ + lines + words + chars