add note name in title
This commit is contained in:
parent
6d87adb4d5
commit
a0ade9fb74
53
index.php
53
index.php
|
@ -117,22 +117,7 @@
|
|||
download();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>bbn</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">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
|
||||
$preview = '';
|
||||
if (isset($_GET['clip']) && $_GET['param'])
|
||||
{
|
||||
$content = $_GET['param'] . "\r\n" . file_get_contents($dir . '/todo.md');
|
||||
|
@ -175,15 +160,45 @@
|
|||
}
|
||||
$Parsedown = new Parsedown();
|
||||
$Parsedown->setBreaksEnabled(true);
|
||||
echo $Parsedown->text('# ' . $title . "\r\n" . substr($content, $pos));
|
||||
$nextpage = '';
|
||||
$preview = $Parsedown->text('# ' . $title . "\r\n" . substr($content, $pos));
|
||||
$nextpage = 'preview';
|
||||
}
|
||||
else if (isset($_GET['open']))
|
||||
{
|
||||
$nextpage = 'note';
|
||||
$title = $_GET['param'];
|
||||
}
|
||||
if ($nextpage == 'note')
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<?php
|
||||
if ($nextpage != 'home' && isset($title))
|
||||
{
|
||||
echo $title;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'bbn';
|
||||
}
|
||||
?>
|
||||
</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">
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
if ($nextpage == 'preview')
|
||||
{
|
||||
echo $preview;
|
||||
}
|
||||
else if ($nextpage == 'note')
|
||||
{
|
||||
$now = date("Y-m-d H.i.s", time());
|
||||
if (!$title)
|
||||
|
|
Loading…
Reference in New Issue