added the skeleton of what will be the board functionality

This commit is contained in:
hayden 2019-07-02 21:46:41 -05:00
parent e65f980c73
commit 6d0db89540
3 changed files with 59 additions and 4 deletions

16
b/index.php Normal file
View File

@ -0,0 +1,16 @@
<?php
$path = $_SERVER['DOCUMENT_ROOT'];
require_once($path . '/core/board.php');
$settings = array(
'title' => 'random',
'code' => 'b',
'splash' => array(
'wacky',
'totally tubular'
)
);
display_board($settings);
?>

39
core/board.php Normal file
View File

@ -0,0 +1,39 @@
<?php
// this function is the main control over displaying boards.
function display_board(array $settings) {
// default settings
$defaults = array(
'title' => 'default',
'code' => 'd',
'splash' => array(
'splash 1',
'splash 2',
'splash 3'
)
);
$settings = array_merge($defaults, $settings);
// load in the required files
$path = $_SERVER['DOCUMENT_ROOT'];
require_once($path . '/core/header.php');
require_once($path . '/core/footer.php');
require_once($path . '/core/database.php');
display_header('~chan - /' . $settings['code'] . '/');
?>
<div style="
margin: auto;
width: 40%;
padding-top: 100px;
">
<h1><?php echo '/' . $settings['code'] . '/ - ' . $settings['title'];?></h1>
<p><?php echo $settings['splash'][array_rand($settings['splash'])]; ?></p>
<?php
echo '</div>';
}
?>

View File

@ -1,15 +1,15 @@
<?php
# - # - # - # - # - # - # - #
# #
# ~chan #
# - #
# by stilbruch #
# ~chan config #
# #
# - # - # - # - # - # - # - #
# ~ database ~
define('DB_NAME', 'tildechan');
define('DB_USER', 'root' );
define('DB_PASSWORD', '' );
define('DB_HOST', 'localhost' );
# ~ users ~