add # before title, add webpage title (wip)
This commit is contained in:
parent
aa3a99bd0b
commit
79c0b08397
|
@ -0,0 +1 @@
|
|||
settings.php
|
|
@ -38,8 +38,10 @@
|
|||
{
|
||||
foreach($links as $link)
|
||||
{
|
||||
$url = $link[1];
|
||||
$title = webpagetitle($url);
|
||||
$divcontent .= '<div>
|
||||
<a target="_blank" href="' . $link[1] . '">' . $link[1] . '</a>
|
||||
<a target="_blank" href="' . $url . '">' . $title . '</a>
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
|
|
20
note.php
20
note.php
|
@ -1,6 +1,21 @@
|
|||
<?php
|
||||
require('common.php');
|
||||
|
||||
function webpagetitle($url)
|
||||
{
|
||||
// too costly upon each note opening. enable with a cache?
|
||||
/*$html = file_get_contents($url);
|
||||
if ($html === FALSE)
|
||||
{
|
||||
return $url;
|
||||
}
|
||||
|
||||
preg_match('/<title>(.*?)<\/title>/i', $html, $matches);
|
||||
return isset($matches[1]) ? $matches[1] : $url;*/
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
function savenote($title, $content)
|
||||
{
|
||||
global $dir;
|
||||
|
@ -28,6 +43,8 @@
|
|||
array_unshift($_SESSION['index'], $path);
|
||||
}
|
||||
|
||||
// main
|
||||
|
||||
// handle save actions
|
||||
if (count($_POST) > 0)
|
||||
{
|
||||
|
@ -75,7 +92,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
// main
|
||||
$title = '';
|
||||
$content = false;
|
||||
if (isset($_GET['new']))
|
||||
|
@ -126,7 +142,7 @@
|
|||
<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>
|
||||
<div># <input autocomplete="off" class="title" name="title" value="<?php echo $title; ?>"></div>
|
||||
</div>
|
||||
<div class="editor">
|
||||
<textarea rows="<?php echo $rows; ?>" autofocus name="content" spellcheck="false"><?php echo $content; ?></textarea>
|
||||
|
|
Loading…
Reference in New Issue