wip
This commit is contained in:
64
app/controllers/downloads.php
Normal file
64
app/controllers/downloads.php
Normal file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* app/controllers/hermes.php
|
||||
*
|
||||
* This is the hermes 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;
|
||||
|
||||
use TheTempusProject\Hermes\Functions\Redirect;
|
||||
use TheTempusProject\Bedrock\Functions\Session;
|
||||
use TheTempusProject\Bedrock\Functions\Check;
|
||||
use TheTempusProject\Bedrock\Functions\Input;
|
||||
use TheTempusProject\Hermes\Functions\Route as Routes;
|
||||
use TheTempusProject\Houdini\Classes\Issues;
|
||||
use TheTempusProject\Houdini\Classes\Views;
|
||||
use TheTempusProject\Houdini\Classes\Components;
|
||||
use TheTempusProject\Houdini\Classes\Template;
|
||||
use TheTempusProject\Classes\Controller;
|
||||
use TheTempusProject\Classes\Forms;
|
||||
use TheTempusProject\TheTempusProject as App;
|
||||
|
||||
class Downloads extends Controller {
|
||||
public function index() {
|
||||
Session::flash( 'success', 'Unknown download.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
public function resume( $extension = 'none' ) {
|
||||
if ( ! in_array( $extension, ['docx','pdf','md','txt'] ) ) {
|
||||
Session::flash( 'success', 'Unknown download.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
|
||||
$file = APP_ROOT_DIRECTORY . 'downloads' . DIRECTORY_SEPARATOR . 'JoeyKimsey-resume-2025.' . $extension;
|
||||
|
||||
// Check if the file exists
|
||||
if (file_exists($file)) {
|
||||
// Set headers to force the download
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Length: ' . filesize($file));
|
||||
|
||||
// Clear the output buffer
|
||||
ob_clean();
|
||||
flush();
|
||||
|
||||
// Read and output the file
|
||||
readfile($file);
|
||||
exit;
|
||||
} else {
|
||||
Session::flash( 'success', 'Unknown download.' );
|
||||
return Redirect::to( 'home/index' );
|
||||
}
|
||||
}
|
||||
}
|
@ -27,8 +27,24 @@ use TheTempusProject\TheTempusProject as App;
|
||||
class Home extends Controller {
|
||||
public function index() {
|
||||
self::$title = '{SITENAME}';
|
||||
self::$pageDescription = '{SITENAME} is here to provide you a better, faster, and easier - way to create and manage your own web applications.';
|
||||
Views::view( 'index' );
|
||||
self::$pageDescription = 'Joey Kimsey is a web app developer with nearly a decade of professional experience and another decade of hands on experience.';
|
||||
$optionValues = [
|
||||
(object) [ "post" => "python-dev", "option" => "Python Developer" ],
|
||||
(object) [ "post" => "ecommerce-coder", "option" => "eCommerce Coder" ],
|
||||
(object) [ "post" => "php-experience", "option" => "PHP Developer" ],
|
||||
(object) [ "post" => "ai-experience", "option" => "GPT-Agent" ],
|
||||
(object) [ "post" => "operations-experience", "option" => "DevOps Engineer" ],
|
||||
(object) [ "post" => "lua-dev", "option" => "Lua Developer" ],
|
||||
(object) [ "post" => "version-control", "option" => "Git Goblin" ],
|
||||
(object) [ "post" => "laravel-experience", "option" => "Laravel Developer" ],
|
||||
(object) [ "post" => "database-experience", "option" => "Database Admin" ],
|
||||
(object) [ "post" => "education", "option" => "Student" ],
|
||||
(object) [ "post" => "full-stack-developer", "option" => "Full-Stack Developer" ],
|
||||
(object) [ "post" => "stripe-certified-developer", "option" => "Stripe Certified Developer" ],
|
||||
|
||||
];
|
||||
shuffle($optionValues);
|
||||
Views::view( 'index', $optionValues );
|
||||
}
|
||||
|
||||
public function login() {
|
||||
@ -91,19 +107,13 @@ class Home extends Controller {
|
||||
|
||||
public function about() {
|
||||
self::$title = 'About - {SITENAME}';
|
||||
self::$pageDescription = '{SITENAME} was started by a developer with years of industry experience which has lead to a refined no-nonsense tool for everyone. Find out more about us here.';
|
||||
self::$pageDescription = 'Just a bit more info on me.';
|
||||
Views::view( 'about' );
|
||||
}
|
||||
|
||||
public function privacy() {
|
||||
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.';
|
||||
Views::view( 'privacy' );
|
||||
}
|
||||
|
||||
public function faq() {
|
||||
self::$title = 'Frequently Asked Questions - {SITENAME}';
|
||||
self::$pageDescription = 'Many times, we aren\'t the first to ask why or how something works. Here you will find a list of {SITENAME} commonly asked questions and our best answers.' ;
|
||||
Views::view( 'faq' );
|
||||
public function hire() {
|
||||
self::$title = 'Consulting and Freelance - {SITENAME}';
|
||||
self::$pageDescription = 'More details on how to hire me for consulting or freelance work.';
|
||||
Views::view( 'hire' );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user