add stat action

drop link labels
This commit is contained in:
quenousimporte 2024-03-12 14:09:49 +01:00
parent 1d951c063d
commit 294c3b9db2
2 changed files with 13 additions and 8 deletions

View File

@ -45,7 +45,6 @@
$links = array();
if (preg_match_all('/\[\[(.*)\]\]/', $content, $links, PREG_SET_ORDER))
{
$divcontent .= '<br><div>Internal links:</div>';
foreach($links as $link)
{
$divcontent .= '<div>
@ -56,7 +55,6 @@
$links = array();
if (preg_match_all('/https:(.*)\b/', $content, $links, PREG_SET_ORDER))
{
$divcontent .= '<br><div>External links:</div>';
foreach($links as $link)
{
$divcontent .= '<div>
@ -76,7 +74,7 @@
savenote('todo', $content);
$_GET['param'] = '';
}
else if (isset($_POST['save']) || isset($_POST['home']) || isset($_POST['links']))
else if (isset($_POST['save']) || isset($_POST['home']) || isset($_POST['links']) || isset($_POST['stats']))
{
$title = $_POST['title'];
$content = $_POST['content'];

View File

@ -2,13 +2,20 @@
<div>
<input type="submit" name="home" value="home" accesskey="h">
<input type="submit" name="save" value="save" accesskey="s">
<input type="submit" name="delete" value="delete" accesskey="d">
<input type="submit" name="preview" value="preview" accesskey="p">
<input type="submit" name="links" value="links" accesskey="l">
<span class="grey"><?echo $lines; ?> lines</span>
<span class="grey"><?echo $words; ?> words</span>
<span class="grey"><?echo $chars; ?> chars</span>
<?php if (isset($_POST['links']))
<input type="submit" name="stats" value="stats" accesskey="i">
<input type="submit" name="delete" value="delete" accesskey="d">
<?php
if (isset($_POST['stats']))
{
echo '<div>
<span class="grey">' . $lines . ' lines</span>
<span class="grey">'. $words . ' words</span>
<span class="grey">' . $chars . ' chars</span>
</div>';
}
else if (isset($_POST['links']))
{
echo linksdiv($content);
}?>