Merge branch 'main' into allthebookmarks-com

This commit is contained in:
Joey Kimsey
2025-01-30 13:53:35 -05:00
71 changed files with 594 additions and 274 deletions

View File

@ -35,7 +35,7 @@ class Config extends BedrockConfig {
case 'radio': case 'radio':
case 'bool': case 'bool':
case 'boolean': case 'boolean':
$fieldHtml = Forms::getSwitchHtml( $fieldname, [ 'true', 'false' ], $node['value'] ); $fieldHtml = Forms::getSwitchHtml( $fieldname, $node['value'] );
break; break;
case 'select': case 'select':
$fieldHtml = Forms::getSelectHtml( $fieldname, $options, $node['value'] ); $fieldHtml = Forms::getSelectHtml( $fieldname, $options, $node['value'] );

View File

@ -19,6 +19,7 @@ use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Bedrock\Functions\Upload; use TheTempusProject\Bedrock\Functions\Upload;
use TheTempusProject\Bedrock\Functions\Input; use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\TheTempusProject as App; use TheTempusProject\TheTempusProject as App;
use TheTempusProject\Bedrock\Classes\Config;
class Preferences { class Preferences {
public static $preferences = false; public static $preferences = false;
@ -208,6 +209,15 @@ class Preferences {
if ( $tempPrefsArray['type'] == 'checkbox' ) { if ( $tempPrefsArray['type'] == 'checkbox' ) {
$tempPrefsArray['type'] = 'switch'; $tempPrefsArray['type'] = 'switch';
} }
if ( 'file' === $tempPrefsArray['type'] ) {
// dv( Config::getValue( 'uploads/images' ) );
if ( ! Config::getValue( 'uploads/images' ) ) {
Debug::info( 'Preference hidden because uploads are disabled.' );
continue;
}
}
$inputTypes[ $tempPrefsArray['type'] ][] = self::getFormFieldHtml( $name, $tempPrefsArray['pretty'], $tempPrefsArray['type'], $tempPrefsArray['value'], $tempPrefsArray['options'] ); $inputTypes[ $tempPrefsArray['type'] ][] = self::getFormFieldHtml( $name, $tempPrefsArray['pretty'], $tempPrefsArray['type'], $tempPrefsArray['value'], $tempPrefsArray['options'] );
} }
foreach ( $inputTypes as $skip => $items ) { foreach ( $inputTypes as $skip => $items ) {
@ -295,6 +305,7 @@ class Preferences {
$prefsArray[$name] = $route . Upload::last(); $prefsArray[$name] = $route . Upload::last();
} else { } else {
Issues::add( 'error', [ 'There was an error with your upload.' => Check::userErrors() ] ); Issues::add( 'error', [ 'There was an error with your upload.' => Check::userErrors() ] );
unset( $prefsArray[$name] );
} }
} }
} }

View File

@ -32,8 +32,6 @@ class Groups extends AdminController {
self::$title = 'Admin - Groups'; self::$title = 'Admin - Groups';
self::$group = new Group; self::$group = new Group;
self::$permissions = new Permissions; self::$permissions = new Permissions;
$view = Navigation::activePageSelect( 'nav.admin', '/admin/groups' );
Components::set( 'ADMINNAV', $view );
} }
public function create( $data = null ) { public function create( $data = null ) {

View File

@ -17,9 +17,12 @@ use TheTempusProject\Classes\AdminController;
use TheTempusProject\Models\User; use TheTempusProject\Models\User;
use TheTempusProject\Models\Comments; use TheTempusProject\Models\Comments;
use TheTempusProject\Models\Posts; use TheTempusProject\Models\Posts;
use TheTempusProject\Models\Contact;
use TheTempusProject\Plugins\Comments as CommentPlugin; use TheTempusProject\Plugins\Comments as CommentPlugin;
use TheTempusProject\Plugins\Blog as BlogPlugin; use TheTempusProject\Plugins\Blog as BlogPlugin;
use TheTempusProject\Plugins\Contact as ContactPlugin;
use TheTempusProject\Canary\Bin\Canary as Debug; use TheTempusProject\Canary\Bin\Canary as Debug;
use TheTempusProject\Bedrock\Functions\Input;
class Home extends AdminController { class Home extends AdminController {
public static $user; public static $user;
@ -32,12 +35,12 @@ class Home extends AdminController {
} }
public function index() { public function index() {
Components::set( 'commentDash', '' );
if ( class_exists( 'TheTempusProject\Plugins\Comments' ) ) { if ( class_exists( 'TheTempusProject\Plugins\Comments' ) ) {
$plugin = new CommentPlugin; $plugin = new CommentPlugin;
if ( ! $plugin->checkEnabled() ) { if ( ! $plugin->checkEnabled() ) {
Debug::info( 'Comments Plugin is disabled in the control panel.' ); Debug::info( 'Comments Plugin is disabled in the control panel.' );
Components::set( 'commentDash', '' );
} else { } else {
$comments = new Comments; $comments = new Comments;
$commentList = Views::simpleView( 'comments.admin.dashboard', $comments->recent( 'all', 5 ) ); $commentList = Views::simpleView( 'comments.admin.dashboard', $comments->recent( 'all', 5 ) );
@ -58,10 +61,28 @@ class Home extends AdminController {
} }
} }
if ( class_exists( 'TheTempusProject\Plugins\Contact' ) ) {
$plugin = new ContactPlugin;
if ( ! $plugin->checkEnabled() ) {
Debug::info( 'Contact Plugin is disabled in the control panel.' );
Components::set( 'contactDash', '' );
} else {
$posts = new Contact;
$postsList = Views::simpleView( 'contact.admin.dashboard', $posts->listPaginated( 5 ) );
Components::set( 'contactDash', $postsList );
}
}
self::$user = new User; self::$user = new User;
$users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) ); $users = Views::simpleView( 'admin.dashboard.users', self::$user->recent( 5 ) );
Components::set( 'userDash', $users ); Components::set( 'userDash', $users );
if ( Input::exists( 'submit' ) ) {
$results = Views::simpleView( 'admin.dashboard.users', self::$user->search( Input::post('searchTerm') ) );
Components::set( 'searchResults', $results );
}
Views::view( 'admin.dashboard.dash' ); Views::view( 'admin.dashboard.dash' );
} }
} }

View File

@ -0,0 +1,114 @@
<?php
/**
* app/controllers/admin/tokens.php
*
* This is the admin app/user tokens controller.
*
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Controllers\Admin;
use TheTempusProject\Classes\Forms as TTPForms;
use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\Houdini\Classes\Issues;
use TheTempusProject\Houdini\Classes\Navigation;
use TheTempusProject\Houdini\Classes\Components;
use TheTempusProject\Houdini\Classes\Forms;
use TheTempusProject\Classes\AdminController;
use TheTempusProject\Models\Token;
use TheTempusProject\Bedrock\Functions\Input;
use TheTempusProject\Bedrock\Functions\Check;
use TheTempusProject\Hermes\Functions\Redirect;
use TheTempusProject\Bedrock\Functions\Session;
class Images extends AdminController {
public function __construct() {
parent::__construct();
self::$title = 'Admin - Images';
}
public function create() {
if ( Input::exists( 'submit' ) ) {
if ( !TTPForms::check( 'addImage' ) ) {
Issues::add( 'error', [ 'There was an error with your image.' => Check::userErrors() ] );
}
if ( Input::exists( 'folder' ) ) {
$folder = Input::post('folder');
} else {
// IMAGE_DIRECTORY
$folder = UPLOAD_DIRECTORY . App::$activeUser->username . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR;
}
$upload = Upload::image( 'upload', $folder );
if ( $upload ) {
$route = str_replace( APP_ROOT_DIRECTORY, '', $folder );
$out = $route . Upload::last();
} else {
Debug::error( 'There was an error with your upload.');
Issues::add( 'error', [ 'There was an error with your upload.' => Check::userErrors() ] );
}
// if ( self::$token->create(
// Input::post( 'name' ),
// Input::post( 'notes' ),
// Input::post( 'token_type' )
// ) ) {
// Session::flash( 'success', 'Token Created' );
// Redirect::to( 'admin/images' );
// }
}
Views::view( 'admin.images.create' );
}
public function delete( $id = null ) {
if ( self::$token->delete( [ $id ] ) ) {
Session::flash( 'success', 'Token deleted.' );
}
Redirect::to( 'admin/images' );
}
public function edit( $id = null ) {
$token = self::$token->findById( $id );
if ( Input::exists( 'submit' ) ) {
if ( !TTPForms::check( 'adminEditToken' ) ) {
Issues::add( 'error', [ 'There was an error with your token.' => Check::userErrors() ] );
} else {
if ( self::$token->update(
$id,
Input::post( 'name' ),
Input::post( 'notes' ),
Input::post( 'token_type' )
) ) {
Session::flash( 'success', 'Token Updated' );
Redirect::to( 'admin/images' );
}
}
}
Forms::selectOption( $token->token_type );
return Views::view( 'admin.images.edit', $token );
}
public function index() {
return Views::view( 'admin.images.list', self::$token->listPaginated() );
}
public function view( $id = null ) {
return Views::view( 'admin.images.view', self::$token->findById( $id ) );
}
}

View File

@ -30,8 +30,6 @@ class Plugins extends AdminController {
self::$title = 'Admin - Installed Plugins'; self::$title = 'Admin - Installed Plugins';
$this->installer = new Installer; $this->installer = new Installer;
$this->plugins = $this->installer->getAvailablePlugins(); $this->plugins = $this->installer->getAvailablePlugins();
$view = Navigation::activePageSelect( 'nav.admin', '/admin/plugins' );
Components::set( 'ADMINNAV', $view );
} }
public function index() { public function index() {

View File

@ -31,8 +31,6 @@ class Routes extends AdminController {
parent::__construct(); parent::__construct();
self::$title = 'Admin - Redirects'; self::$title = 'Admin - Redirects';
self::$routes = new RoutesClass; self::$routes = new RoutesClass;
$view = Navigation::activePageSelect( 'nav.admin', '/admin/routes' );
Components::set( 'ADMINNAV', $view );
} }
public function create() { public function create() {

View File

@ -32,12 +32,12 @@ class SendMail extends AdminController {
if ( class_exists( 'TheTempusProject\Plugins\Subscribe' ) ) { if ( class_exists( 'TheTempusProject\Plugins\Subscribe' ) ) {
$plugin = new Plugin; $plugin = new Plugin;
if ( ! $plugin->checkEnabled() ) { if ( ! $plugin->checkEnabled() ) {
Issues::add( 'warn', 'Subscriptions are disabled so those feature will be unavailable.' ); Issues::add( 'notice', 'Subscriptions are disabled so those feature will be unavailable.' );
} else { } else {
self::$subscribe = new Subscribe; self::$subscribe = new Subscribe;
} }
} else { } else {
Issues::add( 'warn', 'Subscriptions plugin is not installed so those feature will be unavailable.' ); Issues::add( 'notice', 'Subscriptions plugin is not installed so those feature will be unavailable.' );
} }
} }

View File

@ -31,8 +31,6 @@ class Tokens extends AdminController {
parent::__construct(); parent::__construct();
self::$title = 'Admin - Tokens'; self::$title = 'Admin - Tokens';
self::$token = new Token; self::$token = new Token;
$view = Navigation::activePageSelect( 'nav.admin', '/admin/tokens' );
Components::set( 'ADMINNAV', $view );
} }
public function create() { public function create() {

View File

@ -37,8 +37,6 @@ class Users extends AdminController {
self::$title = 'Admin - Users'; self::$title = 'Admin - Users';
self::$user = new User; self::$user = new User;
self::$group = new Group; self::$group = new Group;
$view = Navigation::activePageSelect( 'nav.admin', '/admin/users' );
Components::set( 'ADMINNAV', $view );
} }
public function create() { public function create() {

View File

@ -98,12 +98,6 @@ class Home extends Controller {
Views::view( 'about' ); Views::view( 'about' );
} }
public function contact() {
self::$title = 'Contact Us - {SITENAME}';
self::$pageDescription = 'On this page, you\'ll be able to reach out to the team directly with any questions, comments, or concerns you may have.';
Views::view( 'contact' );
}
public function privacy() { public function privacy() {
self::$title = 'Privacy Policy - {SITENAME}'; self::$title = 'Privacy Policy - {SITENAME}';
self::$pageDescription = 'At {SITENAME} you privacy is very important to us. On this page you can find a detailed outline of all the information we collect and how its used.'; self::$pageDescription = 'At {SITENAME} you privacy is very important to us. On this page you can find a detailed outline of all the information we collect and how its used.';

View File

@ -24,6 +24,7 @@ use TheTempusProject\Houdini\Classes\Views;
use TheTempusProject\TheTempusProject as App; use TheTempusProject\TheTempusProject as App;
use TheTempusProject\Classes\Controller; use TheTempusProject\Classes\Controller;
use TheTempusProject\Classes\Forms; use TheTempusProject\Classes\Forms;
use TheTempusProject\Bedrock\Classes\Config;
class Register extends Controller { class Register extends Controller {
public function confirm( $code = null ) { public function confirm( $code = null ) {
@ -46,6 +47,11 @@ class Register extends Controller {
public function index() { public function index() {
self::$title = '{SITENAME} Sign Up'; self::$title = '{SITENAME} Sign Up';
self::$pageDescription = 'Many features of {SITENAME} are disabled or hidden from unregistered users. On this page you can sign up for an account to access all the app has to offer.'; self::$pageDescription = 'Many features of {SITENAME} are disabled or hidden from unregistered users. On this page you can sign up for an account to access all the app has to offer.';
if ( ! Config::getValue( 'main/registrationEnabled' ) ) {
return Issues::add( 'notice', 'The site administrator has disable the ability to register a new account.' );
}
Components::set( 'TERMS', Views::simpleView( 'terms' ) ); Components::set( 'TERMS', Views::simpleView( 'terms' ) );
if ( App::$isLoggedIn ) { if ( App::$isLoggedIn ) {
return Issues::add( 'notice', 'You are currently logged in.' ); return Issues::add( 'notice', 'You are currently logged in.' );

View File

@ -101,7 +101,7 @@ class Usercp extends Controller {
$menu = Views::simpleView( 'nav.usercp', App::$userCPlinks ); $menu = Views::simpleView( 'nav.usercp', App::$userCPlinks );
Navigation::activePageSelect( $menu, null, true, true ); Navigation::activePageSelect( $menu, null, true, true );
$prefs = new Preferences; $prefs = new Preferences;
$fields = App::$activePrefs; $userPrefs = App::$activePrefs;
if ( Input::exists( 'submit' ) ) { if ( Input::exists( 'submit' ) ) {
$fields = $prefs->convertFormToArray( true, false ); $fields = $prefs->convertFormToArray( true, false );
// @TODO now i may need to rework the form checker to work with this.... // @TODO now i may need to rework the form checker to work with this....
@ -110,6 +110,12 @@ class Usercp extends Controller {
// } // }
self::$user->updatePrefs( $fields, App::$activeUser->ID ); self::$user->updatePrefs( $fields, App::$activeUser->ID );
Issues::add( 'success', 'Your preferences have been updated.' ); Issues::add( 'success', 'Your preferences have been updated.' );
// if the image upload fails, need to fall back on original
if ( empty( $fields['avatar'] ) ) {
$fields['avatar'] = $userPrefs['avatar'];
}
} else {
$fields = $userPrefs;
} }
Components::set( 'AVATAR_SETTINGS', $fields['avatar'] ); Components::set( 'AVATAR_SETTINGS', $fields['avatar'] );
Components::set( 'PREFERENCES_FORM', $prefs->getFormHtml( $fields ) ); Components::set( 'PREFERENCES_FORM', $prefs->getFormHtml( $fields ) );
@ -139,11 +145,9 @@ class Usercp extends Controller {
$prefs = new Preferences; $prefs = new Preferences;
$fields1 = $prefs->convertFormToArray( true, false ); $fields1 = $prefs->convertFormToArray( true, false );
$fields2 = [];
$fields3 = $fields1; $fields3 = $fields1;
if ( isset( $fields1[ $name ] ) ) { if ( isset( $fields1[ $name ] ) ) {
$fields2[ $name ] = $value;
$fields3[ $name ] = $value; $fields3[ $name ] = $value;
} }
$result = self::$user->updatePrefs( $fields3, App::$activeUser->ID ); $result = self::$user->updatePrefs( $fields3, App::$activeUser->ID );

View File

@ -21,9 +21,18 @@
.context-second-bg { .context-second-bg {
background-color: #1e1e1e; background-color: #1e1e1e;
} }
.context-third-bg {
background-color: #3a3a3a;
}
.bg-default { .bg-default {
background-color: #2c2c2c; background-color: #2c2c2c;
} }
hr {
color: #f5f5f5;
}
.bg-none,.bg-warning { .bg-none,.bg-warning {
color: #000 !important; color: #000 !important;
} }
@ -140,11 +149,10 @@ body {
background-color: #1f1f1f; background-color: #1f1f1f;
color: #e0e0e0; color: #e0e0e0;
} }
.form-control:focus { .form-control:focus {
color: #e0e0e0; color: #e0e0e0;
/* border-color: #85bd3e; */ border-color: #1e90ff;
border-color: #1b947f;
background-color: #1f1f1f; background-color: #1f1f1f;
/* box-shadow: 0 0 0 .25rem #1b947f; */ box-shadow: 0 0 0 .25rem rgba(30, 144, 255, .5);
box-shadow: 0 0 0 .25rem #85bd3e;
} }

View File

@ -12,6 +12,14 @@
background-color: #eaeaea; background-color: #eaeaea;
} }
.nav-link.active {
font-weight: bold; /* Make the text bold */
}
hr {
color: #000;
}
.context-main-bg { .context-main-bg {
background-color: #f7f7f7; background-color: #f7f7f7;
} }
@ -55,7 +63,7 @@
bottom: 2.5px; bottom: 2.5px;
left: 5px; left: 5px;
transition: transform 0.3s ease-in-out; transition: transform 0.3s ease-in-out;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px #00000033;
} }
/* Change background color when checked */ /* Change background color when checked */

View File

@ -95,22 +95,45 @@ $(document).ready(function() {
}); });
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () {
const ttpDarkmode = document.getElementById('dark-mode-pref');
const toggleButton = document.getElementById('dark-mode-toggle'); const toggleButton = document.getElementById('dark-mode-toggle');
const enableButton = document.getElementById('dark-mode-toggle-button'); const enableButton = document.getElementById('dark-mode-toggle-button');
const darkModeStylesheet = document.getElementById('dark-mode-stylesheet'); const darkModeStylesheet = document.getElementById('dark-mode-stylesheet');
let currentState = '';
// Check if dark mode is saved in localStorage // Check if dark mode is set by ttp
if ( ttpDarkmode ) {
if ( 'true' == ttpDarkmode.value ) {
currentState = 'enabled';
}
if ( 'false' == ttpDarkmode.value ) {
currentState = 'disabled';
}
}
// Check if dark mode is set in localStorage
if ( '' == currentState ) {
if ( localStorage.getItem('darkMode') === 'enabled' ) { if ( localStorage.getItem('darkMode') === 'enabled' ) {
currentState = 'enabled';
}
}
// Update current button states
if ( 'enabled' == currentState ) {
darkModeStylesheet.disabled = false; darkModeStylesheet.disabled = false;
if ( toggleButton ) {
toggleButton.checked = true; toggleButton.checked = true;
}
if ( enableButton ) { if ( enableButton ) {
enableButton.innerText = 'Disable Now'; enableButton.innerText = 'Disable Now';
} }
} }
// Style striped table elements
document.querySelectorAll('.table-striped').forEach((table) => { document.querySelectorAll('.table-striped').forEach((table) => {
if (localStorage.getItem('darkMode') === 'enabled') { if ( 'enabled' == currentState ) {
table.classList.add('table-dark'); table.classList.add('table-dark');
} else { } else {
table.classList.add('table-light') table.classList.add('table-light')
@ -131,6 +154,7 @@ document.addEventListener('DOMContentLoaded', function () {
}); });
} }
if ( toggleButton ) {
toggleButton.addEventListener('click', function () { toggleButton.addEventListener('click', function () {
if (darkModeStylesheet.disabled) { if (darkModeStylesheet.disabled) {
toggleDarkModePref( true ); toggleDarkModePref( true );
@ -152,6 +176,7 @@ document.addEventListener('DOMContentLoaded', function () {
} }
}); });
}); });
}
function toggleDarkModePref( value ) { function toggleDarkModePref( value ) {
var fields = {}; var fields = {};

View File

@ -31,13 +31,16 @@ class Group extends DatabaseModel {
'defaultGroup' => [ 'defaultGroup' => [
'type' => 'customSelect', 'type' => 'customSelect',
'pretty' => 'The Default Group for new registrations.', 'pretty' => 'The Default Group for new registrations.',
'default' => 5, 'default' => 4,
], ],
]; ];
public $databaseMatrix = [ public $databaseMatrix = [
[ 'name', 'varchar', '32' ], [ 'name', 'varchar', '32' ],
[ 'permissions', 'text', '' ], [ 'permissions', 'text', '' ],
]; ];
public $searchFields = [
'name',
];
public $permissionMatrix = [ public $permissionMatrix = [
'adminAccess' => [ 'adminAccess' => [
'pretty' => 'Access Administrator Areas', 'pretty' => 'Access Administrator Areas',

View File

@ -46,6 +46,9 @@ class Log extends DatabaseModel {
[ 'source', 'varchar', '64' ], [ 'source', 'varchar', '64' ],
[ 'action', 'text', '' ], [ 'action', 'text', '' ],
]; ];
public $searchFields = [
'source',
];
/** /**
* The model constructor. * The model constructor.

View File

@ -24,6 +24,9 @@ class Routes extends DatabaseModel {
[ 'original_url', 'varchar', '32' ], [ 'original_url', 'varchar', '32' ],
[ 'forwarded_url', 'text', '' ], [ 'forwarded_url', 'text', '' ],
]; ];
public $searchFields = [
'nickname',
];
public $resourceMatrix = [ public $resourceMatrix = [
[ [
'original_url' => 'fb', 'original_url' => 'fb',

View File

@ -36,6 +36,9 @@ class Sessions extends DatabaseModel {
[ 'username', 'varchar', '20' ], [ 'username', 'varchar', '20' ],
[ 'token', 'varchar', '120' ], [ 'token', 'varchar', '120' ],
]; ];
public $searchFields = [
'username',
];
public static $activeSession = false; public static $activeSession = false;
/** /**

View File

@ -31,6 +31,10 @@ class Token extends DatabaseModel {
[ 'createdBy', 'int', '10' ], [ 'createdBy', 'int', '10' ],
[ 'expiresAt', 'int', '10' ], [ 'expiresAt', 'int', '10' ],
]; ];
public $searchFields = [
'name',
'token',
];
public $permissionMatrix = [ public $permissionMatrix = [
'addAppToken' => [ 'addAppToken' => [
'pretty' => 'Add Application Tokens', 'pretty' => 'Add Application Tokens',

View File

@ -44,6 +44,9 @@ class User extends DatabaseModel {
[ 'confirmationCode', 'varchar', '80' ], [ 'confirmationCode', 'varchar', '80' ],
[ 'prefs', 'text', '' ], [ 'prefs', 'text', '' ],
]; ];
public $searchFields = [
'username',
];
public $permissionMatrix = [ public $permissionMatrix = [
'uploadImages' => [ 'uploadImages' => [
'pretty' => 'Upload images (such as avatars)', 'pretty' => 'Upload images (such as avatars)',

View File

@ -29,8 +29,6 @@ class Blog extends AdminController {
parent::__construct(); parent::__construct();
self::$posts = new Posts; self::$posts = new Posts;
self::$title = 'Admin - Blog'; self::$title = 'Admin - Blog';
$view = Navigation::activePageSelect( 'nav.admin', '/admin/blog' );
Components::set( 'ADMINNAV', $view );
} }
public function index( $data = null ) { public function index( $data = null ) {
@ -46,7 +44,7 @@ class Blog extends AdminController {
return $this->index(); return $this->index();
} }
$result = self::$posts->newPost( Input::post( 'title' ), Input::post( 'blogPost' ), Input::post( 'submit' ) ); $result = self::$posts->newPost( Input::post( 'title' ), Input::post( 'blogPost' ), Input::post( 'slug' ), Input::post( 'submit' ) );
if ( $result ) { if ( $result ) {
Issues::add( 'success', 'Your post has been created.' ); Issues::add( 'success', 'Your post has been created.' );
return $this->index(); return $this->index();
@ -67,7 +65,7 @@ class Blog extends AdminController {
Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] ); Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] );
return $this->index(); return $this->index();
} }
if ( self::$posts->updatePost( $data, Input::post( 'title' ), Input::post( 'blogPost' ), Input::post( 'submit' ) ) === true ) { if ( self::$posts->updatePost( $data, Input::post( 'title' ), Input::post( 'blogPost' ), Input::post( 'slug' ), Input::post( 'submit' ) ) === true ) {
Issues::add( 'success', 'Post Updated.' ); Issues::add( 'success', 'Post Updated.' );
return $this->index(); return $this->index();
} }

View File

@ -62,12 +62,17 @@ class Blog extends Controller {
return $this->index(); return $this->index();
} }
if ( class_exists( 'TheTempusProject\Plugins\Comments' ) ) {
$plugin = new Comments; $plugin = new Comments;
if ( ! $plugin->checkEnabled() ) { if ( ! $plugin->checkEnabled() ) {
Issues::add( 'error', 'Comments are disabled.' ); Issues::add( 'error', 'Comments are disabled.' );
return $this->index(); return $this->index();
} }
$comments = new CommentsModel; $comments = new CommentsModel;
} else {
Debug::info( 'error', 'Comments plugin missing.' );
return $this->index();
}
switch ( $sub ) { switch ( $sub ) {
case 'post': case 'post':
@ -99,9 +104,12 @@ class Blog extends Controller {
return $this->index(); return $this->index();
} }
$post = self::$posts->findById( $id ); $post = self::$posts->findById( $id );
if ( empty( $post ) ) {
$post = self::$posts->findBySlug( $id );
if ( empty( $post ) ) { if ( empty( $post ) ) {
return $this->index(); return $this->index();
} }
}
Debug::log( 'Controller initiated: ' . __METHOD__ . '.' ); Debug::log( 'Controller initiated: ' . __METHOD__ . '.' );
self::$title = 'Blog Post'; self::$title = 'Blog Post';
@ -111,13 +119,13 @@ class Blog extends Controller {
Components::set( 'CONTENT_ID', $id ); Components::set( 'CONTENT_ID', $id );
Components::set( 'COMMENT_TYPE', self::$posts->tableName ); Components::set( 'COMMENT_TYPE', self::$posts->tableName );
$plugin = new Comments;
if ( ! $plugin->checkEnabled() ) {
Components::set( 'NEWCOMMENT', '' ); Components::set( 'NEWCOMMENT', '' );
Components::set( 'count', '0' ); Components::set( 'count', '0' );
Components::set( 'COMMENTS', '' ); Components::set( 'COMMENTS', '' );
} else {
if ( class_exists( 'TheTempusProject\Plugins\Comments' ) ) {
$plugin = new Comments;
if ( $plugin->checkEnabled() ) {
$comments = new CommentsModel; $comments = new CommentsModel;
if ( App::$isLoggedIn ) { if ( App::$isLoggedIn ) {
Components::set( 'NEWCOMMENT', Views::simpleView( 'comments.create' ) ); Components::set( 'NEWCOMMENT', Views::simpleView( 'comments.create' ) );
@ -127,8 +135,7 @@ class Blog extends Controller {
Components::set( 'count', $comments->count( self::$posts->tableName, $post->ID ) ); Components::set( 'count', $comments->count( self::$posts->tableName, $post->ID ) );
Components::set( 'COMMENTS', Views::simpleView( 'comments.list', $comments->display( 10, self::$posts->tableName, $post->ID ) ) ); Components::set( 'COMMENTS', Views::simpleView( 'comments.list', $comments->display( 10, self::$posts->tableName, $post->ID ) ) );
} }
}
$post = self::$posts->findById( $id );
self::$title .= ' - ' . $post->title; self::$title .= ' - ' . $post->title;
self::$pageDescription = strip_tags( $post->contentSummaryNoLink ); self::$pageDescription = strip_tags( $post->contentSummaryNoLink );

View File

@ -32,6 +32,7 @@ class Posts extends DatabaseModel {
[ 'edited', 'int', '10' ], [ 'edited', 'int', '10' ],
[ 'draft', 'int', '1' ], [ 'draft', 'int', '1' ],
[ 'title', 'varchar', '86' ], [ 'title', 'varchar', '86' ],
[ 'slug', 'varchar', '64' ],
[ 'content', 'text', '' ], [ 'content', 'text', '' ],
]; ];
@ -45,7 +46,7 @@ class Posts extends DatabaseModel {
} }
} }
public function newPost( $title, $post, $draft ) { public function newPost( $title, $post, $slug, $draft ) {
if ( !Check::dataTitle( $title ) ) { if ( !Check::dataTitle( $title ) ) {
Debug::info( 'modelBlog: illegal title.' ); Debug::info( 'modelBlog: illegal title.' );
@ -59,6 +60,7 @@ class Posts extends DatabaseModel {
$fields = [ $fields = [
'author' => App::$activeUser->ID, 'author' => App::$activeUser->ID,
'draft' => $draft, 'draft' => $draft,
'slug' => $slug,
'created' => time(), 'created' => time(),
'edited' => time(), 'edited' => time(),
'content' => Sanitize::rich( $post ), 'content' => Sanitize::rich( $post ),
@ -73,7 +75,7 @@ class Posts extends DatabaseModel {
return true; return true;
} }
public function updatePost( $id, $title, $content, $draft ) { public function updatePost( $id, $title, $content, $slug, $draft ) {
if ( empty( self::$log ) ) { if ( empty( self::$log ) ) {
self::$log = new Log; self::$log = new Log;
} }
@ -94,6 +96,7 @@ class Posts extends DatabaseModel {
} }
$fields = [ $fields = [
'draft' => $draft, 'draft' => $draft,
'slug' => $slug,
'edited' => time(), 'edited' => time(),
'content' => Sanitize::rich( $content ), 'content' => Sanitize::rich( $content ),
'title' => $title, 'title' => $title,
@ -132,22 +135,29 @@ class Posts extends DatabaseModel {
$draft = ''; $draft = '';
$authorName = self::$user->getUsername( $instance->author ); $authorName = self::$user->getUsername( $instance->author );
$cleanPost = Sanitize::contentShort( $instance->content ); // Summarize
$wordsArray = explode( ' ', $cleanPost ); if ( ! empty( $instance->slug ) ) {
$postLine = explode( "\n", $cleanPost ); $identifier = $instance->slug;
$spaceSummary = implode( ' ', array_splice( $wordsArray, 0, 100 ) ); } else {
$lineSummary = implode( "\n", array_splice( $postLine, 0, 5 ) ); $identifier = $instance->ID;
if ( strlen( $spaceSummary ) < strlen( $lineSummary ) ) {
$contentSummaryNoLink = $spaceSummary;
$contentSummary = $spaceSummary;
if ( count( $wordsArray, 1 ) >= 100 ) {
$contentSummaryNoLink = $contentSummary;
$contentSummary .= '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '" class="text-decoration-none atb-green">Read More</a>';
} }
$cleanPost = Sanitize::contentShort( $instance->content );
// By Word
$wordsArray = explode( ' ', $cleanPost );
$wordSummary = implode( ' ', array_splice( $wordsArray, 0, 100 ) );
// By Line
$linesArray = explode( "\n", $cleanPost );
$lineSummary = implode( "\n", array_splice( $linesArray, 0, 5 ) );
if ( strlen( $wordSummary ) < strlen( $lineSummary ) ) {
$contentSummaryNoLink = $wordSummary;
$contentSummary = $wordSummary . '... <a href="{ROOT_URL}blog/post/' . $identifier . '" class="text-decoration-none">Read More</a>';
} else { } else {
$contentSummaryNoLink = $lineSummary; $contentSummaryNoLink = $lineSummary;
$contentSummary = $lineSummary . '... <a href="{ROOT_URL}blog/post/' . $instance->ID . '" class="text-decoration-none atb-green">Read More</a>'; $contentSummary = $lineSummary . '... <a href="{ROOT_URL}blog/post/' . $identifier . '" class="text-decoration-none">Read More</a>';
} }
$instance->contentSummaryNoLink = $contentSummaryNoLink; $instance->contentSummaryNoLink = $contentSummaryNoLink;
$instance->contentSummary = $contentSummary; $instance->contentSummary = $contentSummary;
@ -158,12 +168,15 @@ class Posts extends DatabaseModel {
$draft = ' <b>Draft</b>'; $draft = ' <b>Draft</b>';
} }
$instance->isDraft = $draft; $instance->isDraft = $draft;
$instance->authorName = $authorName; $instance->authorName = \ucfirst( $authorName );
if ( self::$comments !== false ) { if ( self::$comments !== false ) {
$instance->commentCount = self::$comments->count( 'blog', $instance->ID ); $instance->commentCount = self::$comments->count( 'blog', $instance->ID );
} else {
$instance->commentCount = 0;
} }
$instance->content = Filters::applyOne( 'mentions.0', $instance->content, true ); $instance->content = Filters::applyOne( 'mentions.0', $instance->content, true );
$instance->content = Filters::applyOne( 'hashtags.0', $instance->content, true ); $instance->content = Filters::applyOne( 'hashtags.0', $instance->content, true );
$out[] = $instance; $out[] = $instance;
if ( !empty( $end ) ) { if ( !empty( $end ) ) {
$out = $out[0]; $out = $out[0];
@ -291,6 +304,22 @@ class Posts extends DatabaseModel {
return $this->filter( $postData->results() ); return $this->filter( $postData->results() );
} }
public function findBySlug( $slug, $includeDraft = false ) {
$whereClause = [];
if ( $includeDraft !== true ) {
$whereClause = ['draft', '=', '0', 'AND'];
}
$whereClause = array_merge( $whereClause, ['slug', '=', $slug] );
$postData = self::$db->get( $this->tableName, $whereClause );
if ( !$postData->count() ) {
Debug::info( 'No Blog posts found.' );
return false;
}
return $this->filter( $postData->first() );
}
public function byMonth( $month, $year = 0, $includeDraft = false ) { public function byMonth( $month, $year = 0, $includeDraft = false ) {
if ( 0 === $year ) { if ( 0 === $year ) {
$year = date( 'Y' ); $year = date( 'Y' );

View File

@ -12,6 +12,14 @@
</div> </div>
</div> </div>
<!-- Slug -->
<div class="mb-3 row">
<label for="slug" class="col-lg-3 col-form-label text-end">URL Slug (for pretty linking):</label>
<div class="col-lg-6">
<input type="text" class="form-control" name="slug" id="slug" required>
</div>
</div>
<!-- form buttons --> <!-- form buttons -->
<div class="mb-3 row"> <div class="mb-3 row">
<div class="offset-3 col-lg-6"> <div class="offset-3 col-lg-6">

View File

@ -12,6 +12,14 @@
</div> </div>
</div> </div>
<!-- Slug -->
<div class="mb-3 row">
<label for="slug" class="col-lg-3 col-form-label text-end">URL Slug (for pretty linking):</label>
<div class="col-lg-6">
<input type="text" class="form-control" name="slug" id="slug" value="{slug}" required>
</div>
</div>
<!-- form buttons --> <!-- form buttons -->
<div class="mb-3 row"> <div class="mb-3 row">
<div class="offset-3 col-lg-6"> <div class="offset-3 col-lg-6">

View File

@ -21,7 +21,7 @@
<tbody> <tbody>
{LOOP} {LOOP}
<tr> <tr>
<td><a href="{ROOT_URL}admin/blog/view/{ID}">{title}</a>{isDraft}</td> <td><a href="{ROOT_URL}admin/blog/view/{ID}" class="text-decoration-none">{title}</a>{isDraft}</td>
<td>{authorName}</td> <td>{authorName}</td>
<td>{commentCount}</td> <td>{commentCount}</td>
<td>{DTC}{created}{/DTC}</td> <td>{DTC}{created}{/DTC}</td>

View File

@ -1,7 +1,7 @@
{LOOP} {LOOP}
<article class="blog-post"> <article class="blog-post">
<h2 class="blog-post-title mb-1">{title}</h2> <h2 class="blog-post-title mb-1">{title}</h2>
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none atb-green">{authorName}</a></p> <p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{authorName}" class="text-decoration-none atb-green">{authorName}</a></p>
<div class="well"> <div class="well">
{contentSummary} {contentSummary}
</div> </div>

View File

@ -3,7 +3,7 @@
<div class="blog-post"> <div class="blog-post">
<h2 class="blog-post-title">{title}</h2> <h2 class="blog-post-title">{title}</h2>
<hr> <hr>
<p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{author}" class="text-decoration-none atb-green">{authorName}</a></p> <p class="blog-post-meta">{DTC date}{created}{/DTC} by <a href="{ROOT_URL}home/profile/{authorName}" class="text-decoration-none atb-green">{authorName}</a></p>
{content} {content}
{ADMIN} {ADMIN}
<hr> <hr>

View File

@ -1,11 +1,15 @@
<div class="p-4"> <div class="card context-main-bg">
<h4 class="fst-italic">Archives</h4> <div class="card-header">
<ul class="list-unstyled mb-0"> <h3 class="card-title">Archives</h3>
</div>
<div class="card-body">
<ol class="list-unstyled">
{LOOP} {LOOP}
<li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}" class="text-decoration-none atb-green">{monthText} {year}</a></li> <li>({count}) <a href="{ROOT_URL}blog/month/{month}/{year}" class="text-decoration-none">{monthText} {year}</a></li>
{/LOOP} {/LOOP}
{ALT} {ALT}
<li>None To Show</li> <li>None To Show</li>
{/ALT} {/ALT}
</ul> </ol>
</div>
</div> </div>

View File

@ -49,13 +49,13 @@ class Comments extends AdminController {
$this->index(); $this->index();
} }
public function viewComments( $contentIID = null ) { public function viewComments( $contentID = null ) {
if ( empty( $contentIID ) ) { if ( empty( $contentID ) ) {
Issues::add( 'error', 'Content ID not found.' ); Issues::add( 'error', 'Content ID not found.' );
return $this->index(); return $this->index();
} }
$contentData = self::$comments->findById( $data ); $contentData = self::$comments->findById( $data );
if ( empty( $contentIID ) ) { if ( empty( $contentID ) ) {
return Views::view( 'comments.list', $commentData ); return Views::view( 'comments.list', $commentData );
} }
Issues::add( 'error', 'Comment not found.' ); Issues::add( 'error', 'Comment not found.' );

View File

@ -27,8 +27,6 @@ class Contact extends AdminController {
parent::__construct(); parent::__construct();
self::$title = 'Admin - Contact'; self::$title = 'Admin - Contact';
self::$contact = new ContactModel; self::$contact = new ContactModel;
$view = Navigation::activePageSelect( 'nav.admin', '/admin/contact' );
Components::set( 'ADMINNAV', $view );
} }
public function view( $id = null ) { public function view( $id = null ) {

View File

@ -0,0 +1,29 @@
<table class="table context-main">
<thead>
<tr>
<th style="width: 5%"></th>
<th style="width: 25%"></th>
<th style="width: 55%"></th>
<th style="width: 5%"></th>
<th style="width: 5%"></th>
</tr>
</thead>
<tbody>
{LOOP}
<tr>
<td>{ID}</td>
<td>{DTC}{time}{/DTC}</td>
<td>{feedback}</td>
<td><a href="{ROOT_URL}admin/contact/view/{ID}" class="btn btn-sm btn-primary"><i class="fa fa-fw fa-upload"></i></a></td>
<td><a href="{ROOT_URL}admin/contact/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
</tr>
{/LOOP}
{ALT}
<tr>
<td class="text-center" colspan="5">
No Contact forms to show.
</td>
</tr>
{/ALT}
</tbody>
</table>

View File

@ -0,0 +1,8 @@
<div class="context-main context-main-bg col-10 offset-1 my-3 p-3">
<div class="my-3 p-3">
{message_inbox}
</div>
<div class="my-3 p-3">
{message_outbox}
</div>
</div>

View File

@ -17,6 +17,8 @@ use TheTempusProject\Houdini\Classes\Issues;
use TheTempusProject\Classes\Controller; use TheTempusProject\Classes\Controller;
use TheTempusProject\Models\Notification as NotificationsModel; use TheTempusProject\Models\Notification as NotificationsModel;
use TheTempusProject\TheTempusProject as App; use TheTempusProject\TheTempusProject as App;
use TheTempusProject\Hermes\Functions\Redirect;
use TheTempusProject\Bedrock\Functions\Session;
class Notifications extends Controller { class Notifications extends Controller {
protected static $notifications; protected static $notifications;
@ -26,6 +28,10 @@ class Notifications extends Controller {
self::$notifications = new NotificationsModel; self::$notifications = new NotificationsModel;
self::$title = 'Notifications - {SITENAME}'; self::$title = 'Notifications - {SITENAME}';
self::$pageDescription = 'Your recent notifications'; self::$pageDescription = 'Your recent notifications';
if ( ! App::$isLoggedIn ) {
Session::flash( 'error', 'You do not have permission to access this page.' );
return Redirect::home();
}
} }
public function index() { public function index() {

View File

@ -115,7 +115,7 @@ class Notification extends DatabaseModel {
]; ];
if ( !self::$db->update( $this->tableName, $id, $fields ) ) { if ( !self::$db->update( $this->tableName, $id, $fields ) ) {
new CustomException( 'notificationDelete' ); new CustomException( 'notificationDelete' );
Debug::error( "Bookmarks: $id not updated" ); Debug::error( "Notifications: $id not updated" );
return false; return false;
} }
return true; return true;

View File

@ -3,13 +3,13 @@
<a <a
href="#" href="#"
class="d-flex align-items-center text-white text-decoration-none dropdown-toggle" class="d-flex align-items-center text-white text-decoration-none dropdown-toggle"
id="notiificationsDropdown" id="notificationsDropdown"
data-bs-toggle="dropdown" data-bs-toggle="dropdown"
aria-haspopup="true" aria-haspopup="true"
aria-expanded="false"> aria-expanded="false">
<i class="fa fa-fw fa-bell"></i><span class="ms-2">{NBADGE}</span> <i class="fa fa-fw fa-bell"></i><span class="">{NBADGE}</span>
</a> </a>
<ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="notiificationsDropdown"> <ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end text-small shadow" aria-labelledby="notificationsDropdown">
{LOOP} {LOOP}
<!-- Notification Item --> <!-- Notification Item -->
<li> <li>

View File

@ -1,40 +0,0 @@
<?php
/**
* app/plugins/redirects/plugin.php
*
* This houses all of the main plugin info and functionality.
*
* @package TP Redirects
* @version 3.0
* @author Joey Kimsey <Joey@thetempusproject.com>
* @link https://TheTempusProject.com
* @license https://opensource.org/licenses/MIT [MIT LICENSE]
*/
namespace TheTempusProject\Plugins;
use ReflectionClass;
use TheTempusProject\Classes\Installer;
use TheTempusProject\Houdini\Classes\Navigation;
use TheTempusProject\Classes\Plugin;
use TheTempusProject\TheTempusProject as App;
class Redirects extends Plugin {
public $pluginName = 'TP Redirects';
public $pluginAuthor = 'JoeyK';
public $pluginWebsite = 'https://TheTempusProject.com';
public $modelVersion = '1.0';
public $pluginVersion = '3.0';
public $pluginDescription = 'A simple plugin which adds redirects.';
public $permissionMatrix = [
'redirects' => [
'pretty' => 'Can modify redirects',
'default' => false,
],
];
public $admin_links = [
[
'text' => '<i class="fa fa-fw fa-external-link"></i> Redirects',
'url' => '{ROOT_URL}admin/routes',
],
];
}

View File

@ -38,7 +38,9 @@ class Subscribe extends Plugin {
public function __construct( $load = false ) { public function __construct( $load = false ) {
parent::__construct( $load ); parent::__construct( $load );
if ( ! self::$loaded ) { if ( ! self::$loaded ) {
if ( $this->checkEnabled() ) {
Components::append( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') ); Components::append( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') );
}
self::$loaded = true; self::$loaded = true;
} }
} }

View File

@ -34,14 +34,16 @@ class AdminLoader extends DefaultLoader {
} }
$links[$key]->url = '#' . $name . 'Dropdown'; $links[$key]->url = '#' . $name . 'Dropdown';
$links[$key]->text = '<span>' . $link->text . '</span><i class="fa fa-fw fa-caret-down ms-2"></i>'; $links[$key]->text = '<span>' . $link->text . '</span><i class="fa fa-fw fa-caret-down ms-2"></i>';
$links[$key]->duuuuuuuh = Views::simpleView( 'nav.adminSub', $out ); $links[$key]->subnav = Views::simpleView( 'nav.adminSub', $out );
} else { } else {
$links[$key]->linkClasses = 'nav-link'; $links[$key]->linkClasses = 'nav-link';
$links[$key]->linkAttributes = ''; $links[$key]->linkAttributes = '';
$links[$key]->duuuuuuuh = ''; $links[$key]->subnav = '';
} }
} }
Components::set( 'ADMIN_LINKS', Views::simpleView( 'nav.admin', $links ) ); $menu = Views::simpleView( 'nav.admin', $links );
$activeMenu = Navigation::activePageSelect( $menu, Input::get( 'url' ), false, true );
Components::set( 'ADMIN_LINKS', $activeMenu );
Navigation::setCrumbComponent( 'ADMIN_BREADCRUMBS', Input::get( 'url' ) ); Navigation::setCrumbComponent( 'ADMIN_BREADCRUMBS', Input::get( 'url' ) );
} }
} }

View File

@ -31,6 +31,7 @@ class DefaultLoader extends Loader {
if ( self::$loaded ) { if ( self::$loaded ) {
return; return;
} }
Components::set( 'DARK_MODE_SETTING', '' );
Components::set( 'TEMPLATE_URL', Template::parse( '{ROOT_URL}app/templates/default/' ) ); Components::set( 'TEMPLATE_URL', Template::parse( '{ROOT_URL}app/templates/default/' ) );
if ( VENDOR_AUTOLOADED === true ) { if ( VENDOR_AUTOLOADED === true ) {
Components::set( 'FONT_AWESOME_URL', '/vendor/fortawesome/font-awesome/css/' ); Components::set( 'FONT_AWESOME_URL', '/vendor/fortawesome/font-awesome/css/' );
@ -54,9 +55,11 @@ class DefaultLoader extends Loader {
*/ */
if ( App::$isLoggedIn ) { if ( App::$isLoggedIn ) {
if ( ! empty( App::$activePrefs['darkMode'] ) ) { if ( ! empty( App::$activePrefs['darkMode'] ) ) {
Components::set( 'DARK_MODE_SETTING', 'true' );
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' ); $this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet">' ); $this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet">' );
} else { } else {
Components::set( 'DARK_MODE_SETTING', 'false' );
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' ); $this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main.css">' );
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' ); $this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' );
} }
@ -70,7 +73,9 @@ class DefaultLoader extends Loader {
$this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' ); $this->addCss( '<link rel="stylesheet" href="{ROOT_URL}app/css/main-dark.css" id="dark-mode-stylesheet" disabled>' );
} }
Components::set( 'topNavRight', Template::parse( App::$topNavRight . '{STATUS}' ) ); Components::set( 'topNavRight', Template::parse( App::$topNavRight . '{STATUS}' ) );
Components::set( 'topNavLeft', Views::simpleView( 'nav.main', Navigation::getMenuLinks( App::MAIN_MENU_NAME ) ) ); $menu = Views::simpleView( 'nav.main', Navigation::getMenuLinks( App::MAIN_MENU_NAME ) );
$activeMenu = Navigation::activePageSelect( $menu, Input::get( 'url' ), false, true );
Components::set( 'topNavLeft', $activeMenu );
Components::set( 'colorSelect', Views::simpleView( 'forms.colorSelect' ) ); Components::set( 'colorSelect', Views::simpleView( 'forms.colorSelect' ) );
Components::set( 'iconSelect', Views::simpleView( 'forms.iconSelect' ) ); Components::set( 'iconSelect', Views::simpleView( 'forms.iconSelect' ) );
Navigation::setCrumbComponent( 'BREADCRUMB', Input::get( 'url' ) ); Navigation::setCrumbComponent( 'BREADCRUMB', Input::get( 'url' ) );

View File

@ -55,6 +55,7 @@
</header> </header>
<div class="d-flex flex-column min-vh-100"> <div class="d-flex flex-column min-vh-100">
<div class="flex-container flex-grow-1"> <div class="flex-container flex-grow-1">
<!-- Issues -->
{ISSUES} {ISSUES}
<div class="container pt-4"> <div class="container pt-4">
<div class="row"> <div class="row">
@ -65,10 +66,14 @@
</div> </div>
</div> </div>
{/ISSUES} {/ISSUES}
<!-- Main Page Content -->
{CONTENT} {CONTENT}
</div> </div>
<!-- Footer -->
{FOOT} {FOOT}
</div> </div>
<!-- User Pref to control Dark mode across frontend and backend -->
<input type="hidden" name="dark-mode-pref" id="dark-mode-pref" value="{DARK_MODE_SETTING}">
<!-- Bootstrap core JavaScript and jquery --> <!-- Bootstrap core JavaScript and jquery -->
<script crossorigin="anonymous" src="{JQUERY_CDN}jquery.min.js"></script> <script crossorigin="anonymous" src="{JQUERY_CDN}jquery.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script> <script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>

View File

@ -8,9 +8,38 @@
{commentDash} {commentDash}
</div> </div>
</div> </div>
<div class="row">
<div class="col-10 offset-1">
{contactDash}
</div>
</div>
<div class="row"> <div class="row">
<div class="col-10 offset-1"> <div class="col-10 offset-1">
{blogDash} {blogDash}
</div> </div>
</div> </div>
</div> </div>
<legend class="text-center my-2">Results</legend>
<form method="post">
<fieldset>
<!-- Search -->
<div class="mb-3 row">
<label for="searchTerm" class="col-lg-6 col-form-label text-end">Search:</label>
<div class="col-lg-2">
<input type="text" class="form-control" name="searchTerm" id="searchTerm">
</div>
</div>
<!-- Hidden Token -->
<input type="hidden" name="token" value="{TOKEN}">
<!-- Submit Button -->
<div class="text-center">
<button type="submit" name="submit" value="submit" class="btn btn-primary btn-lg">Search</button>
</div>
</fieldset>
</form>
<div class="col-5 offset-1">
{searchResults}
</div>

View File

@ -18,8 +18,8 @@
<tbody> <tbody>
{LOOP} {LOOP}
<tr> <tr>
<td><a href="{ROOT_URL}admin/groups/view/{ID}">{name}</a></td> <td><a href="{ROOT_URL}admin/groups/view/{ID}" class="text-decoration-none">{name}</a></td>
<td><a href="{ROOT_URL}admin/groups/listmembers/{ID}">{userCount}</a></td> <td><a href="{ROOT_URL}admin/groups/listmembers/{ID}" class="text-decoration-none">{userCount}</a></td>
<td><a href="{ROOT_URL}admin/groups/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td> <td><a href="{ROOT_URL}admin/groups/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/groups/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td> <td><a href="{ROOT_URL}admin/groups/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
<td> <td>

View File

@ -1,5 +1,7 @@
<h1>{groupName} <small>user list</small></h1> <div class="context-main-bg context-main p-3">
{PAGINATION} <legend class="text-center">{groupName} <small>user list</small></legend>
<hr>
{ADMIN_BREADCRUMBS}
<form action="{ROOT_URL}admin/users/delete" method="post"> <form action="{ROOT_URL}admin/users/delete" method="post">
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
@ -18,7 +20,7 @@
{LOOP} {LOOP}
<tr> <tr>
<td>{ID}</td> <td>{ID}</td>
<td><a href='{ROOT_URL}admin/users/view/{ID}'>{username}</a></td> <td><a href='{ROOT_URL}admin/users/view/{ID}' class="text-decoration-none">{username}</a></td>
<td>{DTC date}{registered}{/DTC}</td> <td>{DTC date}{registered}{/DTC}</td>
<td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td> <td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td> <td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>
@ -38,3 +40,4 @@
</table> </table>
<button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button> <button name="submit" value="submit" type="submit" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></button>
</form> </form>
</div>

View File

@ -17,7 +17,7 @@
<tbody> <tbody>
{LOOP} {LOOP}
<tr> <tr>
<td><a href="{ROOT_URL}admin/plugins/view/{name}">{name}</a></td> <td><a href="{ROOT_URL}admin/plugins/view/{name}" class="text-decoration-none">{name}</a></td>
<td>{enabled_txt}</td> <td>{enabled_txt}</td>
<td>{installStatus}</td> <td>{installStatus}</td>
<td>{version}</td> <td>{version}</td>

View File

@ -22,7 +22,7 @@
{LOOP} {LOOP}
<tr> <tr>
<td align="center">{ID}</td> <td align="center">{ID}</td>
<td><a href='{ROOT_URL}admin/routes/view/{ID}'>{nickname}</a></td> <td><a href='{ROOT_URL}admin/routes/view/{ID}' class="text-decoration-none">{nickname}</a></td>
<td>{redirect_type}</td> <td>{redirect_type}</td>
<td>{original_url}</td> <td>{original_url}</td>
<td>{forwarded_url}</td> <td>{forwarded_url}</td>

View File

@ -1,4 +1,6 @@
<div class="context-main-bg context-main p-3"> <div class="context-main-bg context-main p-3">
<legend class="text-center">Settings</legend>
<hr>
{ADMIN_BREADCRUMBS} {ADMIN_BREADCRUMBS}
<form action="" method="post" class="form-horizontal" enctype="multipart/form-data"> <form action="" method="post" class="form-horizontal" enctype="multipart/form-data">
<fieldset> <fieldset>

View File

@ -14,7 +14,7 @@
<tbody> <tbody>
{LOOP} {LOOP}
<tr> <tr>
<td><a href='{ROOT_URL}admin/tokens/view/{ID}'>{name}</a></td> <td><a href='{ROOT_URL}admin/tokens/view/{ID}' class="text-decoration-none">{name}</a></td>
<td>{token_type}</td> <td>{token_type}</td>
<td><a href="{ROOT_URL}admin/tokens/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td> <td><a href="{ROOT_URL}admin/tokens/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/tokens/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td> <td><a href="{ROOT_URL}admin/tokens/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>

View File

@ -20,7 +20,7 @@
{LOOP} {LOOP}
<tr> <tr>
<td align="center">{ID}</td> <td align="center">{ID}</td>
<td><a href='{ROOT_URL}admin/users/view/{ID}'>{username}</a></td> <td><a href='{ROOT_URL}admin/users/view/{ID}' class="text-decoration-none">{username}</a></td>
<td>{DTC date}{registered}{/DTC}</td> <td>{DTC date}{registered}{/DTC}</td>
<td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td> <td><a href="{ROOT_URL}admin/users/edit/{ID}" class="btn btn-sm btn-warning"><i class="fa fa-fw fa-pencil"></i></a></td>
<td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td> <td><a href="{ROOT_URL}admin/users/delete/{ID}" class="btn btn-sm btn-danger"><i class="fa fa-fw fa-trash"></i></a></td>

View File

@ -1 +1 @@
<span>© 2024 AllTheBookmarks, Powered by <a href="https://thetempusproject.com" class="text-decoration-none atb-green">The Tempus Project</a>.</span> <span>© 2025 AllTheBookmarks, Powered by <a href="https://thetempusproject.com" class="text-decoration-none atb-green">The Tempus Project</a>.</span>

View File

@ -20,11 +20,11 @@
</p> </p>
<!-- Call-to-Action Buttons --> <!-- Call-to-Action Buttons -->
<div class="d-flex justify-content-center gap-3 mt-4"> <div class="d-flex justify-content-center gap-3 mt-4">
<a href="/login" class="btn btn-success btn-lg"> <a href="/home/login" class="btn btn-success btn-lg">
<i class="fa fa-sign-in-alt me-2"></i> Log In <i class="fa fa-sign-in-alt me-2"></i> Log In
</a> </a>
<a href="/dashboard" class="btn btn-outline-success btn-lg"> <a href="/home/index" class="btn btn-outline-success btn-lg">
<i class="fa fa-cogs me-2"></i> Go to Dashboard <i class="fa fa-cogs me-2"></i> Go to Homepage
</a> </a>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-md-10">
<legend class="my-3 text-center">Configure</legend> <legend class="my-3 text-center">Configure</legend>

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-md-10">
<p class="my-4">All models are required for proper installation of The Tempus Project. In this step, we will add the database tables required for these models. In the next step, you'll be able to select which plugins you would like installed.</p> <p class="my-4">All models are required for proper installation of The Tempus Project. In this step, we will add the database tables required for these models. In the next step, you'll be able to select which plugins you would like installed.</p>

View File

@ -1,12 +1,12 @@
<ul class="nav nav-tabs justify-content-center" role="tablist"> <div class="nav nav-tabs justify-content-center pt-3 col-10 offset-1" id="nav-tab" role="tablist">
<li class="nav-item {menu-Welcome}"><a href="#" class="nav-link">Welcome</a></li> <button class="nav-link {menu-Welcome}" type="button" role="tab">Welcome</button>
<li class="nav-item {menu-Terms}"><a href="#" class="nav-link">Terms</a></li> <button class="nav-link {menu-Terms}" type="button" role="tab">Terms</button>
<li class="nav-item {menu-Verify}"><a href="#" class="nav-link">Verify</a></li> <button class="nav-link {menu-Verify}" type="button" role="tab">Verify</button>
<li class="nav-item {menu-Configure}"><a href="#" class="nav-link">Configure</a></li> <button class="nav-link {menu-Configure}" type="button" role="tab">Configure</button>
<li class="nav-item {menu-Routing}"><a href="#" class="nav-link">Routing</a></li> <button class="nav-link {menu-Routing}" type="button" role="tab">Routing</button>
<li class="nav-item {menu-Models}"><a href="#" class="nav-link">Models</a></li> <button class="nav-link {menu-Models}" type="button" role="tab">Models</button>
<li class="nav-item {menu-Plugins}"><a href="#" class="nav-link">Plugins</a></li> <button class="nav-link {menu-Plugins}" type="button" role="tab">Plugins</button>
<li class="nav-item {menu-Resources}"><a href="#" class="nav-link">Resources</a></li> <button class="nav-link {menu-Resources}" type="button" role="tab">Resources</button>
<li class="nav-item {menu-User}"><a href="#" class="nav-link">User</a></li> <button class="nav-link {menu-User}" type="button" role="tab">User</button>
<li class="nav-item {menu-Complete}"><a href="#" class="nav-link">Complete</a></li> <button class="nav-link {menu-Complete}" type="button" role="tab">Complete</button>
</ul> </div>

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-md-10">
<p class="my-4"> <p class="my-4">

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-md-10">
<p class="my-4"> <p class="my-4">

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-md-10">
<p class="mt-4">The Tempus Project uses rewrites in htaccess files (Apache), or location directives (Nginx), to automatically route all incoming traffic through the app. In this step, we will help set-up and then test that the required configurations have been made.</p> <p class="mt-4">The Tempus Project uses rewrites in htaccess files (Apache), or location directives (Nginx), to automatically route all incoming traffic through the app. In this step, we will help set-up and then test that the required configurations have been made.</p>

View File

@ -1,13 +0,0 @@
<div class="container">
<div class="row justify-content-center">
<div class="col-md-10 text-center">
{installer-nav}
<h1 class="mt-4">Welcome to The Tempus Project Installer.</h1>
<p>This installer will guide you through the process of installing and configuring The Tempus Project. Do not forget to delete this file once you have completed installation.</p>
<form method="post">
<input type="hidden" name="token" value="{TOKEN}">
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" value="submit">Begin Installation</button><br>
</form>
</div>
</div>
</div>

View File

@ -1,7 +1,7 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-10">
<div class="install-terms col-lg-8 mx-auto mt-4"> <div class="install-terms col-lg-8 mx-auto mt-4">
{TERMS} {TERMS}
</div> </div>

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10 pt-4"> <div class="col-md-10 pt-4">
<form action="" method="post" class="form-horizontal"> <form action="" method="post" class="form-horizontal">

View File

@ -1,5 +1,5 @@
<div class="context-main-bg my-3 pb-3 rounded col-10 offset-1">
{installer-nav} {installer-nav}
<div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-10"> <div class="col-md-10">
<h2 class="mt-4">Requirements</h2> <h2 class="mt-4">Requirements</h2>

View File

@ -0,0 +1,17 @@
<div class="container">
<div class="row justify-content-center">
<div class="col-md-10 text-center">
<div class="context-main-bg my-3 pb-3 rounded">
{installer-nav}
<h1 class="mt-4">Welcome to The Tempus Project Installer.</h1>
<p>
This installer will guide you through the process of installing and configuring The Tempus Project. Do not forget to delete this file once you have completed installation.
</p>
<form action="" method="post">
<input type="hidden" name="token" value="{TOKEN}">
<button class="btn btn-lg btn-primary center-block" type="submit" name="submit" id="submit" value="submit">Begin Installation</button><br>
</form>
</div>
</div>
</div>
</div>

View File

@ -4,7 +4,7 @@
<a href="{url}" class="text-white {linkClasses}" {linkAttributes}> <a href="{url}" class="text-white {linkClasses}" {linkAttributes}>
{text} {text}
</a> </a>
{duuuuuuuh} {subnav}
</li> </li>
{/LOOP} {/LOOP}
</ul> </ul>

View File

@ -1,6 +1,6 @@
<ul class="collapse list-unstyled ms-3 text-small shadow" id="{dropdownName}Dropdown"> <ul class="collapse list-unstyled ms-3 text-small shadow" id="{dropdownName}Dropdown">
{LOOP} {LOOP}
<li class="nav-item"><a href="{url}" class="nav-link text-white">{text}</a></li> <li class="nav-item"><a href="{url}" class="submenu nav-link text-white">{text}</a></li>
{/LOOP} {/LOOP}
</ul> </ul>

View File

@ -1,5 +1,13 @@
<ul class="nav col-12 col-lg-auto mb-2 justify-content-center mb-md-0 mx-auto"> <nav class="navbar navbar-expand col-12 col-lg-auto mb-2 justify-content-center mb-md-0 mx-auto">
<div class="container-fluid">
<ul class="navbar-nav">
{LOOP} {LOOP}
<li><a href="{url}" class="nav-link px-2 atb-green">{text}</a></li> <li class="nav-item">
<a href="{url}" class="nav-link px-2 text-white">
{text}
</a>
</li>
{/LOOP} {/LOOP}
</ul> </ul>
</div>
</nav>

View File

@ -3,7 +3,7 @@
<hr> <hr>
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-6"> <div class="col-md-6">
<form action="" method="post" class=""> <form action="" method="post" class="" enctype="multipart/form-data">
<fieldset> <fieldset>
{PREFERENCES_FORM} {PREFERENCES_FORM}
</fieldset> </fieldset>

View File

@ -100,6 +100,10 @@ class TheTempusProject extends Bedrock {
'text' => '<i class="fa fa-fw fa-shield-halved"></i> Tokens', 'text' => '<i class="fa fa-fw fa-shield-halved"></i> Tokens',
'url' => '{ROOT_URL}admin/tokens', 'url' => '{ROOT_URL}admin/tokens',
], ],
[
'text' => '<i class="fa-solid fa-image"></i> Images',
'url' => '{ROOT_URL}admin/images',
],
[ [
'text' => '<i class="fa fa-fw fa-arrow-down"></i> Modules', 'text' => '<i class="fa fa-fw fa-arrow-down"></i> Modules',
'url' => [ 'url' => [
@ -292,6 +296,11 @@ class TheTempusProject extends Bedrock {
"pretty" => "Enable CSRF Token for all forms.", "pretty" => "Enable CSRF Token for all forms.",
"default" => true "default" => true
], ],
"registrationEnabled" => [
"type" => "radio",
"pretty" => "Allow new users to register an account.",
"default" => true
],
"loginLimit" => [ "loginLimit" => [
"type" => "text", "type" => "text",
"pretty" => "Maximum Login Attempts per hour", "pretty" => "Maximum Login Attempts per hour",
@ -308,14 +317,12 @@ class TheTempusProject extends Bedrock {
"type" => "radio", "type" => "radio",
"pretty" => "Upload Images Enabled", "pretty" => "Upload Images Enabled",
"default" => true, "default" => true,
"protected"=> true,
"value" => true, "value" => true,
], ],
"maxImageSize"=> [ "maxImageSize"=> [
"type" => "text", "type" => "text",
"pretty" => "Maximum size for image uploads", "pretty" => "Maximum size for image uploads",
"default" => 500000, "default" => 500000,
"protected" => true,
"value" => 500000, "value" => 500000,
] ]
], ],
@ -430,7 +437,8 @@ class TheTempusProject extends Bedrock {
"url" => "{ROOT_URL}usercp/password", "url" => "{ROOT_URL}usercp/password",
"name" => "Change Password" "name" => "Change Password"
]; ];
Components::set( 'SITE_URL', Routes::getAddress() );
Components::set( 'DEBUG_EMAIL', DEBUG_EMAIL );
Debug::gend(); Debug::gend();
} }

View File

@ -23,9 +23,9 @@
"components/jquery": "1.9.*", "components/jquery": "1.9.*",
"fortawesome/font-awesome": "4.7", "fortawesome/font-awesome": "4.7",
"stripe/stripe-php": "^16.3", "stripe/stripe-php": "^16.3",
"thetempusproject/bedrock": "1.0.10", "thetempusproject/bedrock": "1.1.1",
"thetempusproject/canary": "1.0.5", "thetempusproject/canary": "1.0.6",
"thetempusproject/houdini": "1.0.8", "thetempusproject/houdini": "2.0.2",
"twbs/bootstrap": "5.2.3" "twbs/bootstrap": "5.2.3"
}, },
"autoload": "autoload":

View File

@ -23,7 +23,7 @@ use TheTempusProject\Hermes\Functions\Route;
use TheTempusProject\Houdini\Classes\Components; use TheTempusProject\Houdini\Classes\Components;
use TheTempusProject\Houdini\Classes\Views; use TheTempusProject\Houdini\Classes\Views;
// I switched to cloudflare which uses a dynamic proxy kinda thing, so any IP address lookups go wonky unless i get the OG IIP // I switched to cloudflare which uses a dynamic proxy kinda thing, so any IP address lookups go wonky unless i get the OG IP
if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) && filter_var( $_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP ) ) { if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) && filter_var( $_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP ) ) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
} }
@ -36,21 +36,18 @@ if ( isset( $_SERVER['HTTP_CF_CONNECTING_IP'] ) && filter_var( $_SERVER['HTTP_CF
*/ */
$url = ''; $url = '';
$app = new TheTempusProject();
if ( Input::exists( 'error' ) ) { if ( Input::exists( 'error' ) ) {
switch ( Input::get( 'error' ) ) { switch ( Input::get( 'error' ) ) {
case 'image404': case 'image404':
Redirect::to( 'images/imageNotFound.png' ); Redirect::to( 'images/imageNotFound.png' );
exit; exit;
default:
$app->setUrl( 'error/' . Input::get( 'error' ) );
break;
} }
} elseif ( stripos( Route::getUri(), 'install.php' ) ) { } elseif ( stripos( Route::getUri(), 'install.php' ) ) {
require_once 'install.php'; require_once 'install.php';
} }
$app = new TheTempusProject();
if ( CANARY_ENABLED ) { if ( CANARY_ENABLED ) {
ini_set( 'display_errors', '1' ); ini_set( 'display_errors', '1' );
ini_set( 'display_startup_errors', '1' ); ini_set( 'display_startup_errors', '1' );