add stats
This commit is contained in:
parent
5589822afb
commit
7d44dc86d2
|
@ -110,7 +110,11 @@
|
||||||
$content = file_get_contents($dir . '/' . $title);
|
$content = file_get_contents($dir . '/' . $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
$rows = max(20, substr_count($content, "\r\n")) * 2;
|
$lines = substr_count($content, "\r\n");
|
||||||
|
$words = substr_count($content, " ") + $lines;
|
||||||
|
$chars = strlen($content);
|
||||||
|
|
||||||
|
$rows = max(20, $lines) * 2;
|
||||||
|
|
||||||
require('note.php');
|
require('note.php');
|
||||||
|
|
||||||
|
|
3
note.php
3
note.php
|
@ -4,6 +4,9 @@
|
||||||
<input type="submit" name="save" value="save" accesskey="s">
|
<input type="submit" name="save" value="save" accesskey="s">
|
||||||
<input type="submit" name="delete" value="delete" accesskey="d">
|
<input type="submit" name="delete" value="delete" accesskey="d">
|
||||||
<input type="submit" name="preview" value="preview" accesskey="p">
|
<input type="submit" name="preview" value="preview" accesskey="p">
|
||||||
|
<span class="grey"><?echo $lines; ?> lines</span>
|
||||||
|
<span class="grey"><?echo $words; ?> words</span>
|
||||||
|
<span class="grey"><?echo $chars; ?> chars</span>
|
||||||
<br>
|
<br>
|
||||||
<input autocomplete="off" class="title" name="title" value="<? echo $title; ?>">
|
<input autocomplete="off" class="title" name="title" value="<? echo $title; ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue