Files
vintagecoding.net/spaces.php
T

48 lines
1.2 KiB
PHP

<?php
require_once 'functions/init.php';
require_once 'functions/core.php';
require_once 'functions/space.php';
// UI Components
foreach (glob('components/core/*.php') as $file)
require_once $file;
foreach (glob('components/spaces/*.php') as $file)
require_once $file;
include_once 'components/core/head.php';
/* if (!isset($_SESSION['role_id'])) { */
/* $redirect = 'todo.php?view=display'; */
/* header('Location: user.php?view=login&redirect=' . urlencode($redirect)); */
/* } */
// Display user's spaces
if (isset($_SESSION['user'])) {
switch ($_GET['view']) {
case 'displaySpaces':
echo displaySpace();
break;
case 'displaySpace':
break;
case 'displayFeed':
/* if (isset($_GET['space_id']) || isset($_GET['user_id'])) */
break;
case 'displaySpacePosts':
break;
}
} else {
// Treat as displaySpacePosts
echo displaySpace();
}
include_once 'components/core/foot.php';
function displaySpace($spaceId = 2025)
{
$space = Space::retrieveFromDB($spaceId, null);
$html = '
<p>' . $space->getId() . '</p>
';
return $html;
}