-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
54 lines (46 loc) · 1.56 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
44
45
46
47
48
49
50
51
52
53
54
<?php
$usedtemplates="index,page,about,tos,note,contact,privacy";
include "global.php";
$title="Noter.ml - Publish Your Notes";
if(!$_GET['code'])
{
$TP->webtemp('index');
}
else
{
$ar=array( 'About' => 'About us',
'TOS' => 'Terms of service',
'Contact' => 'Contact us',
'Privacy' => 'Privace statement'
);
switch($_GET['code'])
{
case "About":
case "TOS":
case "Contact":
case "Privacy":
$title="Noter.ml -> ".$ar[$_GET['code']];
$TP->webtemp(strtolower($_GET['code']));
break;
default:
$title="Noter.ml - Not found";
$notet=array('text' => '<h1>Not Found</h1>','views' => 0);
$cod=cleantext($_GET['code']);
$query=$DB->query('select * from notes where code=\''.$cod.'\' limit 0,1');
while($note=$DB->fetch_array($query))
{
$note['date']=mydate($note['dateline'],'last');
$note['text'] = stripslashes(htmlspecialchars_decode($note['text']));
$note['text'] = hashtag(closetags($note['text']));
$notet=$note;
$title=$note['title'].' - Noter.ml';
$DB->query('update notes set views=\''.($note['views']+1).'\' where id=\''.$note['id'].'\'');
}
$TP->ass('note',$notet);
$TP->webtemp('note');
break;
}
}
$TP->ass('title',$title);
$TP->print_page();
?>