diff --git a/index.php b/index.php
index 0b6c217..916ea05 100644
--- a/index.php
+++ b/index.php
@@ -39,6 +39,35 @@
array_unshift($_SESSION['index'], $dir . '/' . $title);
}
+ function linksdiv($content)
+ {
+ $divcontent = '
';
+ $links = array();
+ if (preg_match_all('/\[\[(.*)\]\]/', $content, $links, PREG_SET_ORDER))
+ {
+ $divcontent .= '
Internal links:
';
+ foreach($links as $link)
+ {
+ $divcontent .= '
';
+ }
+ }
+ $links = array();
+ if (preg_match_all('/https:(.*)\b/', $content, $links, PREG_SET_ORDER))
+ {
+ $divcontent .= '
External links:
';
+ foreach($links as $link)
+ {
+ $divcontent .= '
';
+ }
+ }
+ $divcontent .= '
';
+ return $divcontent;
+ }
+
$nextpage = 'home';
if (isset($_GET['clip']) && $_GET['param'])
@@ -47,7 +76,7 @@
savenote('todo', $content);
$_GET['param'] = '';
}
- else if (isset($_POST['save']) || isset($_POST['home']))
+ else if (isset($_POST['save']) || isset($_POST['home']) || isset($_POST['links']))
{
$title = $_POST['title'];
$content = $_POST['content'];
@@ -109,7 +138,7 @@
{
$content = file_get_contents($dir . '/' . $title);
}
-
+
$lines = substr_count($content, "\r\n");
$words = substr_count($content, " ") + $lines;
$chars = strlen($content);
@@ -118,30 +147,6 @@
require('note.php');
- $links = array();
- if (preg_match_all('/\[\[(.*)\]\]/', $content, $links, PREG_SET_ORDER))
- {
- echo '