still some bugs and auth issues to iron out. need to implement a new action button/bar, the card for moments in a space, creating new moments and essays, dynamically refreshing the spaces view when a new post is created.

This commit is contained in:
2025-05-20 19:46:09 -06:00
parent a93c30c40f
commit 54a01f0f1f
20 changed files with 1018 additions and 1191 deletions
+30 -24
View File
@@ -18,52 +18,58 @@
return $args;
}
if ($_SERVER['SCRIPT_NAME'] == '/user.php') {
$args = get_args_from_url();
if ($_SERVER['SCRIPT_NAME'] == '/spaces.php')
echo '<script src="js/actionButton.js" defer></script>';
if (isset($args['view'])) {
if ($args['view'] == 'signup') {
echo '
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 '
} 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 '
} else if ($_SERVER['SCRIPT_NAME'] == '/admin.php') {
echo '
<script src="js/clickable_rows.js"></script>
';
$args = get_args_from_url();
$args = get_args_from_url();
if (isset($args['view'])) {
if ($args['view'] == 'users') {
echo '
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();
} else if ($_SERVER['SCRIPT_NAME'] == '/articles.php') {
$args = get_args_from_url();
if (isset($args['view'])) {
if ($args['view'] == 'compose') {
echo '
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>';
}
} else if ($_SERVER['SCRIPT_NAME'] == '/todo.php') {
echo '<script src="js/todo.js"></script>';
}
echo '
echo '
<script src="js/override_browser_styles.js"></script>
';
}
?>
</footer>
+3 -3
View File
@@ -7,11 +7,11 @@
<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')
if (!isset($_SESSION['theme']) || $_SESSION['theme'] == 'dark')
echo '<link href="css/dark.css" rel="stylesheet" type="text/css">';
else
else
echo '<link href="css/light.css" rel="stylesheet" type="text/css">';
?>
?>
</head>
+21 -18
View File
@@ -2,24 +2,24 @@
$current_page = $_SERVER['SCRIPT_NAME'];
$nav = '
<nav>
<div class="row_space_between no_margin">
<div class="row space_between no_margin full_width">
<div class="site_navigation">
<ul>
<li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li>
<li><a href="/spaces.php?view=displaySpaces"' . ($current_page == '/spaces.php' ? ' class="underline"' : '') . '>Spaces</a></li>
<li><a href="/spaces.php?view=list"' . ($current_page == '/spaces.php' ? ' class="underline"' : '') . '>Spaces</a></li>
';
/* <li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li> */
if (isset($_SESSION['user'])) {
$nav .= '
<li><a href="/user.php?view=display&user_id=' . $_SESSION['user_id'] . '"' . ($current_page == '/user.php' ? ' class="underline"' : '') . '>Account</a></li>
<li><a href="/todo.php?view=display"' . ($current_page == '/todo.php' ? ' class="underline"' : '') . '>Todos</a></li>
';
/* $nav .= ' */
/* <li><a href="/user.php?view=display&user_id=' . unserialize($_SESSION['user'])->getId() . '"' . ($current_page == '/user.php' ? ' class="underline"' : '') . '>Account</a></li> */
/* <li><a href="/todo.php?view=display"' . ($current_page == '/todo.php' ? ' class="underline"' : '') . '>Todos</a></li> */
/* '; */
if ($_SESSION['user'] <= developer) {
$nav .= '
if (unserialize($_SESSION['user'])->getRole() <= developer) {
$nav .= '
<li><a href="/admin.php?view=users"' . ($current_page == '/admin.php' ? ' class="underline"' : '') . '>Admin</a></li>
';
}
}
}
$nav .= '
@@ -31,23 +31,23 @@ $nav .= '
$theme_toggle = '';
if ($_SESSION['theme'] == 'dark')
$theme_toggle = 'light';
$theme_toggle = 'light';
else
$theme_toggle = 'dark';
$theme_toggle = 'dark';
$nav .= '
<button id="theme_toggle" value="' . $theme_toggle . '" name="theme"><i class="nf ' . ($theme_toggle == 'dark' ? 'nf-oct-moon' : 'nf-oct-sun') . '"></i></button>
</form>
';
if (isset($_SESSION['username'])) {
$nav .= '
<a href="user.php?view=logout">Log Out</a>
if (isset($_SESSION['user'])) {
$nav .= '
<p class="link underline" id="logout">Log Out</p>
';
} else {
$nav .= '
<a href="user.php?view=login">Login</a>
<a href="user.php?view=signup">Sign Up</a>
$nav .= '
<p class="link underline" id="login">Login</p>
<p class="link underline" id="signup">Sign Up</p>
';
}
@@ -56,7 +56,10 @@ $nav .= '
</div>
<script src="js/nav.js" defer></script>
<script src="js/login.js" defer></script>
</nav>
<div id="notificationModal"></div>
<div id="stdModal"></div>
';
echo $nav;