forked from zneek/OpenBH-Cash-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
108 lines (89 loc) · 2.28 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
/******** Syndk8's OpenBH *********
*
* This program is free software
* licensed under the GPLv2 license.
* You may redistribute it and/or
* modify it under the terms of
* the GPLv2 license (see license.txt)
*
* Warning:
* OpenBH is for educational use
* Use OpenBH at your own risk !
*
* Credits:
* https://www.syndk8.com/openbh/people.html
*
********************************/
/**
* index.php
* Everything goes trough the index..
*
* @author Neek
* @return Website ;)
* @tutorial https://www.syndk8.com/openbh/
*/
session_start();
include('config/config.php');
/* base */
include('baselibs/DataFeed.php');
include('baselibs/HookBase.php');
include('baselibs/ImghookBase.php');
include('baselibs/Page.php');
include('baselibs/Misc.php');
include('baselibs/Images.php');
include('baselibs/AdGrabber.php');
include('baselibs/Advertising.php');
include('baselibs/StaticAdvertising.php');
include('baselibs/DynamicAdvertising.php');
include('baselibs/Internet.php');
/* expand here ;) */
include('extlibs/Generators.php'); // filename generators
include('extlibs/TokenFuncs.php'); // {{token}} funcs that work on the fly
include('extlibs/CachedTokenFuncs.php'); // ((token)) funcs that cache
$settings = Settings($_SERVER['REQUEST_URI']);
TemplateRewrite($settings['filename']);
if(!is_array($settings)) {
writeLog('settings FAILED to load');
}
if(IsImage($_SERVER['REQUEST_URI'])) {
// Load all image hooks
foreach (glob("imghooks/*.php") as $filename) {
include($filename);
}
ServeImg($settings['filename']);
exit;
}
// Load all content hooks
foreach (glob("hooks/*.php") as $filename) {
include($filename);
}
// Load dynamic adserving hooks
foreach (glob("adhooks/*.php") as $filename) {
include($filename);
}
// setting us up the page
$page = GetPage($settings);
switch($page->responsecode)
{
case 404:
header("HTTP/1.0 404 Not Found");
echo $page->content;
break;
case 302:
case 301:
header("Location: {$page->redirlink}");
break;
case 200:
if($page->dontskin==1) {
echo $page->content;
break;
}
echo utf8_encode($page->Skin());
break;
}
/* log ... */
if(OpenBHConf::get('loghits')==true) {
loghit($page,$settings);
}
?>