refactor
fix encoding changed font display last modified date
This commit is contained in:
parent
d28322e983
commit
856f706ae4
29
index.php
29
index.php
|
@ -1,23 +1,12 @@
|
|||
<?php
|
||||
$password = '';
|
||||
$dir = '../../data/bbn';
|
||||
|
||||
if (!isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_PW'] != $password) {
|
||||
header('WWW-Authenticate: Basic realm="bbn"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo '<p>Access denied.</p>';
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>bnn</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<meta charset="UTF-8">
|
||||
<style type="text/css">
|
||||
body {
|
||||
font-family: monospace;
|
||||
font-family: helvetica;
|
||||
}
|
||||
textarea {
|
||||
height: 500px;
|
||||
|
@ -37,6 +26,17 @@
|
|||
<div><a accesskey="l" href="index.php">View list</a> <a accesskey="n" href="index.php?create=true">New note</a> | bbn</div>
|
||||
<br>
|
||||
<?php
|
||||
|
||||
$password = '';
|
||||
$dir = '../../data/bbn';
|
||||
|
||||
if (!isset($_SERVER['PHP_AUTH_PW']) || $_SERVER['PHP_AUTH_PW'] != $password) {
|
||||
header('WWW-Authenticate: Basic realm="bbn"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
echo '<p>Access denied.</p>';
|
||||
exit;
|
||||
}
|
||||
|
||||
if (isset($_POST['savebutton']))
|
||||
{
|
||||
$title = $_POST['title'];
|
||||
|
@ -79,7 +79,8 @@
|
|||
while (($file = readdir($dh)) !== false) {
|
||||
if (str_ends_with($file, '.md'))
|
||||
{
|
||||
echo '<div><a href=index.php?open=' . urlencode($file) . '>' . $file .'</a></div>';
|
||||
$mod = date("F d Y H:i:s", filemtime($dir . '/' . $file));
|
||||
echo '<div>' . $mod . ' <a href=index.php?open=' . urlencode($file) . '>' . $file .'</a></div>';
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
|
|
Loading…
Reference in New Issue