Skip to content

Commit

Permalink
(Re)uploaded everything
Browse files Browse the repository at this point in the history
I used to have a older git in the same name. Short story, I removed
some old files, and sort of cleaned it up.
  • Loading branch information
Jon Brede Skaug committed Oct 29, 2012
0 parents commit 76eb1c5
Show file tree
Hide file tree
Showing 35 changed files with 680 additions and 0 deletions.
68 changes: 68 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php
define('INCLUDE_CHECK',true);
//Defines just the website path for now.
require('rest/setupconfig.php');
//Get client URL
$name = $_SERVER['REQUEST_URI'];
//Sets the homepage name to /main, read wiki for more info.
if ($name == $path) { $name = "/main"; }
// Removes the '/' from the start of the name
$name = substr($name, 1);
//Sets up support for subfolders: example.com/subfolder/
$name = str_replace(substr($path, 1), "", $name);

$configfile = 'rest/configfiles/'.$name.'.php';
$contentfile = 'rest/contentfiles/'.$name.'.php';
require('rest/config.php');

//Checking if website has custom config or not.
if ($config == true){
require($configfile);
$exist = true;
}
elseif ($content == true) {

require('rest/config.php');
$exist = true;
}
//Else, file not found.
else {
require('rest/fourofourconfig.php');
}
//
if ($exist == true && $content == false) {
$getcontent = ('./content.php');
} elseif ($exist == true && $content == true) {
$getcontent = './'.$contentfile;
} else {
$getcontent = './rest/fourofourcontent.php';
}

if ($customout == true) {
if (file_exists ("php/templates/".$template)) {
require ("php/templates/".$template);
} elseif ($exist == true){
echo 'Template file is incorrect or not defined';
}
exit();
}
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' || substr($name, -5) == "?ajax") {
header('HTTP/1.1 200 OK');
$name = substr_replace($name ,"",-5);
$getcontent == "rest/contentfiles/ajax/".$name;
require ($getcontent);
exit();
}
if ($exist==true) header('HTTP/1.1 200 OK'); else header('HTTP/1.1 404 Not Found');
if($headheader == true) { require('rest/header.php'); }
?>
<body>
<?php
if (file_exists ("rest/php/templates/".$template)) {
require ("rest/php/templates/".$template);
} elseif ($exist == true){
echo 'Template file is incorrect or not defined';
}
?>
</body>
</html>
40 changes: 40 additions & 0 deletions rest/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
//Config elements
$exist = false;
$customout = false;
if (file_exists ($contentfile)) { $content = true; } else { $content = false; }
if (file_exists ($configfile)) { $config = true; } else { $config = false; }
//template
$template = 'btkr.php';
//Header content
$headheader = true;
$website_title = ucfirst($name).' - Bitkraken';
$header_modules = array(
"cs" => array(
'http://localhost/static/css/main.css')
//"js" => array(
//'http://static.bitkraken.net/min/f=js/script.js')
);
$footer_modules = array(
"js" => array(
'http://localhost/static/js/script.js'
)
);
//Body
//Header
$header = true;
$header = '';
//Title
$title = 'Minecraft Weekly';
$slogan = 'Fight for honor and allies!';
//Menu
$menu = true;
$searchfield = true;
//Body Content
//Sidebar
$sidebar = true;
//Sidebar Modules
$smodules[0] = null;
//Footer
$footer = true;
?>
15 changes: 15 additions & 0 deletions rest/configfiles/main.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
//Config elements
$exist = true;
$content = true;
//Extras
$footer_modules = array(
"js" => array(
'/static/js/min/script.js',
'/static/js/min/form.js'
)
);
//$template = 'php/templates/cmc.php';
//Title
$website_title = 'Bitkraken - Norsk LAN';
?>
4 changes: 4 additions & 0 deletions rest/configfiles/subfolder/secondtest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
$customout = true;
$template = "notemplate.php";
?>
4 changes: 4 additions & 0 deletions rest/configfiles/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
$customout = true;
$template = "notemplate.php"
?>
36 changes: 36 additions & 0 deletions rest/content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<p> However, there is a custom config file attached to it! Which means it is probably here for a purpose </p>


































?>
7 changes: 7 additions & 0 deletions rest/contentfiles/about.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<span style="text-align:left; margin-left:11px; font-size:15px;">
<h2> Well what the hell? </h2>
Bitkraken is a team of developers, creating new games with the 8-bit nostalgia. Well, trying.
<h2> What? Who? </h2>
<b>Asma</b> - No, not asthma. He's a programmer and I couldn't really agree with him on anything else than that. <br/>
<b>Ramen <i>(me)</i></b> - Ray-meh-no, semi-programmer, whore and web-developer.
</span>
12 changes: 12 additions & 0 deletions rest/contentfiles/main.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<br/>
<form name="prereg" action="" method="post">
<label for="name">Username:</label>
<input type="text" name="name" id="name" onChange="validateName()" onkeypress="validateName()" placeholder="USERNAME HERE" /><span ID="n" class="msg"></span>
<label for="password">Password:</label>
<input type="password" name="password" id="pass" onChange="validateEmail()" onkeypress="validateEmail()" placeholder="WRITE IN PASSWORD" /><span ID="m" class="msg"></span>
<input type="submit" value="Send" id="sendbtn" class="sndactive" onClick="sendForm(); return false;">
</form>
<script type="text/javascript">
var sndbtn = document.getElementById("sendbtn");
sndbtn.className = "sndgrey";
</script>
32 changes: 32 additions & 0 deletions rest/fourofourconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
//Config elements
$exist = false;
if (file_exists ($contentfile)) { $content = true; } else { $content = false; }
if (file_exists ($configfile)) { $config = true; } else { $config = false; }
//template
$template = 'btkr.php';
//Header content
$website_title = '404 - Not found';
$header_modules = array(
"cs" => array(
'http://static.bitkraken.net/min/f=css/main.css')
);
//Body
//Header
$header = true;
$header = '';
//Title
$title = '(。ワ°)';
$slogan = '404 - Nothing to see here';
//Menu
$menu = true;
$searchfield = true;
//Body Content
//Sidebar
$sidebar = true;
//Sidebar Modules
$smodules[0] = null;
//Footer
$footer = true;

?>
1 change: 1 addition & 0 deletions rest/fourofourcontent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p> 404 not found - The site "<?php echo $name; ?>" doesn't exist.</p>
22 changes: 22 additions & 0 deletions rest/header.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title><?php echo $website_title; ?></title>
<link rel="shortcut icon" type="image/x-icon" href="http://static.bitkraken.net/img/favicon.ico">
<META NAME="Description" CONTENT="Vi står for og arrangere LAN for Norske IT-Geeks, all hail our monkey overlords"/>
<?php
foreach ($header_modules as $v1 => $v2) {
if ($v1 == 'cs') {
foreach ($v2 as $v3) {
echo "\n\t".'<link rel="stylesheet" type="text/css" href="'.$v3.'"/>';
}
} if ($v1 == 'js') {
foreach ($v2 as $v3) {
echo "\n\t".'<script type="text/javascript" src="'.$v3.'"></script>';
}
}
}
echo "\n";
?>
</head>
27 changes: 27 additions & 0 deletions rest/php/templates/btkr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php if(!defined('INCLUDE_CHECK') || $ajax == true) die('You are not allowed to execute this file directly'); ?>
<div id="mainholder">
<div id="subholder">
<div id="header">
<a href="/" onClick="loadPage('main','static'); return false;"> <img style="border:0;" src="/static/img/btkrpxred2.png" alt="&lt;Bitkraken logo>"/></a>
</div>
<div id="mainbody"><?php require ($getcontent); ?>
<div id="footer" class="fade"><p style="font-weight:bold;color:#bcbcbc;">
<?php
if ($name != "main") { echo '<a href="/" onClick="loadPage('."'main',"."'static'".'); return false;">Login</a>'; }
if ($name != "about") { echo '<a href="/about" onClick="loadPage('."'about',"."'static'".'); return false;">About</a>'; }
?>

</p></div>
</div>
</div>
</div>
<?php
foreach ($footer_modules as $v1 => $v2) {
if ($v1 == 'js') {
foreach ($v2 as $v3) {
echo "\n\t".'<script type="text/javascript" src="'.$v3.'"></script>';
}
}
}
echo "\n";
?>
3 changes: 3 additions & 0 deletions rest/setupconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
$path = "/";
?>
60 changes: 60 additions & 0 deletions static/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
b* {
padding:0;
margin:0;
}
body {
min-height:100%;
border-width: 0px; width: 100%; height: 100%;
font-family: ‘Lucida Sans Unicode’, ‘Lucida Grande’, sans-serif;
font-size: 15px;
}
ul, ol { padding-left:40px; padding-top:5px; padding-bottom:5px;}
li { margin-top:5px; margin-bottom:5px; }
h1, h2, p { margin: 20px 0 20px 0; text-align:center;}
a { color: #693f3f; font-weight:bold; text-decoration: none;}
a:hover { color: #3b3b3b; -webkit-transition: all 0.2s ease; -moz-transition: all 0.2s ease; -o-transition: all 0.2s ease; transition: all 0.2s ease;}
label {
float: left; clear: left; margin: 11px 20px 0 0; width: 95px;
text-align: right; font-size: 16px; color: #bcbcbc;
text-transform: uppercase;
line-height: 1.73em;
}
input {
width: 260px; height: 35px; padding: 4px 20px 4px 20px; margin: 0 0 20px 0;
background: #3c3c3c;
background: -moz-linear-gradient(top, #693f3f 0%, #3c3c3c 20%); /* firefox */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#693f3f), color-stop(20%,#3c3c3c)); /* webkit */
border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
-moz-box-shadow: 0px 1px 0px #f2f2f2;-webkit-box-shadow: 0px 1px 0px #f2f2f2;
font-family: sans-serif; font-size: 16px; color: #bcbcbc; text-shadow: 0px -1px 0px #334f71;
}
input::-webkit-input-placeholder { color: #bcbcbc; text-shadow: 0px -1px 0px #38506b; }
:-moz-placeholder { color: #bcbcbc; text-shadow: 0px -1px 0px #38506b; }
input[type=submit] {
width: 185px; height: 52px; float: right; padding: 10px 15px; margin: 0 px 0 0;
-moz-box-shadow: 0px 0px 5px #999;-webkit-box-shadow: 0px 0px 5px #999;
border: 1px solid #bcbcbc;
}
input:focus {
background: #2d2d2d;
outline:none;
}
/* ID's */
#mainholder{ min-width: 100%; min-height: 100%;}
#subholder{ margin: 100px auto 0px auto; width:450px; min-height:100%;}

.msg {position:absolute; margin:11px 10px 0; padding-left: 27px; padding-top: 1px; min-height:25px; min-width:25px; filter: alpha(opacity=0); -moz-opacity: 0; font-weight:bold;}
.error { background: url("/img/error.gif") no-repeat left 0px transparent !important; color:red; }
.success { background: url("/img/check.gif") no-repeat left 0px transparent !important; color:green; }
.sndgrey {
background: -moz-linear-gradient(top, #646464 0%, #3c3c3c 100%) !important;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#646464), color-stop(100%,#3c3c3c)) !important;
cursor:default;
}
.sndactive {
background: -moz-linear-gradient(top, #693f3f 0%, #3c3c3c 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#693f3f), color-stop(100%,#3c3c3c));
cursor: pointer;
}


Loading

0 comments on commit 76eb1c5

Please sign in to comment.