-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
43 lines (42 loc) · 1.1 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<?php
require 'config/config.php';
if (file_exists($messageFile)) {
$f = fopen($messageFile, 'r');
$lastmessage = fgets($f);
fclose($f);
}
?>
<meta name="twab-userfile" content="<?php echo $config->userUrl.$messageFile?>">
<link href="favicon.ico" rel="icon" type="image/x-icon" />
<meta http-equiv="refresh" content="30" >
<title><?php echo $lastmessage ?></title>
</head>
<body>
<p>Microblogging in a browser tab.</p>
<p>Leave this page opened to read my feed in the tab!</p>
<p>My last messages:</p>
<pre>
<?php
if (file_exists($messageFile)) {
include($messageFile);
}else {
echo 'No message yet. Post your first on /new.php';
}
?>
</pre>
<a href="http://lab.raphaelbastide.com/twab/whythisiscool.html">Why this is cool?</a>
</body>
<script src="js/autolink.js"></script>
<script>
// Autolink the content of <pre>
var elements = document.querySelectorAll('pre');
Array.prototype.forEach.call(elements, function(el, i){
var text = el.innerHTML;
el.innerHTML = text.autoLink();
});
</script>
</html>