-
Notifications
You must be signed in to change notification settings - Fork 22
/
noscript.php
72 lines (61 loc) · 2.23 KB
/
noscript.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
//echo "hello, it looks like you don't have javascript enabled. You should do something about that :)";
?>
<?php
require_once 'connect.php';require_once 'post_func.php';
if (isset($SHALL_LOG_OUT))
{
$_SESSION = array(); setcookie(session_name(), '', time() - 42000); session_destroy();
header('location: index.php');
}
// Regex: I have no idea how this works, I just got it from http://www.txt2re.com/
$txt=$_GET['_escaped_fragment_'];
$re1='(topic)'; # Word 1
$re2='(\\/)'; # Any Single Character 1
$re3='(\\d+)'; # Integer Number 1
$re4='(\\/)'; # Any Single Character 2
$re5='(\\d+)'; # Integer Number 2
if ($c=preg_match_all ("/".$re1.$re2.$re3.$re4.$re5."/is", $txt, $matches))
{
// $word1=$matches[1][0];
// $c1=$matches[2][0];
$getopic=$matches[3][0];
// $c2=$matches[4][0];
$getpagination=$matches[5][0];
// print "($word1) ($c1) ($int1) ($c2) ($int2) \n";
}elseif ($c=preg_match_all ("/".$re1.$re2.$re3."/is", $txt, $matches)) {
/* $re1='(topic)'; # Word 1
$re2='(\\/)'; # Any Single Character 1
$re3='(\\d+)'; # Integer Number 1
if ($c=preg_match_all ("/".$re1.$re2.$re3."/is", $txt, $matches))
{
/* $word1=$matches[1][0];
$c1=$matches[2][0];*/
$getopic=$matches[3][0];
$getpagination='1';
// print "($word1) ($c1) ($int1) \n";
}else {die("Error: unable to prossess _escaped_fragment_.");}
//if (!$getpagination) {$getpagination = '1';}
//echo $getopic .'.'.$getpagination;die;
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php get_title($db, $getopic, $getpagination); ?></title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="font-awesome.css" />
</head>
<body>
<div id="container" class="clearfix">
<div id="left_container">
<div id="left" class="box wall" style="display: block;"><noscript>Please enable javascript, this site can not function properly without it.</noscript>
</div></div>
<div id="mid_container">
<div id="mid" class="box wall" style="display: block;"><div id="text_container"><?php post_get($db, $getopic, $getpagination);?></div>
</div></div>
</div>
</div>
<?php //require_once 'post_func.php'; post_get($db, 25, 1); die();?>
</body>
</html>