implemented spaces, fixed login and signup, thought creation and space creation.
This commit is contained in:
@@ -1,74 +1,17 @@
|
||||
</body>
|
||||
|
||||
<footer>
|
||||
<script src="js/util.js"></script>
|
||||
<script src="js/nav.js" defer></script>
|
||||
<script src="js/user.js" defer></script>
|
||||
|
||||
<?php
|
||||
function get_args_from_url()
|
||||
{
|
||||
$args = [];
|
||||
$arr = explode('&', $_SERVER['QUERY_STRING']);
|
||||
|
||||
foreach ($arr as $a) {
|
||||
$tmp = explode('=', $a);
|
||||
$key = $tmp[0];
|
||||
$value = $tmp[1];
|
||||
|
||||
$args[$key] = $value;
|
||||
}
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
if ($_SERVER['SCRIPT_NAME'] == '/spaces.php')
|
||||
echo '<script src="js/actionButton.js" defer></script>';
|
||||
|
||||
function extra()
|
||||
{
|
||||
if ($_SERVER['SCRIPT_NAME'] == '/user.php') {
|
||||
$args = get_args_from_url();
|
||||
|
||||
if (isset($args['view'])) {
|
||||
if ($args['view'] == 'signup') {
|
||||
echo '
|
||||
<script src="js/profile_picture_cropper_modal.js"></script>
|
||||
<script src="js/upload.js"></script>
|
||||
';
|
||||
} else if ($args['view'] == 'display') {
|
||||
echo '
|
||||
<script src="js/user_actions_modal.js"></script>
|
||||
<script src="js/upload.js"></script>
|
||||
';
|
||||
}
|
||||
}
|
||||
} else if ($_SERVER['SCRIPT_NAME'] == '/admin.php') {
|
||||
echo '
|
||||
<script src="js/clickable_rows.js"></script>
|
||||
';
|
||||
$args = get_args_from_url();
|
||||
|
||||
if (isset($args['view'])) {
|
||||
if ($args['view'] == 'users') {
|
||||
echo '
|
||||
<script src="js/upload.js"></script>
|
||||
';
|
||||
}
|
||||
}
|
||||
} else if ($_SERVER['SCRIPT_NAME'] == '/articles.php') {
|
||||
$args = get_args_from_url();
|
||||
|
||||
if (isset($args['view'])) {
|
||||
if ($args['view'] == 'compose') {
|
||||
echo '
|
||||
<script src="js/md_preview.js"></script>
|
||||
';
|
||||
}
|
||||
}
|
||||
} else if ($_SERVER['SCRIPT_NAME'] == '/todo.php') {
|
||||
echo '<script src="js/todo.js"></script>';
|
||||
}
|
||||
|
||||
// <script src="js/theme.js" defer></script>
|
||||
if ($_SERVER['SCRIPT_NAME'] == '/spaces.php' && isset($_SESSION['user'])) {
|
||||
echo '
|
||||
<script src="js/override_browser_styles.js"></script>
|
||||
';
|
||||
<script src="js/actionBar.js" defer></script>
|
||||
<script src="js/dropdown.js" defer></script>
|
||||
';
|
||||
}
|
||||
?>
|
||||
</footer>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<link href="css/rewrite.css" rel="stylesheet" type="text/css">
|
||||
<link rel="stylesheet" href="https://nerdfonts.com/assets/css/webfont.css">
|
||||
<link rel="icon" type="image/x-icon" href="data/vintagecoding-favicon.png">
|
||||
|
||||
<?php
|
||||
if (!isset($_SESSION['theme']) || $_SESSION['theme'] == 'dark')
|
||||
echo '<link href="css/dark.css" rel="stylesheet" type="text/css">';
|
||||
|
||||
@@ -55,8 +55,6 @@ $nav .= '
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/nav.js" defer></script>
|
||||
<script src="js/login.js" defer></script>
|
||||
</nav>
|
||||
<div id="notificationModal"></div>
|
||||
<div id="stdModal"></div>
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
function login_form($error_msg = '')
|
||||
{
|
||||
$form = '
|
||||
<div class="form_card">
|
||||
<h3 class="underline">Log In</h3>
|
||||
<form method="post" id="login_form">
|
||||
<input type="hidden" name="form_id" value="login_form">
|
||||
<input type="hidden" name="password_hash" value="" id="password_hash">
|
||||
|
||||
<label for="username">Username / Email</label>
|
||||
<input id="username" name="username" spellcheck="false" required autofocus>
|
||||
|
||||
<label for="password">Password</label>
|
||||
<input id="password" name="password" type="password" spellcheck="false" required>
|
||||
|
||||
<label class="form_checkbox_container">Stay Logged In?
|
||||
<input name="stay_logged_in" type="checkbox" value="true">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
|
||||
<input class="button" type="submit" value="Log In">
|
||||
' . $error_msg . '
|
||||
</form>
|
||||
|
||||
<script src="js/login.js" defer></script>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $form;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
function signup_form($error_msg = '')
|
||||
{
|
||||
$form = '
|
||||
<div class="form_card">
|
||||
<h3 class="underline">Sign Up</h3>
|
||||
<form method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="form_id" value="signup_form">
|
||||
<input type="hidden" name="crop_x" value="" id="crop_x">
|
||||
<input type="hidden" name="crop_y" value="" id="crop_y">
|
||||
<input type="hidden" name="crop_width" value="" id="crop_width">
|
||||
<input name="required_field" id="required_field" value="">
|
||||
|
||||
<label for="username">Username</label>
|
||||
<input id="username" name="username" required>
|
||||
|
||||
<label for="email">Email Address</label>
|
||||
<input id="email" name="email" required>
|
||||
|
||||
<label for="password">Password</label>
|
||||
<input id="password" name="password" type="password" required>
|
||||
|
||||
<label for="verify_password">Verify Password</label>
|
||||
<input id="verify_password" name="verify_password" type="password" required>
|
||||
|
||||
<label for="profile_picture_input" class="upload_button modal_button" id="profile_cropper_button">Upload a Profile Picture</label>
|
||||
<input id="profile_picture_input" class="file_input" name="profile_picture" type="file" accept="image/png, image/jpeg, image/jpg">
|
||||
<small class="file_input_feedback">No file selected.</small>
|
||||
|
||||
<label class="form_checkbox_container">Stay Logged In?
|
||||
<input name="stay_logged_in" type="checkbox" value="true">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
|
||||
<input class="button" type="submit" value="Sign Up">
|
||||
' . $error_msg . '
|
||||
</form>
|
||||
|
||||
<div id="modal" class="modal">
|
||||
<div id="display_modal"></div>
|
||||
</div>
|
||||
|
||||
<div style="display: none;">
|
||||
<div id="profile_cropper" class="modal_form">' . profile_cropper() . '</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $form;
|
||||
}
|
||||
Reference in New Issue
Block a user