Compare commits

..

No commits in common. "0ba895aad6703307a28bbf5a904c00a7f7dc1429" and "5e61fba372f6f6e955099914c4edf198e2b95f7d" have entirely different histories.

2 changed files with 15 additions and 16 deletions

View File

@ -1,6 +1,5 @@
<?php
error_reporting(E_ALL);
date_default_timezone_set('Europe/Paris');
require 'settings.php';
function cleanstring($string)
@ -125,11 +124,11 @@
session_start();
if (!isset($_SESSION['index']) || isset($_GET['reindex']) || empty($_SESSION['index']))
{
$files = glob($dir . '/*.md');
$files = glob($dir . '/*');
usort($files, function($a, $b)
{
return filemtime($b) - filemtime($a);
});
$_SESSION['index'] = array_map(fn($value): string => str_replace('.md', '', $value), $files);
}
?>
?>

View File

@ -79,7 +79,7 @@
<!DOCTYPE html>
<html>
<head>
<title><?php echo $title; ?></title>
<title><? echo $title; ?></title>
<link rel="manifest" href="manifest.json" />
<meta name="theme-color" content="white" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
@ -88,7 +88,7 @@
</head>
<body>
<!-- editor -->
<div <?php if(isset($_GET['preview'])) echo 'hidden'; ?>>
<div <? if(isset($_GET['preview'])) echo 'hidden'; ?>>
<form action="note.php" method="POST">
<div>
<input type="submit" name="home" value="home" accesskey="h">
@ -96,24 +96,24 @@
<input type="submit" name="preview" value="preview" accesskey="p">
<input type="submit" name="download" value="download" accesskey="d">
<input type="submit" name="delete" value="delete">
<input hidden name="lastchanged" value="<?php echo $lastchanged; ?>">
<div><input autocomplete="off" class="title" name="title" value="<?php echo $title; ?>"></div>
<input hidden name="lastchanged" value="<? echo $lastchanged; ?>">
<div><input autocomplete="off" class="title" name="title" value="<? echo $title; ?>"></div>
</div>
<div class="editor">
<textarea rows="<?php echo $rows; ?>" autofocus name="content" spellcheck="false"><?php echo $content; ?></textarea>
<textarea rows="<? echo $rows; ?>" autofocus name="content" spellcheck="false"><? echo $content; ?></textarea>
</div>
<input hidden name="previoustitle" value="<?php echo $title; ?>">
<div class="grey">
<?php echo '' . $lines . '&nbsp;' . $words . '&nbsp;' . $chars . '&nbsp;' . $title . '.md&nbsp;' . date('Y-m-d H.i.s', $lastchanged); ?>
</div>
<?php echo linksdiv($content); ?>
<input hidden name="previoustitle" value="<? echo $title; ?>">
<?php
echo '<div class="grey">' . $lines . '&nbsp;' . $words . '&nbsp;' . $chars . '&nbsp;' . $title . '.md</div>';
echo linksdiv($content);
?>
</form>
</div>
<!-- preview -->
<div <?php if(!isset($_GET['preview'])) echo 'hidden'; ?>>
<div><a class="grey" href="note.php?title=<?php echo $title; ?>">back</a></div>
<?php
<div <? if(!isset($_GET['preview'])) echo 'hidden'; ?>>
<div><a class="grey" href="note.php?title=<? echo $title; ?>">back</a></div>
<?
echo computepreview($title, $content);
?>
</div>