diff --git a/.gitignore b/.gitignore index 433fc3b..a32fd2a 100644 --- a/.gitignore +++ b/.gitignore @@ -54,7 +54,6 @@ Temporary Items # TheTempusProject Specific .htaccess -app/config/* !app/config/constants.php uploads/images/* logs/* diff --git a/README.md b/README.md index 1beb543..3515873 100644 --- a/README.md +++ b/README.md @@ -1,131 +1,374 @@ # The Tempus Project -_Rapid Prototyping Framework built on PHP utilizing the MVC pattern with a Bootstrap front-end_ -__Developer(s):__ +need to make a vs battle for dnd. someone makes a truly broken character, we take the base character and hand it to two people and give them some time to figure out how they would break it -- __Joey Kimsey__ - _Lead Developer_ +need to track points once a week + +a huge table tracks points day to day then we add and erase the old data, or move it to historical... + +## Rapid Prototyping Framework + +### Developer(s): Joey Kimsey The aim of this project is to provide a simple and stable platform from which to easily add functionality. The goal being the ability to quickly build and test new projects with a lightweight ecosystem to help. -**Notice: This code is in _still_ not production ready. This framework is provided as is, use at your own risk.**\ +**Notice: This code is in _still_ not production ready. This framework is provided as is, use at your own risk.** I am working very hard to ensure the system is safe and reliable enough for me to endorse its widespread use. Unfortunately, it still needs a lot of QA and improvements. -## Table of contents - -[[_TOC_]] - -## Find Us - -* [DockerHub](https://hub.docker.com/repositories/thetempusproject) -* [Packagist](https://packagist.org/users/joeyk4816/packages/) -* [GitLab](https://git.thetempusproject.com/the-tempus-project/thetempusproject) - -## Summary - -The Tempus Project is a PHP application utilizing the MVC pattern to serve up simple pages and APIs with minimal effort. It requires a MySQL database to function and is designed to run equally well with nginx or apache powering the webserver. Most of the core functionality is developed in house and provided through dependencies. At this time, the frontend is driven on bootstrap 3 and FontAwesome for simplicity. +Currently I am in the process of testing all the systems in preparation for the first production ready release. The beta is still on-going. If you would like to participate or stay up to date with the latest, you can find more information at: https://TheTempusProject.com/beta ## Features -- A Plugin system that allows plug-and-play functionality -- A User management system - - groups - - permissions - - preferences - - registration and recovery - (All Controlled dynamically via our plugin interface) -- Compatibility with both Apache and NGINX -- Built with Bootstrap with a focus on mobile compatibility -- Incredibly easy to set-up, deploy, and develop +A User management system with groups, permissions, preferences, registration, and recovery. (All Controlled dynamically via our plugin interface) +A Plugin system that allows plug-and-play functionality for a huge number of features. +Compatibility with both Apache and NGINX. +Built with Bootstrap with a focus on mobile compatibility. +Incredibly easy to set-up, deploy, and develop with. ## Installation -The preferred method for installation is [Composer](#composer) but special attention has been given to installation and usage [without Composer](#composer). - -### Composer - -The simplest method to start a new project is to use composer to create a new project and automatically clone all the necessary files: - -#### via create-project - -``` -composer create-project thetempusproject/thetempusproject test-app -``` - -#### via clone & install - -1. Clone the directory to wherever you want to install the framework. -`git clone https://git.thetempusproject.com/the-tempus-project/thetempusproject.git ` -1. Open your terminal to the directory you previously cloned the repository. -`cd ` -1. Install using composer: -`php composer.phar install` +Preferred method for installation is using composer. ### Manually +### Docker + +### Composer + 1. Clone the directory to wherever you want to install the framework. -`git clone https://git.thetempusproject.com/the-tempus-project/thetempusproject.git ` -1. Open your terminal to the directory you previously cloned the repository. -`cd /` -1. Clone the dependency directories to the vendor/ folder. -``` -cd vendor/ -git clone https://git.thetempusproject.com/the-tempus-project/bedrock.git bedrock -git clone https://git.thetempusproject.com/the-tempus-project/canary.git canary -git clone https://git.thetempusproject.com/the-tempus-project/hermes.git hermes -git clone https://git.thetempusproject.com/the-tempus-project/houdini.git houdini -``` +2. Open your terminal to the directory you previously cloned the repository. +3. Install using composer: +`php composer.phar install` +4. Open your browser and navigate to install.php (it will be in the root directory of your installation) +5. When prompted, complete the forms and complete the process. -__Note:__ The autoloader should automatically detect and use the dependencies, but they need to be sorted into the folders ans shown above. +#### Apache +#### NGINX -## Docker +#### Docker-Compose -To enable quick deployment and collaboration The Tempus Project is distributed with the files to build your own docker images or stack with apache or nginx The included `docker-compose.yml` will load up an entire stack including apache and nginx, as well as a MySQL server with phpmyadmin. +If you have any trouble with the installation, you can check out our FAQ page on the wiki for answers to common issues. -You will need docker installed on your system then you can either download the latest images from DockerHud: +If you would like a full copy of the project with all of its included dependencies you can find it at https://github.com/TheTempusProject/TempusProjectFull +Please note this repository is only up to the latest _stable_ release. Please continue to use composer update to get the latest development releases. -``` -docker pull thetempusproject/ttp-apache -docker pull thetempusproject/ttp-nginx -``` +**Do not forget to remove install.php once you have finished installation!** -Or you can build your own images from this repository. More information can be found in the included README files: - -* [Apache Image](docker/ttp-apache/README.md) -* [Nginx Image](docker/ttp-nginx/README.md) - -### Docker-Compose - -The Docker stack included here will build new versions of the nginx and apache webserver and launch them in individual containers. It will also create 2 more containers; one for php, and one for phpmyadmin. - -``` -docker-compose -f docker-compose.yml up --build -d --no-cache -``` - -__Note:__ If you cloned the repository from git, you will need to copy the `docker/.env.example` to `.env` in the root directory and update the contents before proceeding with docker-compose. - -## Contributing - -TheTempusProject is an open source project and welcomes community contributions. Please refer to the [Contributing file](CONTRIBUTING.md) for more details. - -## License - -See the [LICENSE](LICENSE) file for licensing information as it pertains to files in this repository. - -## Known Issues - -- [ ] The blog plugin should add a welcome post during the installResources step of the installer. It doesn't work right now. - -## Currently being developed +#### Currently being developed - [ ] Adding documentation -- [ ] Unit testing +- [ ] Unit tests -## Future updates +#### Future updates - [ ] Expansion of PDO to allow different database types -- [ ] Update installer to account for database deltas, allowing easy updating. +- [ ] Update installer to account for updates. - [ ] Implement uniformity in terms of error reporting, exceptions, logging. -- [ ] I want to make an api that allows you to download and install new plugins from a centralized repository -- [ ] i want plugin instalation to be compatible with composer for easier management of added plugins. +- [ ] The templating system has gotten too large and needs to be split into its own repo + +TTP ToDo: + +need to integrate new plugins for some moved features + canary + comments + members + messages + Split inbox and outbox apart + split messages from usercp + redirects + +need to make sure all 'use ' statements are updated to new repo names + + namespace TempusDebugger; => namespace TheTempusProject\Canary; + namespace TheTempusProject\Houdini; => namespace TheTempusProject\houdini; + namespace TheTempusProject/TempusTool; => namespace TheTempusProject\Overwatch; +need a mechanism for handeling config/constants.php in each plugin + migrate all 'secondary' constants (constants not used in the default execution of the application) to plugin folders + +Perform final F & R for: +"tpc" + + + + need better handeling around blog filters like month and day + +split profile from usercp + + +need a way to secure the api +need a standard way to do apis +need a way to show parts conditionally like {@if} + need + if + else + elseif +need a way to show something conditionally if a plugin is enabled + like {@enabled:comments} + {comments} + {@enabled} + +https://css-tricks.com/drag-and-drop-file-uploading/ + +https://www.smashingmagazine.com/2018/01/drag-drop-file-uploader-vanilla-js/ + + + + + +need to merge both autoloaders into the same one under bin +need to be able to install multiple database tables for the same plugin + + +rename default.js and .css to main.js/css +fix where i moved those to the app/css and app/js folders + + + +make a new template repo/dependency +make a new Debug repo/dependency +Fix the plugin +fix the console logger + +add the ability to include js files +add the ability to include css files as needed + + chat should include a config for the refresh timer + + + + +and better error handeling for models and plugins +need to make a singular list function to remove or combine these: + listGroupsSimple + listPosts + + + + + + +i need to move everything moderator relateed to comments +i also need to make sure that moderators can actually moderate + + + + + +the get form html thing should work perfectly with the database array to create hella simple to generate forms for anything + + + + + + + + + +we are not doing anything with requiredPlugins + + +comments and blog are being manually added in the admin dashboard, this could be a problem when they are disabled + + + + + + + + + + + +removed from blog filter +commentCount + + + +need to address the error handler just failing to work + +and the exception handler picking up random errors + + +need to revisit all of the form checking and make sure it is apparent to the user when and how they mess something up. + + +many pages are missing descriptions, need to add them + + +https://jsonapi.org/format/ + + +need a way for the template system to: + switch between the meta-header content types for the sharing info + xlarge + large + etc + need better checking around title, meta-image, and descriptions + prevent accidently feeding bad images or text to these fields + need to manages js and css includes better, and incorperate it into templating system + + + + + + + + + + + + +the get timezone getdate gettime format functions all need to be migrated to app, stored as static vars and refactored +in core, am i using htaccess.html or nginx.html anywhere, if not, change them to .example +Routes -> getHost is using a terrible conditional for docker hosts, need to improve +Need to test all the filters for the editor stuff +need the ability for the autoloader to accept specific file name associations +needs a require_all +need to re-namespace all classes and functions +some classes need to be converted to non-static +some functions need to be converted to more static +run from the command line + +initiated // is in so many controllers, i def want this removed initialized +tempus_project.php + test running commands from cli +if we move install.php to the bin, it will be unaccessible to the web server?? + if its unaccessible except theough the index.php router, we don't need to delete it because its unaccessible again +can i use submodules? +errors should be able to be customized + if its in the app +should add more logging, esp for admin actions +need to add self::$pageDescription to many pages +man, messages is hot garbage, def needs a rework +need a mechanism to add listeners and events +ability to restore backups of perms prefs and configs +if your controller has no index method, you're just SOL + a blank page is called and no method is loaded +Warns should be for failed checks +add a check for having write access to the config folder and the uploads folder +and whatever is going to be needed to the plugin downloading + + some configs have been removed and need to be accounted for + Unused: + --------------------------- + Config::getValue('bugReports/sendEmail') + Config::getValue('bugReports/emailTemplate') + Config::getValue('feedback/sendEmail') + Config::getValue('feedback/emailTemplate') + Config::getValue('uploads/files') + Config::getValue('uploads/images') + Config::getValue('uploads/maxFileSize') + + +after all changes are pushed up and available, docker needs to be tested and updated + when using composer, the composer page is populated and correct + +the config step of install should be checking the db creds + + + +// need to make notes of other standards as i go to update the contributing document +// need to cross refrence the configs from core and ttp +// ensure the resources folder is current +// document, fix, and remove @TODO's where possible +Search for cuss words, they make you look stupid + fuck + shit + dam + damm + damn + god + ass + cunt + bitch + ffs + wtf + + + + +had to remove the tracking pixel that was to be used with the contacts form, this will need to be re- added in a future update +had to remove the rest controller, its currently just unused + +// this can be used for the tempus project +composer create-project laravel/laravel example-app + +# Release Checklist + +===================== +- [] Spell check every file. +- [] All documentation must be reviewed for accuracy. +- [] If a new year has passed, ensure the year has been updated where applicable. +- [] If default permissions, preferences, configs, base classes or models have been updated, update resources accordingly. +- [] + + + + + + + + + + + + + +namespace TempusDebugger; => namespace TheTempusProject\Canary; + + + + + + + + + + +need to make sure a template loader can be called and still use the default template file, IE always add these CSS or JS resources. + + + + +discord bot that shares updates on your party from the site +maybe a summary after each session +warning that time is coming up +changes made to anything +D&D news + + + + +is it possible to store a campaigns state on the blockchain? + + + + +keeping this as a repository for podcasts would get more people to check it out +same for youtube + +people love sharing their resources, so make it EASY to find podcasts, and youtube channels, and etsy stores, and give people a place to share it with their groups + +try and earn commisions from this and do featured XYZ every x days or weeks or whatever + +have different "kinds" of dice to portray on the dice roll page + +maybe spinners instead of conventional die + +maybe weird health potions for D4's + + + + + + + + + + +What is my goal here? + +I would like to play Dungeons and Dragons once a week with my friends. In an ideal world, I would DM this game and spend all week building tools for us to use that I then put on a website which sells memberships to other players so they can use the tools too. + diff --git a/app/config/config.json b/app/config/config.json new file mode 100644 index 0000000..0842c72 --- /dev/null +++ b/app/config/config.json @@ -0,0 +1,204 @@ +{ + "main": + { + "logo": + { + "type": "file", + "pretty": "Site Logo (Used mostly in emails)", + "default": "images/logo.png", + "value": "images/logo.png" + }, + "name": + { + "type": "text", + "pretty": "Site Name", + "default": "TTP Example", + "value": "Joey Kimsey" + }, + "template": + { + "type": "text", + "pretty": "Default Site Template", + "default": "default", + "value": "default" + }, + "tokenEnabled": + { + "type": "radio", + "pretty": "Enable CSRF Token for all forms.", + "default": true, + "value": true + }, + "loginLimit": + { + "type": "text", + "pretty": "Maximum Login Attempts per hour", + "default": 5, + "value": "5" + } + }, + "uploads": + { + "files": + { + "type": "radio", + "pretty": "Enable File Uploads", + "default": true, + "value": true + }, + "images": + { + "type": "radio", + "pretty": "Enable Image Uploads", + "default": true, + "value": true + }, + "maxFileSize": + { + "type": "text", + "pretty": "Maximum File Size", + "default": 5000000, + "value": "5000000" + }, + "maxImageSize": + { + "type": "text", + "pretty": "Maximum Image Size", + "default": 500000, + "value": "500000" + } + }, + "database": + { + "dbMaxQuery": + { + "type": "text", + "pretty": "Maximum results per query", + "default": 100, + "protected": true, + "value": 100 + }, + "dbEnabled": + { + "type": "radio", + "pretty": "Database Enabled", + "default": true, + "protected": true, + "value": true + }, + "dbHost": + { + "type": "text", + "pretty": "Database Host (IE: http://localhost:3306)", + "default": "127.0.0.1", + "protected": true, + "value": "194.195.208.99" + }, + "dbName": + { + "type": "text", + "pretty": "Database Name", + "default": "ttp-example", + "protected": true, + "value": "jk-com" + }, + "dbPassword": + { + "type": "text", + "pretty": "Database Password", + "default": "", + "protected": true, + "value": "lsVb#$D74816" + }, + "dbPrefix": + { + "type": "text", + "pretty": "Database table Prefix", + "default": "TTP_", + "protected": true, + "value": "TTP_" + }, + "dbUsername": + { + "type": "text", + "pretty": "Database Username", + "default": "root", + "protected": true, + "value": "joeyk" + } + }, + "group": + { + "defaultGroup": + { + "type": "customSelect", + "pretty": "The Default Group for new registrations.", + "default": 5, + "value": 5 + } + }, + "logging": + { + "admin": + { + "type": "radio", + "pretty": "Enable Admin Action Logging.", + "default": true, + "value": true + }, + "errors": + { + "type": "radio", + "pretty": "Enable Error Logging", + "default": true, + "value": true + }, + "logins": + { + "type": "radio", + "pretty": "Enable Login Logging", + "default": true, + "value": true + } + }, + "bookmarks": + { + "enabled": + { + "type": "radio", + "pretty": "Enable Bookmarks.", + "default": true, + "value": true + } + }, + "calendar": + { + "enabled": + { + "type": "radio", + "pretty": "Enable Calendar.", + "default": true, + "value": true + } + }, + "contacts": + { + "enabled": + { + "type": "radio", + "pretty": "Enable Contacts.", + "default": true, + "value": true + } + }, + "notes": + { + "enabled": + { + "type": "radio", + "pretty": "Enable Notes.", + "default": true, + "value": true + } + } +} \ No newline at end of file diff --git a/app/config/config.json.bak b/app/config/config.json.bak new file mode 100644 index 0000000..26d1c45 --- /dev/null +++ b/app/config/config.json.bak @@ -0,0 +1 @@ +{"main":{"logo":{"value":"images\/logo.png"},"name":{"value":"Joey Kimsey"},"loginLimit":{"type":"text","pretty":"Maximum Login Attempts per hour","default":5,"value":5}},"database":{"dbMaxQuery":{"value":100},"dbEnabled":{"value":true},"dbHost":{"value":"194.195.208.99"},"dbName":{"value":"jk-com"},"dbPassword":{"value":"lsVb#$D74816"},"dbPrefix":{"value":"TTP_"},"dbUsername":{"value":"joeyk"}}} \ No newline at end of file diff --git a/app/config/install.json b/app/config/install.json new file mode 100644 index 0000000..cc39e86 --- /dev/null +++ b/app/config/install.json @@ -0,0 +1 @@ +{"installHash":"6545a2d956a5eccd8a6129e4c8edb4b9","installStep":"complete","modules":{"Group":{"name":"Group","class":"TheTempusProject\\Models\\Group","version":"1.0","installedVersion":"1.0","folder":"\/var\/www\/joeykimsey.com\/app\/models\/","type":"model","installDate":1723860520,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":false,"enabled_txt":"No<\/span>","installPreferences":"Skipped","installTable":"Skipped","installPermissions":"Skipped","installConfigs":"Skipped","installResources":"Success","installedResources":["1","2","3","4"]},"Log":{"name":"Log","class":"TheTempusProject\\Models\\Log","version":"1.0","installedVersion":"1.0","folder":"\/var\/www\/joeykimsey.com\/app\/models\/","type":"model","installDate":1723860520,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":false,"enabled_txt":"No<\/span>","installPermissions":"Skipped","installPreferences":"Skipped","installTable":"Skipped","installConfigs":"Skipped","installResources":"Success","installedResources":true},"Routes":{"name":"Routes","class":"TheTempusProject\\Models\\Routes","version":"1.0","installedVersion":"1.0","folder":"\/var\/www\/joeykimsey.com\/app\/models\/","type":"model","installDate":1723860520,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":false,"enabled_txt":"No<\/span>","installConfigs":"Skipped","installPreferences":"Skipped","installTable":"Skipped","installPermissions":"Skipped","installResources":"Success","installedResources":["1","2","3","4","5"]},"Sessions":{"name":"Sessions","class":"TheTempusProject\\Models\\Sessions","version":"1.0","installedVersion":"1.0","folder":"\/var\/www\/joeykimsey.com\/app\/models\/","type":"model","installDate":1723860520,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":false,"enabled_txt":"No<\/span>","installPermissions":"Skipped","installConfigs":"Skipped","installPreferences":"Skipped","installTable":"Skipped","installResources":"Success","installedResources":true},"User":{"name":"User","class":"TheTempusProject\\Models\\User","version":"1.0","installedVersion":"1.0","folder":"\/var\/www\/joeykimsey.com\/app\/models\/","type":"model","installDate":1723860520,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":false,"enabled_txt":"No<\/span>","installConfigs":"Skipped","installTable":"Skipped","installPermissions":"Skipped","installResources":"Success","installPreferences":"Skipped","installedResources":true},"Blog":{"name":"Blog","class":"TheTempusProject\\Plugins\\Blog","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/blog\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Bookmarks":{"name":"Bookmarks","class":"TheTempusProject\\Plugins\\Bookmarks","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/bookmarks\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Calendar":{"name":"Calendar","class":"TheTempusProject\\Plugins\\Calendar","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/calendar\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Comments":{"name":"Comments","class":"TheTempusProject\\Plugins\\Comments","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/comments\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":["5"]},"Contacts":{"name":"Contacts","class":"TheTempusProject\\Plugins\\Contacts","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/contacts\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Dashboards":{"name":"Dashboards","class":"TheTempusProject\\Plugins\\Dashboards","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/dashboards\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Fileshare":{"name":"Fileshare","class":"TheTempusProject\\Plugins\\Fileshare","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/fileshare\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Messages":{"name":"Messages","class":"TheTempusProject\\Plugins\\Messages","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/messages\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Notes":{"name":"Notes","class":"TheTempusProject\\Plugins\\Notes","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/notes\/","type":"plugin","installDate":1723860535,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Notifications":{"name":"Notifications","class":"TheTempusProject\\Plugins\\Notifications","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/notifications\/","type":"plugin","installDate":1723861130,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Redirects":{"name":"Redirects","class":"TheTempusProject\\Plugins\\Redirects","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/redirects\/","type":"plugin","installDate":1723861130,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Todo":{"name":"Todo","class":"TheTempusProject\\Plugins\\Todo","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/todo\/","type":"plugin","installDate":1723861294,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true},"Updates":{"name":"Updates","class":"TheTempusProject\\Plugins\\Updates","version":"3.0","installedVersion":"3.0","folder":"\/var\/www\/joeykimsey.com\/app\/plugins\/updates\/","type":"plugin","installDate":1723861294,"lastUpdate":1723861483,"installStatus":"Partially Installed","enabled":true,"enabled_txt":"Yes<\/span>","preferences_installed":"Skipped","permissions_installed":"Skipped","configs_installed":"Skipped","models_installed":"Skipped","resources_installed":true}}} \ No newline at end of file diff --git a/app/config/permissions.json b/app/config/permissions.json new file mode 100644 index 0000000..0552fb9 --- /dev/null +++ b/app/config/permissions.json @@ -0,0 +1 @@ +{"adminAccess":{"pretty":"Access Administrator Areas","default":false},"addRoute":{"pretty":"Add Custom Routes","default":false},"uploadImages":{"pretty":"Upload images (such as avatars)","default":false},"useBookmarks":{"pretty":"Can use the bookmarks feature","default":false},"createEvents":{"pretty":"Can add events to bookmarks","default":false},"useCalendar":{"pretty":"Can use the calendar feature","default":false},"modAccess":{"pretty":"Access Moderator Areas","default":false},"useContacts":{"pretty":"Can use the contacts feature","default":false},"uploadFiles":{"pretty":"Can upload files","default":false},"sendMessages":{"pretty":"Can send Messages","default":false},"useNotes":{"pretty":"Can use the notes feature","default":false},"sendNotifications":{"pretty":"Can send notifications","default":false},"redirects":{"pretty":"Can modify redirects","default":false},"createTas":{"pretty":"Can create todo items","default":false},"createList":{"pretty":"Can create todo lists","default":false},"updates":{"pretty":"Can create status updates","default":false}} \ No newline at end of file diff --git a/app/config/permissions.json.bak b/app/config/permissions.json.bak new file mode 100644 index 0000000..0552fb9 --- /dev/null +++ b/app/config/permissions.json.bak @@ -0,0 +1 @@ +{"adminAccess":{"pretty":"Access Administrator Areas","default":false},"addRoute":{"pretty":"Add Custom Routes","default":false},"uploadImages":{"pretty":"Upload images (such as avatars)","default":false},"useBookmarks":{"pretty":"Can use the bookmarks feature","default":false},"createEvents":{"pretty":"Can add events to bookmarks","default":false},"useCalendar":{"pretty":"Can use the calendar feature","default":false},"modAccess":{"pretty":"Access Moderator Areas","default":false},"useContacts":{"pretty":"Can use the contacts feature","default":false},"uploadFiles":{"pretty":"Can upload files","default":false},"sendMessages":{"pretty":"Can send Messages","default":false},"useNotes":{"pretty":"Can use the notes feature","default":false},"sendNotifications":{"pretty":"Can send notifications","default":false},"redirects":{"pretty":"Can modify redirects","default":false},"createTas":{"pretty":"Can create todo items","default":false},"createList":{"pretty":"Can create todo lists","default":false},"updates":{"pretty":"Can create status updates","default":false}} \ No newline at end of file diff --git a/app/config/preferences.json b/app/config/preferences.json new file mode 100644 index 0000000..6ecd39a --- /dev/null +++ b/app/config/preferences.json @@ -0,0 +1 @@ +{"gender":{"pretty":"Gender","type":"select","default":"unspecified","options":["male","female","other","unspecified"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"newsletter":{"pretty":"Receive our Newsletter?","type":"checkbox","default":"true","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"avatar":{"pretty":"Avatar","type":"file","default":"images\/defaultAvatar.png","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"timezone":{"pretty":"Timezone","type":"timezone","default":"America\/New_York","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"dateFormat":{"pretty":"Date Format","type":"select","default":"F j, Y","options":{"1-8-1991":"n-j-Y","8-1-1991":"j-n-Y","01-08-1991":"m-d-Y","08-01-1991":"d-m-Y","January 8, 1991":"F-j-Y","8 January, 1991":"j-F-Y","January 08, 1991":"F-d-Y","08 January, 1991":"d-F-Y","Jan 8, 1991":"M-j-Y","8 Jan 1991":"j-M-Y","Jan 08, 1991":"M-d-Y","08 Jan 1991":"d-M-Y"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"timeFormat":{"pretty":"Time Format","type":"select","default":"g:i:s A","options":{"3:33:33 AM":"g:i:s A","03:33:33 AM":"h:i:s A","3:33:33 am":"g:i:s a","03:33:33 am":"h:i:s a","3:33:33 (military)":"G:i:s","03:33:33 (military)":"H:i:s"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"pageLimit":{"pretty":"Items Displayed Per Page","type":"select","default":"10","options":["10","15","20","25","50"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"calendarPreference":{"pretty":"Default Calendar View","type":"select","default":"byMonth","options":{"Daily":"byDay","Weekly":"byWeek","Monthly":"byMonth","Yearly":"byYear","All Events":"events"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"weekStart":{"pretty":"First day of the week for the Calendar","type":"select","default":"sunday","options":{"Sunday":"6","Monday":"7"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"}} \ No newline at end of file diff --git a/app/config/preferences.json.bak b/app/config/preferences.json.bak new file mode 100644 index 0000000..6ecd39a --- /dev/null +++ b/app/config/preferences.json.bak @@ -0,0 +1 @@ +{"gender":{"pretty":"Gender","type":"select","default":"unspecified","options":["male","female","other","unspecified"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"newsletter":{"pretty":"Receive our Newsletter?","type":"checkbox","default":"true","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"avatar":{"pretty":"Avatar","type":"file","default":"images\/defaultAvatar.png","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"timezone":{"pretty":"Timezone","type":"timezone","default":"America\/New_York","avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png","options":null},"dateFormat":{"pretty":"Date Format","type":"select","default":"F j, Y","options":{"1-8-1991":"n-j-Y","8-1-1991":"j-n-Y","01-08-1991":"m-d-Y","08-01-1991":"d-m-Y","January 8, 1991":"F-j-Y","8 January, 1991":"j-F-Y","January 08, 1991":"F-d-Y","08 January, 1991":"d-F-Y","Jan 8, 1991":"M-j-Y","8 Jan 1991":"j-M-Y","Jan 08, 1991":"M-d-Y","08 Jan 1991":"d-M-Y"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"timeFormat":{"pretty":"Time Format","type":"select","default":"g:i:s A","options":{"3:33:33 AM":"g:i:s A","03:33:33 AM":"h:i:s A","3:33:33 am":"g:i:s a","03:33:33 am":"h:i:s a","3:33:33 (military)":"G:i:s","03:33:33 (military)":"H:i:s"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"pageLimit":{"pretty":"Items Displayed Per Page","type":"select","default":"10","options":["10","15","20","25","50"],"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"calendarPreference":{"pretty":"Default Calendar View","type":"select","default":"byMonth","options":{"Daily":"byDay","Weekly":"byWeek","Monthly":"byMonth","Yearly":"byYear","All Events":"events"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"},"weekStart":{"pretty":"First day of the week for the Calendar","type":"select","default":"sunday","options":{"Sunday":"6","Monday":"7"},"avatar":"\/var\/www\/joeykimsey.com\/images\/defaultAvatar.png"}} \ No newline at end of file diff --git a/app/controllers/home.php b/app/controllers/home.php index 3090638..02c14c2 100644 --- a/app/controllers/home.php +++ b/app/controllers/home.php @@ -28,7 +28,26 @@ class Home extends Controller { public function index() { self::$title = '{SITENAME}'; self::$pageDescription = 'This is the homepage of your new Tempus Project Installation. Thank you for installing. find more info at https://thetempusproject.com'; - Views::view( 'index' ); + $optionValues = [ + (object) [ "option" => "Full-Stack Developer" ], + (object) [ "option" => "DevOps Engineer" ], + (object) [ "option" => "Web Developer" ], + (object) [ "option" => "App Developer" ], + (object) [ "option" => "Senior PHP Developer" ], + (object) [ "option" => "Server/Waiter" ], + (object) [ "option" => "Cook" ], + (object) [ "option" => "Farm-Hand" ], + (object) [ "option" => "Dish-Boy" ], + (object) [ "option" => "Brother" ], + (object) [ "option" => "Son" ], + (object) [ "option" => "Friend" ], + (object) [ "option" => "Student" ], + (object) [ "option" => "Polymath" ], + (object) [ "option" => "Geek" ], + (object) [ "option" => "Nerd" ], + ]; + shuffle($optionValues); + Views::view( 'test', $optionValues ); } public function login() { @@ -98,4 +117,16 @@ class Home extends Controller { // this should look up comments and blog posts with the hashtag in them Views::view( 'hashtags' ); } + + public function about() { + self::$title = 'About - {SITENAME}'; + self::$pageDescription = 'Just a bit more info on me.'; + Views::view( 'about' ); + } + + 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' ); + } } diff --git a/app/plugins/portfolio/controllers/admin/portfolio.php b/app/plugins/portfolio/controllers/admin/portfolio.php new file mode 100644 index 0000000..fcff115 --- /dev/null +++ b/app/plugins/portfolio/controllers/admin/portfolio.php @@ -0,0 +1,103 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers\Admin; + +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Houdini\Classes\Navigation; +use TheTempusProject\Houdini\Classes\Components; +use TheTempusProject\Classes\AdminController; +use TheTempusProject\Classes\Forms; +use TheTempusProject\Models\Links; + +class Portfolio extends AdminController { + public static $links; + + public function __construct() { + parent::__construct(); + self::$links = new Links; + self::$title = 'Admin - Portfolio'; + $view = Navigation::activePageSelect( 'nav.admin', '/admin/portfolio' ); + Components::set( 'ADMINNAV', $view ); + } + + public function index( $data = null ) { + Views::view( 'portfolio.admin.list', self::$links->listPaginated() ); + } + + public function create( $data = null ) { + if ( !Input::exists( 'submit' ) ) { + return Views::view( 'portfolio.admin.create' ); + } + if ( !Forms::check( 'newLink' ) ) { + Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] ); + return $this->index(); + } + $result = self::$links->create( Input::post( 'section' ), Input::post( 'title' ), Input::post( 'image' ), Input::post( 'url' ), Input::post( 'description' ) ); + if ( $result ) { + Issues::add( 'success', 'Your link has been created.' ); + return $this->index(); + } else { + Issues::add( 'error', [ 'There was an unknown error submitting your data.' => Check::userErrors() ] ); + return $this->index(); + } + } + + public function edit( $data = null ) { + if ( !Input::exists( 'submit' ) ) { + return Views::view( 'portfolio.admin.edit', self::$links->findById( $data ) ); + } + if ( !Forms::check( 'editLink' ) ) { + Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] ); + return $this->index(); + } + $fields = [ + 'section' => Input::post( 'section' ), + 'title' => Input::post( 'title' ), + 'image' => Input::post( 'image' ), + 'url' => Input::post( 'url' ), + 'description' => Input::post( 'description' ), + ]; + if ( self::$links->update( $data, $fields ) ) { + Issues::add( 'success', 'Link Updated.' ); + return $this->index(); + } + Issues::add( 'error', 'There was an error with your request.' ); + $this->index(); + } + + public function view( $data = null ) { + $linkData = self::$links->findById( $data ); + if ( $linkData !== false ) { + return Views::view( 'portfolio.admin.view', $linkData ); + } + Issues::add( 'error', 'Link not found.' ); + $this->index(); + } + + public function delete( $data = null ) { + if ( $data == null ) { + if ( Input::exists( 'P_' ) ) { + $data = Input::post( 'P_' ); + } + } + if ( !self::$links->delete( (array) $data ) ) { + Issues::add( 'error', 'There was an error with your request.' ); + } else { + Issues::add( 'success', 'Link has been deleted' ); + } + $this->index(); + } +} diff --git a/app/plugins/portfolio/controllers/portfolio.php b/app/plugins/portfolio/controllers/portfolio.php new file mode 100644 index 0000000..208fb62 --- /dev/null +++ b/app/plugins/portfolio/controllers/portfolio.php @@ -0,0 +1,36 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers; + +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Classes\Controller; +use TheTempusProject\Models\Links; + +class Portfolio extends Controller { + protected static $links; + + public function index() { + self::$links = new Links; + self::$title = '{SITENAME} - Portfolio'; + self::$pageDescription = 'Its not the longest portfolio in the world, but I\'m certainly proud of it.'; + + $links = self::$links->listPaginated(); + if ( false == $links ) { + Issues::add( 'error', 'Well, this is embarrassing, surely he wouldn\'t just have no portfolio..... right.... Dave? ... erm Joey?' ); + return; + } else { + Views::view( 'portfolio.portfolio', self::$links->listPaginated() ); + } + } +} diff --git a/app/plugins/portfolio/forms.php b/app/plugins/portfolio/forms.php new file mode 100644 index 0000000..523240f --- /dev/null +++ b/app/plugins/portfolio/forms.php @@ -0,0 +1,79 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins\Portfolio; + +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Classes\Forms; + +class PortfolioForms extends Forms { + /** + * Adds these functions to the form list. + */ + public function __construct() { + self::addHandler( 'newLink', __CLASS__, 'newLink' ); + self::addHandler( 'editLink', __CLASS__, 'editLink' ); + } + + /** + * Validates the new position post form. + * + * @return {bool} + */ + public static function newLink() { + if ( !Input::exists( 'section' ) ) { + self::addUserError( 'You must specify section' ); + return false; + } + if ( !Input::exists( 'title' ) ) { + self::addUserError( 'You must specify title' ); + return false; + } + if ( !Input::exists( 'url' ) ) { + self::addUserError( 'You must specify url' ); + return false; + } + if ( !Input::exists( 'description' ) ) { + self::addUserError( 'You must specify description' ); + return false; + } + return true; + } + + /** + * Validates the edit position post form. + * + * @return {bool} + */ + public static function editLink() { + if ( !Input::exists( 'section' ) ) { + self::addUserError( 'You must specify section' ); + return false; + } + if ( !Input::exists( 'title' ) ) { + self::addUserError( 'You must specify title' ); + return false; + } + if ( !Input::exists( 'url' ) ) { + self::addUserError( 'You must specify url' ); + return false; + } + if ( !Input::exists( 'description' ) ) { + self::addUserError( 'You must specify description' ); + return false; + } + return true; + } +} + +new PortfolioForms; diff --git a/app/plugins/portfolio/models/links.php b/app/plugins/portfolio/models/links.php new file mode 100644 index 0000000..ef52921 --- /dev/null +++ b/app/plugins/portfolio/models/links.php @@ -0,0 +1,71 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Models; + +use TheTempusProject\Bedrock\Classes\Config; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Canary\Bin\Canary as Debug; +use TheTempusProject\Classes\DatabaseModel; +use TheTempusProject\Plugins\Portfolio as Plugin; + +class Links extends DatabaseModel { + public $tableName = 'portfolio_links'; + public $databaseMatrix = [ + [ 'section', 'varchar', '32' ], + [ 'title', 'varchar', '128' ], + [ 'image', 'varchar', '256' ], + [ 'url', 'varchar', '256' ], + [ 'description', 'text', '' ], + ]; + public $plugin; + + /** + * The model constructor. + */ + public function __construct() { + parent::__construct(); + $this->plugin = new Plugin; + } + + public function create( $section, $title, $image, $url, $description ) { + if ( !$this->plugin->checkEnabled() ) { + Debug::info( 'Portfolio is disabled in the config.' ); + return false; + } + $fields = [ + 'section' => $section, + 'title' => $title, + 'image' => $image, + 'url' => $url, + 'description' => $description, + ]; + if ( !self::$db->insert( $this->tableName, $fields ) ) { + Debug::info( 'Links::create - failed to insert to db' ); + return false; + } + return self::$db->lastId(); + } + + public function update( $id, $fields ) { + if ( !Check::id( $id ) ) { + Debug::info( 'modelBlog: illegal ID.' ); + return false; + } + if ( !self::$db->update( $this->tableName, $id, $fields ) ) { + // new CustomException( 'linkUpdate' ); + Debug::error( "Links:update: $id not updated: $fields" ); + return false; + } + return true; + } +} diff --git a/app/plugins/portfolio/plugin.php b/app/plugins/portfolio/plugin.php new file mode 100644 index 0000000..fb04a2a --- /dev/null +++ b/app/plugins/portfolio/plugin.php @@ -0,0 +1,44 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins; + +use TheTempusProject\Classes\Plugin; + +class Portfolio extends Plugin { + public $pluginName = 'TP Portfolio'; + public $pluginAuthor = 'JoeyK'; + public $pluginWebsite = 'https://TheTempusProject.com'; + public $modelVersion = '1.0'; + public $pluginVersion = '3.0'; + public $pluginDescription = 'A simple plugin which adds management for a portfolio.'; + public $configName = 'portfolio'; + public $configMatrix = [ + 'enabled' => [ + 'type' => 'radio', + 'pretty' => 'Enable the portfolio Feature.', + 'default' => true, + ], + ]; + public $main_links = [ + [ + 'text' => 'Portfolio', + 'url' => '{ROOT_URL}portfolio/index', + ], + ]; + public $admin_links = [ + [ + 'text' => ' Portfolio', + 'url' => '{ROOT_URL}admin/portfolio', + ], + ]; +} diff --git a/app/plugins/portfolio/views/admin/create.html b/app/plugins/portfolio/views/admin/create.html new file mode 100644 index 0000000..659f1ff --- /dev/null +++ b/app/plugins/portfolio/views/admin/create.html @@ -0,0 +1,19 @@ +

Add Portfolio Link

+
+
+

+ +
+

+ +
+

+ +
+

+ +
+

+ + +
\ No newline at end of file diff --git a/app/plugins/portfolio/views/admin/edit.html b/app/plugins/portfolio/views/admin/edit.html new file mode 100644 index 0000000..a7df51a --- /dev/null +++ b/app/plugins/portfolio/views/admin/edit.html @@ -0,0 +1,19 @@ +

Edit Portfolio Link

+
+
+

+ +
+

+ +
+

+ +
+

+ +
+

+ + +
\ No newline at end of file diff --git a/app/plugins/portfolio/views/admin/list.html b/app/plugins/portfolio/views/admin/list.html new file mode 100644 index 0000000..57f2ed9 --- /dev/null +++ b/app/plugins/portfolio/views/admin/list.html @@ -0,0 +1,41 @@ +Portfolio Links +{PAGINATION} +
+ + + + + + + + + + + + + {LOOP} + + + + + + + + + {/LOOP} + {ALT} + + + + {/ALT} + +
titlesectionurl + +
{title}{section}{url} + +
+ No results to show. +
+ Create + +
\ No newline at end of file diff --git a/app/plugins/portfolio/views/admin/view.html b/app/plugins/portfolio/views/admin/view.html new file mode 100644 index 0000000..8d23380 --- /dev/null +++ b/app/plugins/portfolio/views/admin/view.html @@ -0,0 +1,16 @@ + +Portfolio Link +
+ + + diff --git a/app/plugins/portfolio/views/portfolio.html b/app/plugins/portfolio/views/portfolio.html new file mode 100644 index 0000000..19f1a8d --- /dev/null +++ b/app/plugins/portfolio/views/portfolio.html @@ -0,0 +1,20 @@ +

Portfolio

+
+{LOOP} + +{/LOOP} +{ALT} + +{/ALT} \ No newline at end of file diff --git a/app/plugins/resume/controllers/admin/resume.php b/app/plugins/resume/controllers/admin/resume.php new file mode 100644 index 0000000..528bf0e --- /dev/null +++ b/app/plugins/resume/controllers/admin/resume.php @@ -0,0 +1,103 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers\Admin; + +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Houdini\Classes\Navigation; +use TheTempusProject\Houdini\Classes\Components; +use TheTempusProject\Classes\AdminController; +use TheTempusProject\Classes\Forms; +use TheTempusProject\Models\Positions; + +class Resume extends AdminController { + public static $positions; + + public function __construct() { + parent::__construct(); + self::$positions = new Positions; + self::$title = 'Admin - Resume'; + $view = Navigation::activePageSelect( 'nav.admin', '/admin/resume' ); + Components::set( 'ADMINNAV', $view ); + } + + public function index( $data = null ) { + Views::view( 'resume.admin.list', self::$positions->listPaginated() ); + } + + public function create( $data = null ) { + if ( !Input::exists( 'submit' ) ) { + return Views::view( 'resume.admin.create' ); + } + if ( !Forms::check( 'newPosition' ) ) { + Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] ); + return $this->index(); + } + $result = self::$positions->create( Input::post( 'name' ), Input::post( 'position' ), Input::post( 'start' ), Input::post( 'end' ), Input::post( 'details' ) ); + if ( $result ) { + Issues::add( 'success', 'Your position has been created.' ); + return $this->index(); + } else { + Issues::add( 'error', [ 'There was an unknown error submitting your data.' => Check::userErrors() ] ); + return $this->index(); + } + } + + public function edit( $data = null ) { + if ( !Input::exists( 'submit' ) ) { + return Views::view( 'resume.admin.edit', self::$positions->findById( $data ) ); + } + if ( !Forms::check( 'editPosition' ) ) { + Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] ); + return $this->index(); + } + $fields = [ + 'name' => Input::post( 'name' ), + 'position' => Input::post( 'position' ), + 'start' => Input::post( 'start' ), + 'end' => Input::post( 'end' ), + 'details' => Input::post( 'details' ), + ]; + if ( self::$positions->update( $data, $fields ) ) { + Issues::add( 'success', 'Position Updated.' ); + return $this->index(); + } + Issues::add( 'error', 'There was an error with your request.' ); + $this->index(); + } + + public function view( $data = null ) { + $positionData = self::$positions->findById( $data ); + if ( $positionData !== false ) { + return Views::view( 'resume.admin.view', $positionData ); + } + Issues::add( 'error', 'Position not found.' ); + $this->index(); + } + + public function delete( $data = null ) { + if ( $data == null ) { + if ( Input::exists( 'P_' ) ) { + $data = Input::post( 'P_' ); + } + } + if ( !self::$positions->delete( (array) $data ) ) { + Issues::add( 'error', 'There was an error with your request.' ); + } else { + Issues::add( 'success', 'Position has been deleted' ); + } + $this->index(); + } +} diff --git a/app/plugins/resume/controllers/resume.php b/app/plugins/resume/controllers/resume.php new file mode 100644 index 0000000..b61fd72 --- /dev/null +++ b/app/plugins/resume/controllers/resume.php @@ -0,0 +1,58 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers; + +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Classes\Controller; +use TheTempusProject\Models\Positions; +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Houdini\Classes\Components; +use TheTempusProject\Houdini\Classes\Template; + +class Resume extends Controller { + protected static $positions; + + public function index() { + self::$positions = new Positions; + self::$title = '{SITENAME} - Resume'; + self::$pageDescription = 'Its not the longest resume in the world, but I\'m certainly proud of it.'; + + $positions = self::$positions->listPaginated(); + if ( false == $positions ) { + Issues::add( 'error', 'Well, this is embarrassing, surely he wouldn\'t just have no resume..... right.... Dave? ... erm Joey?' ); + return; + } else { + Components::set( 'RESUME_NAV', Views::simpleView( 'resume.nav') ); + Components::set( 'RESUME_DOWNLOADS', Views::simpleView( 'resume.download') ); + if ( !Input::exists( 'view' ) ) { + return Views::view( 'resume.resume', $positions ); + } else { + Components::append( 'TEMPLATE_CSS_INCLUDES', Template::parse('') ); + $side = 'left'; + foreach ($positions as $key => $position) { + $position->side = $side; // Add the new entry for side + $side = ($side === 'left') ? 'right' : 'left'; // Alternate between left and right + } + return Views::view( 'resume.timeline', $positions ); + } + } + } + public function test() { + self::$positions = new Positions; + self::$title = '{SITENAME} - Resume'; + self::$pageDescription = 'Its not the longest resume in the world, but I\'m certainly proud of it.'; + + return Views::view( 'resume.test' ); + } +} diff --git a/app/plugins/resume/css/timeline.css b/app/plugins/resume/css/timeline.css new file mode 100644 index 0000000..127a668 --- /dev/null +++ b/app/plugins/resume/css/timeline.css @@ -0,0 +1,132 @@ +* { + box-sizing: border-box; + } + body { + /* background-color: #474e5d; + font-family: Helvetica, sans-serif; */ + } + + /* The actual timeline (the vertical ruler) */ + .resume-timeline { + position: relative; + max-width: 1200px; + margin: 0 auto; + } + + /* The actual timeline (the vertical ruler) */ + .resume-timeline::after { + content: ''; + position: absolute; + width: 6px; + background-color: #B5B5B5; + top: 0; + bottom: 0; + left: 50%; + margin-left: -3px; + } + + /* Container around content */ + .timeline-container { + padding: 10px 40px; + position: relative; + background-color: inherit; + width: 50%; + } + + /* The circles on the timeline */ + .timeline-container::after { + content: ''; + position: absolute; + width: 25px; + height: 25px; + right: -13px; + background-color: #337ab7; + border: 4px solid #FF9F55; + top: 15px; + border-radius: 50%; + z-index: 1; + } + + /* Place the container to the left */ + .left { + left: 0; + } + + /* Place the container to the right */ + .right { + left: 50%; + } + + /* Add arrows to the left container (pointing right) */ + .left::before { + content: " "; + height: 0; + position: absolute; + top: 22px; + width: 0; + z-index: 1; + right: 30px; + border: medium solid white; + border-width: 10px 0 10px 10px; + border-color: transparent transparent transparent white; + } + + /* Add arrows to the right container (pointing left) */ + .right::before { + content: " "; + height: 0; + position: absolute; + top: 22px; + width: 0; + z-index: 1; + left: 30px; + border: medium solid white; + border-width: 10px 10px 10px 0; + border-color: transparent white transparent transparent; + } + + /* Fix the circle for containers on the right side */ + .right::after { + left: -11px; + } + + /* The actual content */ + .timeline-content { + padding: 20px 30px; + background-color: white; + position: relative; + border-radius: 6px; + } + + /* Media queries - Responsive timeline on screens less than 600px wide */ + @media screen and (max-width: 600px) { + /* Place the timelime to the left */ + .resume-timeline::after { + left: 31px; + } + + /* Full-width containers */ + .timeline-container { + width: 100%; + padding-left: 70px; + padding-right: 25px; + } + + /* Make sure that all arrows are pointing leftwards */ + .timeline-container::before { + left: 60px; + border: medium solid white; + border-width: 10px 10px 10px 0; + border-color: transparent white transparent transparent; + } + + /* Make sure all circles are at the same spot */ + .left::after, .right::after { + left: 15px; + } + + /* Make all right containers behave like the left ones */ + .right { + left: 0%; + } + } \ No newline at end of file diff --git a/app/plugins/resume/forms.php b/app/plugins/resume/forms.php new file mode 100644 index 0000000..f895ec3 --- /dev/null +++ b/app/plugins/resume/forms.php @@ -0,0 +1,87 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins\Resume; + +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Classes\Forms; + +class ResumeForms extends Forms { + /** + * Adds these functions to the form list. + */ + public function __construct() { + self::addHandler( 'newPosition', __CLASS__, 'newPosition' ); + self::addHandler( 'editPosition', __CLASS__, 'editPosition' ); + } + + /** + * Validates the new position post form. + * + * @return {bool} + */ + public static function newPosition() { + if ( !Input::exists( 'name' ) ) { + self::addUserError( 'You must specify name' ); + return false; + } + if ( !Input::exists( 'position' ) ) { + self::addUserError( 'You must specify position' ); + return false; + } + if ( !Input::exists( 'start' ) ) { + self::addUserError( 'You must specify start' ); + return false; + } + if ( !Input::exists( 'end' ) ) { + self::addUserError( 'You must specify end' ); + return false; + } + if ( !Input::exists( 'details' ) ) { + self::addUserError( 'You must specify details' ); + return false; + } + return true; + } + + /** + * Validates the edit position post form. + * + * @return {bool} + */ + public static function editPosition() { + if ( !Input::exists( 'name' ) ) { + self::addUserError( 'You must specify name' ); + return false; + } + if ( !Input::exists( 'position' ) ) { + self::addUserError( 'You must specify position' ); + return false; + } + if ( !Input::exists( 'start' ) ) { + self::addUserError( 'You must specify start' ); + return false; + } + if ( !Input::exists( 'end' ) ) { + self::addUserError( 'You must specify end' ); + return false; + } + if ( !Input::exists( 'details' ) ) { + self::addUserError( 'You must specify details' ); + return false; + } + return true; + } +} + +new ResumeForms; diff --git a/app/plugins/resume/models/positions.php b/app/plugins/resume/models/positions.php new file mode 100644 index 0000000..0fa8f89 --- /dev/null +++ b/app/plugins/resume/models/positions.php @@ -0,0 +1,88 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Models; + +use TheTempusProject\Bedrock\Classes\Config; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Canary\Bin\Canary as Debug; +use TheTempusProject\Classes\DatabaseModel; +use TheTempusProject\Plugins\Resume as Plugin; + +class Positions extends DatabaseModel { + public $tableName = 'positions'; + public $databaseMatrix = [ + [ 'name', 'varchar', '128' ], + [ 'position', 'varchar', '128' ], + [ 'start', 'varchar', '16' ], + [ 'end', 'varchar', '16' ], + [ 'details', 'text', '' ], + ]; + public $plugin; + + /** + * The model constructor. + */ + public function __construct() { + parent::__construct(); + $this->plugin = new Plugin; + } + + public function create( $name, $position, $start, $end, $details ) { + if ( !$this->plugin->checkEnabled() ) { + Debug::info( 'Resume is disabled in the config.' ); + return false; + } + $fields = [ + 'name' => $name, + 'position' => $position, + 'start' => $start, + 'end' => $end, + 'details' => $details, + ]; + if ( !self::$db->insert( $this->tableName, $fields ) ) { + Debug::info( 'Position::create - failed to insert to db' ); + return false; + } + return self::$db->lastId(); + } + + public function filter( $postArray, $params = [] ) { + foreach ( $postArray as $instance ) { + if ( !is_object( $instance ) ) { + $instance = $postArray; + $end = true; + } + $instance->prettyStart = $instance->start; + $instance->prettyEnd = $instance->end; + $out[] = $instance; + if ( !empty( $end ) ) { + $out = $out[0]; + break; + } + } + return $out; + } + + public function update( $id, $fields ) { + if ( !Check::id( $id ) ) { + Debug::info( 'Positions:update: illegal ID.' ); + return false; + } + if ( !self::$db->update( $this->tableName, $id, $fields ) ) { + // new CustomException( 'positionUpdate' ); + Debug::error( "Positions:update: $id not updated: $fields" ); + return false; + } + return true; + } +} diff --git a/app/plugins/resume/plugin.php b/app/plugins/resume/plugin.php new file mode 100644 index 0000000..dfd5e77 --- /dev/null +++ b/app/plugins/resume/plugin.php @@ -0,0 +1,44 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins; + +use TheTempusProject\Classes\Plugin; + +class Resume extends Plugin { + public $pluginName = 'TP Resume'; + public $pluginAuthor = 'JoeyK'; + public $pluginWebsite = 'https://TheTempusProject.com'; + public $modelVersion = '1.0'; + public $pluginVersion = '3.0'; + public $pluginDescription = 'A simple plugin which adds management for a resume.'; + public $configName = 'resume'; + public $configMatrix = [ + 'enabled' => [ + 'type' => 'radio', + 'pretty' => 'Enable the resume Feature.', + 'default' => true, + ], + ]; + public $main_links = [ + [ + 'text' => 'Resume', + 'url' => '{ROOT_URL}resume/index', + ], + ]; + public $admin_links = [ + [ + 'text' => ' Resume', + 'url' => '{ROOT_URL}admin/resume', + ], + ]; +} diff --git a/app/plugins/resume/views/admin/create.html b/app/plugins/resume/views/admin/create.html new file mode 100644 index 0000000..8c243ba --- /dev/null +++ b/app/plugins/resume/views/admin/create.html @@ -0,0 +1,19 @@ +

Resume Entry Form

+
+
+

+ +
+

+ +
+

+ +
+

+ +
+

+ + +
\ No newline at end of file diff --git a/app/plugins/resume/views/admin/edit.html b/app/plugins/resume/views/admin/edit.html new file mode 100644 index 0000000..656c2cb --- /dev/null +++ b/app/plugins/resume/views/admin/edit.html @@ -0,0 +1,19 @@ +

Edit Resume Position

+
+
+

+ +
+

+ +
+

+ +
+

+ +
+

+ + +
\ No newline at end of file diff --git a/app/plugins/resume/views/admin/list.html b/app/plugins/resume/views/admin/list.html new file mode 100644 index 0000000..6c0f9a8 --- /dev/null +++ b/app/plugins/resume/views/admin/list.html @@ -0,0 +1,43 @@ +Resume Positions +{PAGINATION} +
+ + + + + + + + + + + + + + {LOOP} + + + + + + + + + + {/LOOP} + {ALT} + + + + {/ALT} + +
NamePositionStartEnd + +
{name}{position}{prettyStart}{prettyEnd} + +
+ No results to show. +
+ Create + +
\ No newline at end of file diff --git a/app/plugins/resume/views/admin/view.html b/app/plugins/resume/views/admin/view.html new file mode 100644 index 0000000..7a0b6df --- /dev/null +++ b/app/plugins/resume/views/admin/view.html @@ -0,0 +1,8 @@ +Resume Position +
+

{name}

+

{position} from {prettyStart} to {prettyEnd}

+
+ {details} +
+
\ No newline at end of file diff --git a/app/plugins/resume/views/download.html b/app/plugins/resume/views/download.html new file mode 100644 index 0000000..3661ada --- /dev/null +++ b/app/plugins/resume/views/download.html @@ -0,0 +1,9 @@ +
+
+

Download

+ Word + PDF + Markdown + Text +
+
\ No newline at end of file diff --git a/app/plugins/resume/views/nav.html b/app/plugins/resume/views/nav.html new file mode 100644 index 0000000..f6e190a --- /dev/null +++ b/app/plugins/resume/views/nav.html @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/app/plugins/resume/views/resume.html b/app/plugins/resume/views/resume.html new file mode 100644 index 0000000..6c61a34 --- /dev/null +++ b/app/plugins/resume/views/resume.html @@ -0,0 +1,18 @@ +

Resume

+
+{RESUME_NAV} +{LOOP} +
+

{name}

+

{position} from {prettyStart} to {prettyEnd}

+
+ {details} +
+
+{/LOOP} +{ALT} +
+

None Found

+
+{/ALT} +{RESUME_DOWNLOADS} \ No newline at end of file diff --git a/app/plugins/resume/views/test.html b/app/plugins/resume/views/test.html new file mode 100644 index 0000000..23f9d5b --- /dev/null +++ b/app/plugins/resume/views/test.html @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + Show / Hide the Bullshit + +
+
+
+ + + + + + + + + + +
+
+ + + +
+ https://example.com/users/ + +
+ +
+
+ + + + + + + + + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + + + https://example.com/users/ +
+
+
+ +
+ @ + +
+ + + +
+ + @example.com +
+ + +
+ https://example.com/users/ + +
\ No newline at end of file diff --git a/app/plugins/resume/views/timeline.html b/app/plugins/resume/views/timeline.html new file mode 100644 index 0000000..1f013e6 --- /dev/null +++ b/app/plugins/resume/views/timeline.html @@ -0,0 +1,22 @@ +

Resume

+
+{RESUME_NAV} +{LOOP} +
+
+
+

{name}

+

{position} from {prettyStart} to {prettyEnd}

+
+ {details} +
+
+
+
+{/LOOP} +{ALT} +
+

None Found

+
+{/ALT} +{RESUME_DOWNLOADS} \ No newline at end of file diff --git a/app/plugins/subscribe/controllers/admin/subscriptions.php b/app/plugins/subscribe/controllers/admin/subscriptions.php deleted file mode 100644 index 0256d29..0000000 --- a/app/plugins/subscribe/controllers/admin/subscriptions.php +++ /dev/null @@ -1,65 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Controllers\Admin; - -use TheTempusProject\Bedrock\Functions\Input; -use TheTempusProject\Bedrock\Functions\Check; -use TheTempusProject\Houdini\Classes\Issues; -use TheTempusProject\Houdini\Classes\Views; -use TheTempusProject\Classes\AdminController; -use TheTempusProject\Models\Subscribe; -use TheTempusProject\Classes\Forms; - -class Subscriptions extends AdminController { - public static $subscribe; - - public function __construct() { - parent::__construct(); - self::$title = 'Admin - Email Subscribers'; - self::$subscribe = new Subscribe; - } - - public function delete( $data = null ) { - if ( $data == null ) { - if ( Input::exists( 'submit' ) ) { - $data = Input::post( 'S_' ); - } - } - if ( !self::$subscribe->delete( (array) $data ) ) { - Issues::add( 'error', 'There was an error with your request, please try again.' ); - } else { - Issues::add( 'success', 'Subscriber removed.' ); - } - $this->index(); - } - - public function add( $data = null ) { - if ( !Input::exists( 'submit' ) ) { - return Views::view( 'subscribe.admin.add' ); - } - if ( !Forms::check( 'subscribe' ) ) { - Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] ); - return $this->index(); - } - if ( !self::$subscribe->add( Input::post( 'email' ) ) ) { - Issues::add( 'error', 'There was an error with your request, please try again.' ); - return $this->index(); - } - Issues::add( 'success', 'Subscriber added.' ); - $this->index(); - } - - public function index( $data = null ) { - Views::view( 'subscribe.admin.list', self::$subscribe->listPaginated() ); - } -} diff --git a/app/plugins/subscribe/controllers/subscribe.php b/app/plugins/subscribe/controllers/subscribe.php deleted file mode 100644 index 1681685..0000000 --- a/app/plugins/subscribe/controllers/subscribe.php +++ /dev/null @@ -1,79 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Controllers; - -use TheTempusProject\Classes\Controller; -use TheTempusProject\Classes\Forms; -use TheTempusProject\Hermes\Functions\Redirect; -use TheTempusProject\Bedrock\Functions\Session; -use TheTempusProject\Bedrock\Functions\Input; -use TheTempusProject\Bedrock\Functions\Check; -use TheTempusProject\Classes\Email; -use TheTempusProject\Houdini\Classes\Issues; -use TheTempusProject\Houdini\Classes\Views; -use TheTempusProject\Models\Subscribe as SubscribeModel; - -class Subscribe extends Controller { - private static $subscribe; - - public function __construct() { - parent::__construct(); - self::$subscribe = new SubscribeModel; - } - - public function index() { - self::$title = 'Subscribe - {SITENAME}'; - self::$pageDescription = 'We are always publishing great content and keeping our members up to date. If you would like to join our list, you can subscribe here.'; - if ( !Input::exists( 'email' ) ) { - return Views::view( 'subscribe.subscribe' ); - } - if ( !Forms::check( 'subscribe' ) ) { - Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] ); - return Views::view( 'subscribe.subscribe' ); - } - if ( !self::$subscribe->add( Input::post( 'email' ) ) ) { - Issues::add( 'error', 'There was an error with your request, please try again.' ); - return Views::view( 'subscribe.subscribe' ); - } - $data = self::$subscribe->get( Input::post( 'email' ) ); - Email::send( Input::post( 'email' ), 'subscribe', $data->confirmationCode, ['template' => true] ); - Issues::add( 'success', 'You have successfully been subscribed to our mailing list.' ); - } - - public function unsubscribe( $email = null, $code = null ) { - self::$title = '{SITENAME}'; - self::$pageDescription = ''; - if ( !empty( $email ) && !empty( $code ) ) { - if ( self::$subscribe->unsubscribe( $email, $code ) ) { - return Issues::add( 'success', 'You have been successfully unsubscribed from receiving further mailings.' ); - } - Issues::add( 'error', 'There was an error with your request.' ); - return Views::view( 'subscribe.unsubscribe' ); - } - if ( !Input::exists( 'submit' ) ) { - return Views::view( 'subscribe.unsubscribe' ); - } - if ( !Forms::check( 'unsubscribe' ) ) { - Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] ); - return Views::view( 'subscribe.unsubscribe' ); - } - $data = self::$subscribe->get( Input::post( 'email' ) ); - if ( empty( $data ) ) { - Issues::add( 'notice', 'There was an error with your request.' ); - return Views::view( 'subscribe.unsubscribe' ); - } - Email::send( Input::post( 'email' ), 'unsubInstructions', $data->confirmationCode, ['template' => true] ); - Session::flash( 'success', 'An email with instructions on how to unsubscribe has been sent to your email.' ); - Redirect::to( 'home/index' ); - } -} diff --git a/app/plugins/subscribe/forms.php b/app/plugins/subscribe/forms.php deleted file mode 100644 index d9fb68a..0000000 --- a/app/plugins/subscribe/forms.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Plugins\Subscribe; - -use TheTempusProject\Bedrock\Functions\Input; -use TheTempusProject\Classes\Forms; - -class SubscribeForms extends Forms { - /** - * Adds these functions to the form list. - */ - public function __construct() { - self::addHandler( 'subscribe', __CLASS__, 'subscribe' ); - self::addHandler( 'unsubscribe', __CLASS__, 'unsubscribe' ); - self::addHandler( 'newSubscription', __CLASS__, 'newSubscription' ); - } - - /** - * Validates the subscribe form. - * - * @return {bool} - */ - public static function subscribe() { - if ( !self::email( Input::post( 'email' ) ) ) { - self::addUserError( 'Invalid email.' ); - return false; - } - if ( !self::token() ) { - return false; - } - return true; - } - - /** - * Validates the unsubscribe form. - * - * @return {bool} - */ - public static function unsubscribe() { - if ( !self::email( Input::post( 'email' ) ) ) { - self::addUserError( 'Invalid email.' ); - return false; - } - if ( !self::token() ) { - return false; - } - return true; - } - - /** - * Validates the new subscription form. - * - * @return {bool} - */ - public static function newSubscription() { - if ( !self::token() ) { - return false; - } - return true; - } -} - -new SubscribeForms; diff --git a/app/plugins/subscribe/models/subscribe.php b/app/plugins/subscribe/models/subscribe.php deleted file mode 100644 index 024c00b..0000000 --- a/app/plugins/subscribe/models/subscribe.php +++ /dev/null @@ -1,97 +0,0 @@ - - * @link https://TheTempusProject.com - * @license https://opensource.org/licenses/MIT [MIT LICENSE] - */ -namespace TheTempusProject\Models; - -use TheTempusProject\Bedrock\Functions\Check; -use TheTempusProject\Bedrock\Functions\Code; -use TheTempusProject\Canary\Bin\Canary as Debug; -use TheTempusProject\Classes\DatabaseModel; - -class Subscribe extends DatabaseModel { - public $tableName = 'subscribers'; - public $databaseMatrix = [ - [ 'confirmed', 'int', '1' ], - [ 'subscribed', 'int', '10' ], - [ 'confirmationCode', 'varchar', '80' ], - [ 'email', 'varchar', '75' ], - ]; - - /** - * Adds an email to the subscribers database. - * - * @param string $email - the email you are trying to add. - * @return bool - */ - public function add( $email ) { - if ( !Check::email( $email ) ) { - return false; - } - $alreadyExists = self::$db->get( $this->tableName, ['email', '=', $email] ); - - if ( $alreadyExists->error() ) { - Debug::info( 'Error querying database: ' . $alreadyExists->errorMessage() ); - return false; - } - - if ( $alreadyExists->count() ) { - Debug::info( 'email already subscribed.' ); - return false; - } - $fields = [ - 'email' => $email, - 'confirmationCode' => Code::genConfirmation(), - 'confirmed' => 0, - 'subscribed' => time(), - ]; - self::$db->insert( $this->tableName, $fields ); - return self::$db->lastId(); - } - - /** - * Removes an email from the subscribers database. - * - * @param string $email - The email you are trying to remove. - * @param string $code - The confirmation code to unsubscribe. - * @return boolean - */ - public function unsubscribe( $email, $code ) { - if ( !Check::email( $email ) ) { - return false; - } - $user = self::$db->get( $this->tableName, ['email', '=', $email, 'AND', 'confirmationCode', '=', $code] ); - if ( !$user->count() ) { - Debug::info( __METHOD__ . ' - Cannot find subscriber with that email and code' ); - return false; - } - self::$db->delete( $this->tableName, ['ID', '=', $user->first()->ID] ); - return true; - } - - /** - * Returns a subscriber object for the provided email address. - * - * @param string $email - An email address to look for. - * @return bool|object - Depending on success. - */ - public function get( $email ) { - if ( !Check::email( $email ) ) { - return false; - } - $data = self::$db->get( $this->tableName, ['email', '=', $email] ); - if ( !$data->count() ) { - Debug::info( __METHOD__ . ' - Email not found' ); - return false; - } - return (object) $data->first(); - } -} diff --git a/app/plugins/subscribe/plugin.php b/app/plugins/subscribe/plugin.php deleted file mode 100644 index e95d34e..0000000 --- a/app/plugins/subscribe/plugin.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @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\Houdini\Classes\Components; -use TheTempusProject\Houdini\Classes\Views; -use TheTempusProject\TheTempusProject as App; - -class Subscribe extends Plugin { - public $pluginName = 'TP Subscribe'; - public $pluginAuthor = 'JoeyK'; - public $pluginWebsite = 'https://TheTempusProject.com'; - public $modelVersion = '1.0'; - public $pluginVersion = '3.0'; - public $pluginDescription = 'A simple plugin to add a method for users to share their email.'; - public $admin_links = [ - [ - 'text' => ' Subscriptions', - 'url' => '{ROOT_URL}admin/subscriptions', - ], - ]; - - public function __construct( $load = false ) { - parent::__construct( $load ); - Components::set( 'FOOTER_RIGHT', Views::simpleView( 'subscribe.footer.right') ); - } -} diff --git a/app/plugins/subscribe/views/admin/add.html b/app/plugins/subscribe/views/admin/add.html deleted file mode 100644 index 4d3c2e5..0000000 --- a/app/plugins/subscribe/views/admin/add.html +++ /dev/null @@ -1,5 +0,0 @@ -
- - -
-
\ No newline at end of file diff --git a/app/plugins/subscribe/views/admin/list.html b/app/plugins/subscribe/views/admin/list.html deleted file mode 100644 index 35e7a2a..0000000 --- a/app/plugins/subscribe/views/admin/list.html +++ /dev/null @@ -1,37 +0,0 @@ -Subscribers -{PAGINATION} -
- - - - - - - - - - - {LOOP} - - - - - - - {/LOOP} - {ALT} - - - - {/ALT} - -
IDemail - -
{ID}{EMAIL} - -
- No results to show. -
- Add - -
\ No newline at end of file diff --git a/app/plugins/subscribe/views/subscribe.html b/app/plugins/subscribe/views/subscribe.html deleted file mode 100644 index cbb3203..0000000 --- a/app/plugins/subscribe/views/subscribe.html +++ /dev/null @@ -1,5 +0,0 @@ -
- - -
-
\ No newline at end of file diff --git a/app/plugins/subscribe/views/unsubscribe.html b/app/plugins/subscribe/views/unsubscribe.html deleted file mode 100644 index dd4041d..0000000 --- a/app/plugins/subscribe/views/unsubscribe.html +++ /dev/null @@ -1,5 +0,0 @@ -
- - -
-
\ No newline at end of file diff --git a/app/plugins/updates/controllers/updates.php b/app/plugins/updates/controllers/updates.php new file mode 100644 index 0000000..79cd1cb --- /dev/null +++ b/app/plugins/updates/controllers/updates.php @@ -0,0 +1,85 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers; + +use TheTempusProject\Hermes\Functions\Redirect; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Bedrock\Functions\Session; +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Classes\Controller; +use TheTempusProject\Classes\Forms; +use TheTempusProject\Models\Update; +use TheTempusProject\TheTempusProject as App; +use TheTempusProject\Houdini\Classes\Components; + +class Updates extends Controller { + protected static $updates; + + public function __construct() { + parent::__construct(); + self::$updates = new Update; + self::$title = 'Status Updates - {SITENAME}'; + self::$pageDescription = 'On this page you can view and post new status updates.'; + if ( ! App::$isLoggedIn ) { + return Issues::add( 'notice', 'You must be logged in to post or view statuses.' ); + } + } + + public function index() { + $updates = self::$updates->byUser( App::$activeUser->ID ); + Components::set( 'list', Views::simpleView( 'updates.list', $updates ) ); + Components::set( 'create', Views::simpleView( 'updates.create' ) ); + + if ( ! Input::exists() ) { + return Views::view( 'updates.dash' ); + } + + if ( ! Forms::check( 'createUpdate' ) ) { + Issues::add( 'error', [ 'There was an error with your report.' => Check::userErrors() ] ); + return Views::view( 'updates.dash' ); + } + + $result = self::$updates->create( Input::post( 'status' ) ); + + if ( true === $result ) { + Issues::add( 'success', 'Your status has been posted.' ); + } else { + Issues::add( 'error', 'There was an unresolved error while submitting your status.' ); + } + + return Views::view( 'updates.dash' ); + } + + public function post() { + if ( ! Input::exists() ) { + return Views::view( 'updates.create' ); + } + if ( !Forms::check( 'createUpdate' ) ) { + Issues::add( 'error', [ 'There was an error with your report.' => Check::userErrors() ] ); + return Views::view( 'updates.create' ); + } + $result = self::$updates->create( Input::post( 'status' ) ); + if ( true === $result ) { + Session::flash( 'success', 'Your status has been posted.' ); + Redirect::to( 'home/index' ); + } else { + Issues::add( 'error', 'There was an unresolved error while submitting your status.' ); + return Views::view( 'updates.create' ); + } + } + + public function byUser( $id = null ) { + } +} diff --git a/app/plugins/updates/forms.php b/app/plugins/updates/forms.php new file mode 100644 index 0000000..ff8a16d --- /dev/null +++ b/app/plugins/updates/forms.php @@ -0,0 +1,36 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins\Updates; + +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Classes\Forms; + +class UpdateForms extends Forms { + /** + * Adds these functions to the form list. + */ + public function __construct() { + self::addHandler( 'createUpdate', __CLASS__, 'createUpdate' ); + } + + public static function createUpdate() { + if ( ! Input::exists( 'status' ) ) { + Check::addUserError( 'You must provide an status.' ); + return false; + } + return true; + } +} + +new UpdateForms; diff --git a/app/plugins/updates/models/update.php b/app/plugins/updates/models/update.php new file mode 100644 index 0000000..d7ab191 --- /dev/null +++ b/app/plugins/updates/models/update.php @@ -0,0 +1,87 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Models; + +use TheTempusProject\Bedrock\Classes\Config; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Canary\Bin\Canary as Debug; +use TheTempusProject\Classes\DatabaseModel; +use TheTempusProject\Plugins\Updates as Plugin; +use TheTempusProject\TheTempusProject as App; + +class Update extends DatabaseModel { + public $tableName = 'status_updates'; + public $databaseMatrix = [ + [ 'status', 'varchar', '512' ], + [ 'createdAt', 'int', '10' ], + [ 'createdBy', 'int', '10' ], + [ 'updatedAt', 'int', '10' ], + [ 'updatedBy', 'int', '10' ], + [ 'deletedAt', 'int', '10' ], + [ 'deletedBy', 'int', '10' ], + ]; + public $plugin; + + /** + * The model constructor. + */ + public function __construct() { + parent::__construct(); + $this->plugin = new Plugin; + } + public function create( $status ) { + if ( ! $this->plugin->checkEnabled() ) { + Debug::info( 'Status-Updates are disabled in the config.' ); + return false; + } + $fields = [ + 'status' => $status, + 'createdAt' => time(), + 'createdBy' => App::$activeUser->ID, + ]; + if ( !self::$db->insert( $this->tableName, $fields ) ) { + Debug::info( 'Status-Updates::create - failed to insert to db' ); + return false; + } + return self::$db->lastId(); + } + public function update( $status ) { + if ( !$this->plugin->checkEnabled() ) { + Debug::info( 'Status-Updates are disabled in the config.' ); + return false; + } + $fields = [ + 'status' => $status, + 'updatedAt' => time(), + 'updatedBy' => App::$activeUser->ID, + ]; + if ( !self::$db->update( $this->tableName, $id, $fields ) ) { + Debug::info( 'Status-Updates::update - failed to update to db' ); + return false; + } + return true; + } + public function byUser( $userID, $limit = null ) { + $whereClause = [ 'createdBy', '=', $userID ]; + if ( empty( $limit ) ) { + $reviews = self::$db->get( $this->tableName, $whereClause ); + } else { + $reviews = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] ); + } + if ( !$reviews->count() ) { + Debug::info( 'No Reviews found.' ); + return false; + } + return $this->filter( $reviews->results() ); + } +} diff --git a/app/plugins/updates/plugin.php b/app/plugins/updates/plugin.php new file mode 100644 index 0000000..df2d3b4 --- /dev/null +++ b/app/plugins/updates/plugin.php @@ -0,0 +1,30 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins; + +use TheTempusProject\Classes\Plugin; + +class Updates extends Plugin { + public $pluginName = 'TP Status-Updates'; + public $pluginAuthor = 'JoeyK'; + public $pluginWebsite = 'https://TheTempusProject.com'; + public $modelVersion = '1.0'; + public $pluginVersion = '3.0'; + public $pluginDescription = 'A simple plugin which adds a user status update system.'; + public $permissionMatrix = [ + 'updates' => [ + 'pretty' => 'Can create status updates', + 'default' => false, + ], + ]; +} diff --git a/app/plugins/updates/views/create.html b/app/plugins/updates/views/create.html new file mode 100644 index 0000000..2882f6e --- /dev/null +++ b/app/plugins/updates/views/create.html @@ -0,0 +1,10 @@ +
+

Update your status

+
+
+ + +
+ +
+
\ No newline at end of file diff --git a/app/plugins/updates/views/dash.html b/app/plugins/updates/views/dash.html new file mode 100644 index 0000000..8eadecc --- /dev/null +++ b/app/plugins/updates/views/dash.html @@ -0,0 +1,2 @@ +{list} +{create} \ No newline at end of file diff --git a/app/plugins/updates/views/list.html b/app/plugins/updates/views/list.html new file mode 100644 index 0000000..f876d75 --- /dev/null +++ b/app/plugins/updates/views/list.html @@ -0,0 +1,26 @@ +Updates + + + + + + + + + + {LOOP} + + + + + + {/LOOP} + {ALT} + + + + {/ALT} + +
DateStatus
{DTC}{createdAt}{/DTC}{status}
+ No results to show. +
\ No newline at end of file diff --git a/app/plugins/wip/controllers/admin/wip.php b/app/plugins/wip/controllers/admin/wip.php new file mode 100644 index 0000000..b40f383 --- /dev/null +++ b/app/plugins/wip/controllers/admin/wip.php @@ -0,0 +1,102 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers\Admin; + +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Houdini\Classes\Navigation; +use TheTempusProject\Houdini\Classes\Components; +use TheTempusProject\Classes\AdminController; +use TheTempusProject\Classes\Forms; +use TheTempusProject\Models\Projects; + +class Wip extends AdminController { + public static $projects; + + public function __construct() { + parent::__construct(); + self::$projects = new Projects; + self::$title = 'Admin - Projects'; + $view = Navigation::activePageSelect( 'nav.admin', '/admin/wip' ); + Components::set( 'ADMINNAV', $view ); + } + + public function index( $data = null ) { + Views::view( 'wip.admin.list', self::$projects->listPaginated() ); + } + + public function create( $data = null ) { + if ( !Input::exists( 'submit' ) ) { + return Views::view( 'wip.admin.create' ); + } + if ( !Forms::check( 'newProject' ) ) { + Issues::add( 'error', [ 'There was an error with your request.' => Check::userErrors() ] ); + return $this->index(); + } + $result = self::$projects->create( Input::post( 'title' ), Input::post( 'description' ), Input::post( 'progress' ), Input::post( 'startDate' ) ); + if ( $result ) { + Issues::add( 'success', 'Your projects has been created.' ); + return $this->index(); + } else { + Issues::add( 'error', [ 'There was an unknown error submitting your data.' => Check::userErrors() ] ); + return $this->index(); + } + } + + public function edit( $data = null ) { + if ( !Input::exists( 'submit' ) ) { + return Views::view( 'wip.admin.edit', self::$projects->findById( $data ) ); + } + if ( !Forms::check( 'editProject' ) ) { + Issues::add( 'error', [ 'There was an error with your form.' => Check::userErrors() ] ); + return $this->index(); + } + $fields = [ + 'title' => Input::post( 'title' ), + 'description' => Input::post( 'description' ), + 'progress' => Input::post( 'progress' ), + 'startDate' => Input::post( 'startDate' ), + ]; + if ( self::$projects->update( $data, $fields ) ) { + Issues::add( 'success', 'Projects Updated.' ); + return $this->index(); + } + Issues::add( 'error', 'There was an error with your request.' ); + $this->index(); + } + + public function view( $data = null ) { + $projectData = self::$projects->findById( $data ); + if ( $projectData !== false ) { + return Views::view( 'wip.admin.view', $projectData ); + } + Issues::add( 'error', 'Projects not found.' ); + $this->index(); + } + + public function delete( $data = null ) { + if ( $data == null ) { + if ( Input::exists( 'P_' ) ) { + $data = Input::post( 'P_' ); + } + } + if ( !self::$projects->delete( (array) $data ) ) { + Issues::add( 'error', 'There was an error with your request.' ); + } else { + Issues::add( 'success', 'Projects has been deleted' ); + } + $this->index(); + } +} diff --git a/app/plugins/wip/controllers/wip.php b/app/plugins/wip/controllers/wip.php new file mode 100644 index 0000000..374602a --- /dev/null +++ b/app/plugins/wip/controllers/wip.php @@ -0,0 +1,36 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Controllers; + +use TheTempusProject\Houdini\Classes\Issues; +use TheTempusProject\Houdini\Classes\Views; +use TheTempusProject\Classes\Controller; +use TheTempusProject\Models\Projects; + +class Wip extends Controller { + protected static $projects; + + public function index() { + self::$projects = new Projects; + self::$title = '{SITENAME} - Works in Progress'; + self::$pageDescription = 'Its not the longest wip in the world, but I\'m certainly proud of it.'; + + $projects = self::$projects->listPaginated(); + if ( false == $projects ) { + Issues::add( 'error', 'Well, this is embarrassing, surely he wouldn\'t just have no wip..... right.... Dave? ... erm Joey?' ); + return; + } else { + Views::view( 'wip.wip', self::$projects->listPaginated() ); + } + } +} diff --git a/app/plugins/wip/forms.php b/app/plugins/wip/forms.php new file mode 100644 index 0000000..5dcb3c7 --- /dev/null +++ b/app/plugins/wip/forms.php @@ -0,0 +1,79 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins\Wip; + +use TheTempusProject\Bedrock\Functions\Input; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Classes\Forms; + +class WipForms extends Forms { + /** + * Adds these functions to the form list. + */ + public function __construct() { + self::addHandler( 'newProject', __CLASS__, 'newProject' ); + self::addHandler( 'editProject', __CLASS__, 'editProject' ); + } + + /** + * Validates the new project post form. + * + * @return {bool} + */ + public static function newProject() { + if ( !Input::exists( 'title' ) ) { + self::addUserError( 'You must specify title' ); + return false; + } + if ( !Input::exists( 'description' ) ) { + self::addUserError( 'You must specify description' ); + return false; + } + if ( !Input::exists( 'progress' ) ) { + self::addUserError( 'You must specify progress' ); + return false; + } + if ( !Input::exists( 'startDate' ) ) { + self::addUserError( 'You must specify startDate' ); + return false; + } + return true; + } + + /** + * Validates the edit project post form. + * + * @return {bool} + */ + public static function editProject() { + if ( !Input::exists( 'title' ) ) { + self::addUserError( 'You must specify title' ); + return false; + } + if ( !Input::exists( 'description' ) ) { + self::addUserError( 'You must specify description' ); + return false; + } + if ( !Input::exists( 'progress' ) ) { + self::addUserError( 'You must specify progress' ); + return false; + } + if ( !Input::exists( 'startDate' ) ) { + self::addUserError( 'You must specify startDate' ); + return false; + } + return true; + } +} + +new WipForms; diff --git a/app/plugins/wip/models/projects.php b/app/plugins/wip/models/projects.php new file mode 100644 index 0000000..3968843 --- /dev/null +++ b/app/plugins/wip/models/projects.php @@ -0,0 +1,85 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Models; + +use TheTempusProject\Bedrock\Classes\Config; +use TheTempusProject\Bedrock\Functions\Check; +use TheTempusProject\Canary\Bin\Canary as Debug; +use TheTempusProject\Classes\DatabaseModel; +use TheTempusProject\Plugins\Wip as Plugin; + +class Projects extends DatabaseModel { + public $tableName = 'projects'; + public $databaseMatrix = [ + [ 'title', 'varchar', '128' ], + [ 'description', 'text', '' ], + [ 'progress', 'int', '3' ], + [ 'startDate', 'varchar', '32' ], + ]; + public $plugin; + + /** + * The model constructor. + */ + public function __construct() { + parent::__construct(); + $this->plugin = new Plugin; + } + + public function create( $title, $description, $progress, $startDate ) { + if ( !$this->plugin->checkEnabled() ) { + Debug::info( 'Wip is disabled in the config.' ); + return false; + } + $fields = [ + 'title' => $title, + 'description' => $description, + 'progress' => $progress, + 'startDate' => $startDate, + ]; + if ( !self::$db->insert( $this->tableName, $fields ) ) { + Debug::info( 'Projects::create - failed to insert to db' ); + return false; + } + return self::$db->lastId(); + } + + public function update( $id, $fields ) { + if ( !Check::id( $id ) ) { + Debug::info( 'Project:update: illegal ID.' ); + return false; + } + if ( !self::$db->update( $this->tableName, $id, $fields ) ) { + // new CustomException( 'projectUpdate' ); + Debug::error( "Project:update: $id not updated: $fields" ); + return false; + } + return true; + } + + public function filter( $postArray, $params = [] ) { + foreach ( $postArray as $instance ) { + if ( !is_object( $instance ) ) { + $instance = $postArray; + $end = true; + } + $instance->prettyStart = $instance->startDate; + $out[] = $instance; + if ( !empty( $end ) ) { + $out = $out[0]; + break; + } + } + return $out; + } +} diff --git a/app/plugins/wip/plugin.php b/app/plugins/wip/plugin.php new file mode 100644 index 0000000..cdede98 --- /dev/null +++ b/app/plugins/wip/plugin.php @@ -0,0 +1,44 @@ + + * @link https://TheTempusProject.com + * @license https://opensource.org/licenses/MIT [MIT LICENSE] + */ +namespace TheTempusProject\Plugins; + +use TheTempusProject\Classes\Plugin; + +class Wip extends Plugin { + public $pluginName = 'TP Wip'; + public $pluginAuthor = 'JoeyK'; + public $pluginWebsite = 'https://TheTempusProject.com'; + public $modelVersion = '1.0'; + public $pluginVersion = '3.0'; + public $pluginDescription = 'A simple plugin which adds management for a wip.'; + public $configName = 'wip'; + public $configMatrix = [ + 'enabled' => [ + 'type' => 'radio', + 'pretty' => 'Enable the wip Feature.', + 'default' => true, + ], + ]; + public $main_links = [ + [ + 'text' => 'WIP', + 'url' => '{ROOT_URL}wip/index', + ], + ]; + public $admin_links = [ + [ + 'text' => ' Wip', + 'url' => '{ROOT_URL}admin/wip', + ], + ]; +} diff --git a/app/plugins/wip/views/admin/create.html b/app/plugins/wip/views/admin/create.html new file mode 100644 index 0000000..c730ee3 --- /dev/null +++ b/app/plugins/wip/views/admin/create.html @@ -0,0 +1,16 @@ +

Create Project

+
+
+

+ +
+

+ +
+

+ +
+

+ + +
\ No newline at end of file diff --git a/app/plugins/wip/views/admin/edit.html b/app/plugins/wip/views/admin/edit.html new file mode 100644 index 0000000..fa82c9f --- /dev/null +++ b/app/plugins/wip/views/admin/edit.html @@ -0,0 +1,16 @@ +

Edit Project

+
+
+

+ +
+

+ +
+

+ +
+

+ + +
\ No newline at end of file diff --git a/app/plugins/wip/views/admin/list.html b/app/plugins/wip/views/admin/list.html new file mode 100644 index 0000000..8cf8197 --- /dev/null +++ b/app/plugins/wip/views/admin/list.html @@ -0,0 +1,41 @@ +Works in Progress +{PAGINATION} +
+ + + + + + + + + + + + + {LOOP} + + + + + + + + + {/LOOP} + {ALT} + + + + {/ALT} + +
TitleProgressStart Date + +
{title}{progress}{startDate} + +
+ No results to show. +
+ Create + +
\ No newline at end of file diff --git a/app/plugins/wip/views/admin/view.html b/app/plugins/wip/views/admin/view.html new file mode 100644 index 0000000..24e8a7c --- /dev/null +++ b/app/plugins/wip/views/admin/view.html @@ -0,0 +1,8 @@ +WIP +
+

{name}

+

{position} from {prettyStart} to {prettyEnd}

+
+ {details} +
+
\ No newline at end of file diff --git a/app/plugins/wip/views/wip.html b/app/plugins/wip/views/wip.html new file mode 100644 index 0000000..f2ef3b4 --- /dev/null +++ b/app/plugins/wip/views/wip.html @@ -0,0 +1,19 @@ +

Work in Progress

+
+{LOOP} +
+

{title}

+

Started: {prettyStart}

+
+
+
+
+ {description} +
+
+{/LOOP} +{ALT} +
+

None Found

+
+{/ALT} \ No newline at end of file diff --git a/app/views/about.html b/app/views/about.html new file mode 100644 index 0000000..c05c7c7 --- /dev/null +++ b/app/views/about.html @@ -0,0 +1,41 @@ +

About Me

+ +
+
+
+ Description of image +
+
+ Description of image +
+
+ Description of image +
+
+

Generally speaking, I feel uncomfortable talking to anyone about myself. + It may seem a bit hollow to say in the about-me section of a website bearing my own name, but its true.

+ +

My name is... Joey Kimsey and I am a 33 year old web-developer. I think it would be fair to say I am a full-stack developer though I find myself in and enjoy backend development more. + Over the past decade I have moved from professionally designing popup advertising for major car manufacturers, to working for the CDC in a major time of crisis, + to harassing AI to spread information to entrepreneurs in other languages. I love this technology and I love what we can do with it.

+ +

Things always get a bit awkward when i tell people I am 33 but I've been doing this for 20 years, but its true. When i was still in single-digits, we got our first PC, with windows 98. + I won't lie to you about remembering the specs, but I can tell you that it changed the world for me. I believe we had internet access through our phone provider before, but eventually we wound up on AOL and the world expanded in front of me. + There were websites for everything! and it was all new, they were still talking about the internet like it was something that was going to happen, but i was already living through it, it was already changing the world around me.

+ +

As many children do, i became curious, I wanted to know how the internet worked. I found out i could have my onw little spot on the internet. I found angelfire. + I learned about html, images, pearl scripts, and I even made webpages for everything i liked: runescape, skateboarding, vampires. Eventually I really wanted to make something so my friends could send me messages on the website. + At the time, pearl was pretty complicated, not many people used it, and it was heavily limited on free hosting. I needed to find a different way, so i started searching and eventually stumbled into php.

+ +

Once I found php, i fell in love with programming. Not only was the web new and fresh, i knew how it worked. I had a magical superpower that no one else did. + Over the years i built dozens of projects including working for many local business-owners from a young age. + I eventually went to college for computer science, where I learned that java is a terrible language and that i was more interested in building than learning how to build, so I dropped out. + After working several jobs over the following years, I was given the opportunity by a close friend to move out of my small town. + When i moved to Atlanta, I finally found an employer willing to give me a shot and my resume picks up from there.

+
+
+
+ + + + diff --git a/app/views/hire.html b/app/views/hire.html new file mode 100644 index 0000000..bf1d7f9 --- /dev/null +++ b/app/views/hire.html @@ -0,0 +1,55 @@ +
+
+
+

Interested in hiring me?

+

+ Open To Freelance / Limited Contract Work +

+

+ Actively Seeking Long-Term Contract Work +

+

+ Actively Seeking Salaried Positions +

+ +

Disclaimer

+ +

I am a full-stack developer but I am generally more capable at backend work. If your project is requires complex design elements or revisions, I may not be the right fit for your needs.

+ +

Pricing

+ +

When it comes to this industry; level-of-effort is the key to everything. + With that in mind, it can be challenging to reliably quote a rate for my time. + For most purposes my rate is $75/hour with a two hour minimum. With larger or repeat projects, compensation is more flexible.

+
+

Contact

+

For privacy reasons, I do not make my personal contact details publicly available. In order to schedule a call or meeting, please connect with me on LinkedIn or use the contact form below.

+

I am generally able to respond to requests within 24 hours.

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+ + diff --git a/app/views/test.html b/app/views/test.html index 884c524..df74b8b 100644 --- a/app/views/test.html +++ b/app/views/test.html @@ -1 +1,159 @@ -lul, testing \ No newline at end of file + + + + + + + + +
+
+
+
+

Joey Kimsey

+

I tried to put something clever here, but when I didn't understand it later I changed it to:
+ There are too many stories to tell here but explore a few below.

+ +

Learn more

+
+

Thanks for taking the time to learn more about me! Forgive the implied redundancy, but my name is Joey Kimsey, and I professionally describe myself as a web developer. On this site you will find a few + brief writings on my career and personal life as well as links to various projects and other services. At this time I don't find much value in the social media platforms. While I do have them, they serve + more as a reservation in my name than an active party.

+

I would love to change the landscape of social media, but alas, I feel we need to give up "free" for "fees" lest we become the product.

+

I live on inbox-zero, and for anyone willing to suffer my google assistant on the first call, I'm always available by phone. With that said, I do not make my personal email or phone number publicly + available on this site. If anything here peaks your interest, or you just want to talk more about a project, feel free to contact me here and I should respond relatively quickly.

+
+
+
+ +
+
+ +
+
+

My Career

+

From IPB to ChatGPT and everything in-between; I have worked with, and on, many platforms. What I would refer to as my "professional experience" spans 7 years but my experience + in this field spans another decade at least. Learn more when you view my Resume. It can be viewed, downloaded, and expounded upon via my blog. Feel free to explore and follow up with any questions.

+
+
+ + + + + + + + + + + + + + + +
+
+

My Products

+

One of the downfalls I have as a developer is failing to save my failures. (trust me, its less philosophical than it sounds) Many times when I finish projects, or call it quits, the code is + either resigned to its life in production where I would prefer it not to be publicly available, or It goes to the big backup disk in the sky. When you factor in my immense respect + for lawyers and the whimsically worded writs they have me sign; I am left with limited examples to share. Fortunately II have some long running project examples which are available for download and review.

+
+
+ +
+
+ + + +
+
+ +
+
+

My Projects

+

At any given time I have at least a half dozen projects in various stages of completion. As most could attest; interests peak and + wain as moods and times change. Here you can find a brief overview of the various projects I am devoting some level of attention to. + Not guaranteed acuate, and not guaranteed complete, but you're here anyways, so take a peak behind the homepage

+
+
+ + + +
+
+

Contact Me

+

While II do not make my phone number or email available, you can still reach out about anything using my contact form here.

+
+
+ + still-working + +
+
\ No newline at end of file diff --git a/bin/tempus_project.php b/bin/tempus_project.php index 922496e..1412d8f 100644 --- a/bin/tempus_project.php +++ b/bin/tempus_project.php @@ -122,6 +122,14 @@ class TheTempusProject extends Bedrock { 'text' => 'Home', 'url' => '{ROOT_URL}home/index', ], + [ + 'text' => 'About Me', + 'url' => '{ROOT_URL}home/about', + ], + [ + 'text' => 'Hire Me', + 'url' => '{ROOT_URL}home/hire', + ], [ 'text' => 'Admin', 'url' => '{ROOT_URL}admin/index', diff --git a/downloads/JoeyKimsey-resume.docx b/downloads/JoeyKimsey-resume.docx new file mode 100644 index 0000000..92814f5 Binary files /dev/null and b/downloads/JoeyKimsey-resume.docx differ diff --git a/downloads/JoeyKimsey-resume.md b/downloads/JoeyKimsey-resume.md new file mode 100644 index 0000000..62ae14d --- /dev/null +++ b/downloads/JoeyKimsey-resume.md @@ -0,0 +1,82 @@ +Joey Kimsey +[joeyk4816@gmail.com](mailto:joeyk4816@gmail.com) + +Summary + +Self-taught application engineer with over 8 years of professional experience building and debugging high traffic web applications and another decade of hands-on experience implementing solutions for smaller private entities. As a member of the team I specialize in understanding complex systems and implementations in order to deliver on intelligent solutions that integrate with existing technology. Able to identify weak points in systems, optimize, or design and implement new solutions. I've worked in application design and development, oversight and QA, even direct customer service. Whether building an app from concept to deployment, or maintaining extensive networks of load-balancers and servers, I'm able to adapt and deliver. + +Highlights + +* Confidential security clearance with the U.S. Federal Government (Expired/Renewable) + +* Extensive knowledge of database interfaces, web server systems, and infrastructure including UNIX, and MacOS + +* Experience working with high traffic systems and handling PII + +* Extensive operational experience with Heroku, AWS, and dedicated/shared hosting + +* Over 20 years of accumulated talent and professional experience in application development + +* Proven track record of learning new technologies as well as adapting to new workflows and systems + +Professional Experience + +**Black Airplane** *March 2021 – July 2024* + +*Senior Developer* + +* Government Contractor for the CDC under Northrop Grumman/Peraton +* Security clearance issued at the confidential level +* Developed custom solutions for content publishing across 18+ .gov sites. +* Heavily centered around the WordPress platform +* Planned, developed and delivered several chat-GPT/Laravel based internal tools and applications for Black Airplane that integrated with other services such as Zoom, Git, Harvest, AWS and Mux Video. +* Developed several stand-alone customer projects to varying specifications utilizing laravel 9-12 + + +**eMeals** *Feb 2020 – Jan 2021* + +*Senior Developer* + +* Developed for several internal tools utilizing nodeJS, PHP, Rails 4, Lambda, and Python +* Responsible for managing the entire infrastructure on AWS including Lambda, CloudFormation, RDS, EC2 with ELB/ALB, Route53, S3, ElastiCache, and CloudSearch +* Created integration services for linking internal and external API’s and enabling inter-application communication +* Implemented better coding standards and error detection with CloudWatch Logging, Alarms, and implementing GitFlow +* Worked with a small team to ensure quality and appearance are maintained from Responsive web to android and iOS apps + +**SpringBot** *Dec 2017 – Feb 2020* + +*Operations Engineer* + +* Developed and refactored code for high volume web services that integrated with online shopping platforms including Shopify, BigCommerce, WooCommerce, and Magento +* Investigated and resolved bug reports and improved server latency and response times +* Developed, oversaw, and deployed multiple applications in several languages +* Responsible for providing fast and accurate information for any urgent issues or day to day operation of an extensive network of web applications across AWS, Heroku, and others +* Worked with multiple teams to define requirements and design custom solutions in a continuous Integration cycle +* Automated processes that saved over 45 hours of engineer time per week + +**IgnitionOne** *Oct 2016 – Dec 2017* + +*PHP Developer* + +* Built and refactored code for high volume web services that integrated with existing client infrastructure including Nissan, Ford, Blizzard EU, and many other major brands +* Implemented and utilized API services for secure data transfer including PII +* Responsible for developing, implementing, and testing user interfaces from concept to deployment +* Peer reviewed revisions and tested code as part of quality assurance standards +* Wrote documentation for development procedures and audited existing code +* Worked with teams to refine requirements and implement custom solutions for large enterprise clients +* Implemented many popular 3rd party services including Facebook Audiences, Adobe analytics, Google Analytics, other industry standard services and remarketing tags + +Skills + +**Operations**: OpsGenie, SumoLogic, Bugsnag, SendGrid, NewRelic, circleCI, Jenkins + +**Frameworks:** Wordpress, Magento, WooCommerce, BootStrap, TailWind, some Symphony + +**Languages:** PHP 5+, CSS/LESS/SASS, JavaScript/CoffeeScript, jQuery/AJAX, Python 2+, GO, Rails 4+, some nodeJS 6, 12 + +**Databases:** REDIS, MSSQL, MySQL, Postgres, Mongo, Metabase + +**Version Control:** Git, SVN + +**Workflows and Tools:** Agile/SCRUM, Atlassian products (Jira, Confluence, HipChat), Zoho, Slack + diff --git a/downloads/JoeyKimsey-resume.pdf b/downloads/JoeyKimsey-resume.pdf new file mode 100644 index 0000000..dcfa45d Binary files /dev/null and b/downloads/JoeyKimsey-resume.pdf differ diff --git a/downloads/JoeyKimsey-resume.txt b/downloads/JoeyKimsey-resume.txt new file mode 100644 index 0000000..5151b84 --- /dev/null +++ b/downloads/JoeyKimsey-resume.txt @@ -0,0 +1,55 @@ +Joey Kimsey +joeyk4816@gmail.com +Summary +Self-taught application engineer with over 8 years of professional experience building and debugging high traffic web applications and another decade of hands-on experience implementing solutions for smaller private entities. As a member of the team I specialize in understanding complex systems and implementations in order to deliver on intelligent solutions that integrate with existing technology. Able to identify weak points in systems, optimize, or design and implement new solutions. I've worked in application design and development, oversight and QA, even direct customer service. Whether building an app from concept to deployment, or maintaining extensive networks of load-balancers and servers, I'm able to adapt and deliver. +Highlights +* Confidential security clearance with the U.S. Federal Government (Expired/Renewable) +* Extensive knowledge of database interfaces, web server systems, and infrastructure including UNIX, and MacOS +* Experience working with high traffic systems and handling PII +* Extensive operational experience with Heroku, AWS, and dedicated/shared hosting +* Over 20 years of accumulated talent and professional experience in application development +* Proven track record of learning new technologies as well as adapting to new workflows and systems +Professional Experience +Black Airplane March 2021 – July 2024 +Senior Developer +* Government Contractor for the CDC under Northrop Grumman/Peraton +* Security clearance issued at the confidential level +* Developed custom solutions for content publishing across 18+ .gov sites. +* Heavily centered around the WordPress platform +* Planned, developed and delivered several chat-GPT/Laravel based internal tools and applications for Black Airplane that integrated with other services such as Zoom, Git, Harvest, AWS and Mux Video. +* Developed several stand-alone customer projects to varying specifications utilizing laravel 9-12 + + +eMeals Feb 2020 – Jan 2021 +Senior Developer +* Developed for several internal tools utilizing nodeJS, PHP, Rails 4, Lambda, and Python +* Responsible for managing the entire infrastructure on AWS including Lambda, CloudFormation, RDS, EC2 with ELB/ALB, Route53, S3, ElastiCache, and CloudSearch +* Created integration services for linking internal and external API’s and enabling inter-application communication +* Implemented better coding standards and error detection with CloudWatch Logging, Alarms, and implementing GitFlow +* Worked with a small team to ensure quality and appearance are maintained from Responsive web to android and iOS apps +SpringBot Dec 2017 – Feb 2020 +Operations Engineer +* Developed and refactored code for high volume web services that integrated with online shopping platforms including Shopify, BigCommerce, WooCommerce, and Magento +* Investigated and resolved bug reports and improved server latency and response times +* Developed, oversaw, and deployed multiple applications in several languages +* Responsible for providing fast and accurate information for any urgent issues or day to day operation of an extensive network of web applications across AWS, Heroku, and others +* Worked with multiple teams to define requirements and design custom solutions in a continuous Integration cycle +* Automated processes that saved over 45 hours of engineer time per week +IgnitionOne Oct 2016 – Dec 2017 +PHP Developer +* Built and refactored code for high volume web services that integrated with existing client infrastructure including Nissan, Ford, Blizzard EU, and many other major brands +* Implemented and utilized API services for secure data transfer including PII +* Responsible for developing, implementing, and testing user interfaces from concept to deployment +* Peer reviewed revisions and tested code as part of quality assurance standards +* Wrote documentation for development procedures and audited existing code +* Worked with teams to refine requirements and implement custom solutions for large enterprise clients +* Implemented many popular 3rd party services including Facebook Audiences, Adobe analytics, Google Analytics, other industry standard services and remarketing tags + + +Skills +Operations: OpsGenie, SumoLogic, Bugsnag, SendGrid, NewRelic, circleCI, Jenkins +Frameworks: Wordpress, Magento, WooCommerce, BootStrap, TailWind, some Symphony +Languages: PHP 5+, CSS/LESS/SASS, JavaScript/CoffeeScript, jQuery/AJAX, Python 2+, GO, Rails 4+, some nodeJS 6, 12 +Databases: REDIS, MSSQL, MySQL, Postgres, Mongo, Metabase +Version Control: Git, SVN +Workflows and Tools: Agile/SCRUM, Atlassian products (Jira, Confluence, HipChat), Zoho, Slack \ No newline at end of file diff --git a/images/AAA_M_Additions.png b/images/AAA_M_Additions.png new file mode 100644 index 0000000..8135aaf Binary files /dev/null and b/images/AAA_M_Additions.png differ diff --git a/images/ba.png b/images/ba.png new file mode 100644 index 0000000..3621f3c Binary files /dev/null and b/images/ba.png differ diff --git a/images/bedrock.jpg b/images/bedrock.jpg new file mode 100644 index 0000000..10179d6 Binary files /dev/null and b/images/bedrock.jpg differ diff --git a/images/canary.jpg b/images/canary.jpg new file mode 100644 index 0000000..4ca0b1f Binary files /dev/null and b/images/canary.jpg differ diff --git a/images/cleaned-up.jpg b/images/cleaned-up.jpg new file mode 100644 index 0000000..cead319 Binary files /dev/null and b/images/cleaned-up.jpg differ diff --git a/images/curseforge.png b/images/curseforge.png new file mode 100644 index 0000000..a166381 Binary files /dev/null and b/images/curseforge.png differ diff --git a/images/dockerhub.png b/images/dockerhub.png new file mode 100644 index 0000000..2b15b10 Binary files /dev/null and b/images/dockerhub.png differ diff --git a/images/emeals.png b/images/emeals.png new file mode 100644 index 0000000..d3336d2 Binary files /dev/null and b/images/emeals.png differ diff --git a/images/github-2.png b/images/github-2.png new file mode 100644 index 0000000..268d998 Binary files /dev/null and b/images/github-2.png differ diff --git a/images/gitlab.png b/images/gitlab.png new file mode 100644 index 0000000..02b0e14 Binary files /dev/null and b/images/gitlab.png differ diff --git a/images/hermes.jpg b/images/hermes.jpg new file mode 100644 index 0000000..3c08ea4 Binary files /dev/null and b/images/hermes.jpg differ diff --git a/images/houdini.jpg b/images/houdini.jpg new file mode 100644 index 0000000..888b849 Binary files /dev/null and b/images/houdini.jpg differ diff --git a/images/ione.png b/images/ione.png new file mode 100644 index 0000000..d2628b5 Binary files /dev/null and b/images/ione.png differ diff --git a/images/on-call.jpg b/images/on-call.jpg new file mode 100644 index 0000000..f9f9596 Binary files /dev/null and b/images/on-call.jpg differ diff --git a/images/packagist.png b/images/packagist.png new file mode 100644 index 0000000..6304ea8 Binary files /dev/null and b/images/packagist.png differ diff --git a/images/springbot.png b/images/springbot.png new file mode 100644 index 0000000..6838aac Binary files /dev/null and b/images/springbot.png differ diff --git a/images/still-working.jpg b/images/still-working.jpg new file mode 100644 index 0000000..d9373b3 Binary files /dev/null and b/images/still-working.jpg differ diff --git a/images/tte.png b/images/tte.png new file mode 100644 index 0000000..e312216 Binary files /dev/null and b/images/tte.png differ diff --git a/images/vacation.jpg b/images/vacation.jpg new file mode 100644 index 0000000..7f7faaf Binary files /dev/null and b/images/vacation.jpg differ diff --git a/images/voting.jpg b/images/voting.jpg new file mode 100644 index 0000000..d693e24 Binary files /dev/null and b/images/voting.jpg differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..f5b01d1 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + +

Coming Soon - JK

+ + \ No newline at end of file diff --git a/server/README.md b/server/README.md new file mode 100644 index 0000000..89420d5 --- /dev/null +++ b/server/README.md @@ -0,0 +1,68 @@ +# fresh install + +## Install required apps +``` +apt install git composer php8.1-curl -y +``` + +## Set-Up the SSL folder to keep things together + +``` +mkdir /etc/nginx/ssl/ +``` + +- Now That you have the directory created, copy the `.key` and `.pem` files into the newly made ssl folder on the server. +- You will then need to modify the filer ownership and permissions + +``` +chmod -R 655 /etc/nginx/ssl +chown -R www-data:www-data /etc/nginx/ssl +``` + +## Add configs for the site + +- First, copy `ttp.conf` into the `/etc/nginx/snippets/` folder. +- Next, copy the `joeykimsey.com.conf` file into the `/etc/nginx/sites-available/` folder. +- The next block will acomplish a few things: backup the old config, enable the new config, disable the old config, and restart the server. +``` +mkdir /etc/nginx/sites-available/old/ +sudo mv /etc/nginx/sites-available/* /etc/nginx/sites-available/old/ +sudo ln -s /etc/nginx/sites-available/joeykimsey.com.conf /etc/nginx/sites-enabled/joeykimsey.com.conf +sudo rm -rf /etc/nginx/sites-enabled/* +sudo systemctl restart nginx.service +``` + +## Set-Up the files + +``` +cd /var/www/ +git config --global credential.helper store +git clone https://git.thetempusproject.com/joeykimsey/joeykimsey-com.git joeykimsey.com +cd joeykimsey.com +git fetch +git checkout production +``` + +_You will be prompted for git creds, use the creds shared below_ + +``` +git config --global --add safe.directory /var/www/joeykimsey.com +git config --global --add safe.directory /var/www/joeykimsey.com/vendor/joeykimsey/hermes +git config --global user.name "Production Server" +git config --global user.email webmaster@thetempusproject.com +cd joeykimsey.com +composer install +chmod -R 777 . +chown -R www-data:www-data . +``` + +#### GitLab Credentials: + +User: `root`\ +Password: `rdFtVPhzlu6u6orxN4NAsbgAE4AyqZPTXPXQTleyA5I=` + +#### Logging + +``` +tail -f /var/log/nginx/*.log +``` \ No newline at end of file diff --git a/server/joeykimsey.com.conf b/server/joeykimsey.com.conf new file mode 100644 index 0000000..c517c02 --- /dev/null +++ b/server/joeykimsey.com.conf @@ -0,0 +1,36 @@ +# upstream to abstract backend connection(s) for php +upstream php { + server unix:/run/php/php8.1-fpm.sock; +} +server { + listen 80; + listen [::]:80; + server_name joeykimsey.com; + include snippets/well-known; + return 301 https://$host$request_uri; +} +server { + listen 443 ssl http2 default_server; + listen [::]:443 ssl http2 default_server; + server_name joeykimsey.com; + include snippets/ssl-params.conf; + root /var/www/joeykimsey.com; + index index.php; + + # max php upload size + client_max_body_size 100M; + + # disable direcory indexing + autoindex off; + + # custom TTP code + include snippets/ttp.conf; + + location ~* \.php$ { + fastcgi_pass php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + fastcgi_intercept_errors on; + } +} \ No newline at end of file diff --git a/server/joeykimsey.com.key b/server/joeykimsey.com.key new file mode 100644 index 0000000..2703108 --- /dev/null +++ b/server/joeykimsey.com.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCCDz/yF986JlZv +L9clCvVBV+unJEYLm9FUCS4r3dPG96heQWX0qIV4an25jk/bb//sO4MOA3tmRiYk +sf3XsYPD6WY+ezNhUx4i4ADO63CRRvNdgKozspI2F3FrWrQgp7vZ4HgRGNeWNExc +oFyuW+x97Sg6I8CEvL2GPNn/UvQ7BVygrCI5VlypYiQcVtWXNq9zFXI6pz/4tZmD +QSdRAoNRjcMEetKsKyG1oEnbdPgb8gdaUmpa/lTgjiWj8fU9AS4sFgFCzHMyzjnn +Y3lonwn1/a6rZmyPYs85AnllyRq7bvDfWq12FVXujeLMt53RKdECvnXaIQsOALpy +AfbrCczhAgMBAAECggEAE5dYeo8+APRlcLo0HlBYQU+NH9BG/Nir34zCd7kifYYw +xoHzabc447qm1ZyqStPEKUGNrD66B93pQP3Ozv7ealRuIltMkgyDLZ2wgXrVqgyV +/C+1c7QiciN14kX3fDPICDnX3Dtxvh6CojFFxL30EcP3m0pnZZdItT/VVrCYOYuO +P1+IKsp1DvSzK3fvQJfWhhyeTCquC4WdlGq/T3btWoNQArX/a5y/wOXugS/pAwV9 +i6O+aRq80FWH1ezt/Ww8p0NQKJT0jVU0kE5gheq/btjGkIe4deFs7uOlXnRPt0Jx +dYNPpMIdlfH9oiUoe2n5Aw2FuyCB/m5CSvZiY7aLQQKBgQC24iwLawgfb6b/31Qu +JdUjeOOi93wkagSyTABN3WAUY9FdoW0UImdvEfbyqJzzWbX9CQ/henpWys02vDBq +zU9QS9yTi+fD/ruNHL01IUHyWksVT5D70zWJ+NQMCp38a0iTtlVTmYpczTsUPw7p +ESheI1B2HoMmxWf+bwR9f8RMgwKBgQC2DqK+/fPK4YRRdZCww8OyM8kjQu+CtZkE +ahJIYgvnNyhqNawvWiYm4BdOtz3Sen5pTX4FbpfBOIuc3utYYOhfpveuIc7EuC0u +GdI5y22Mx3cgYNtuTsyF9/jLEk7ZI0iTTqdyjAEpdziTHSVRkk1DPDNEzHdhMwPD +Pa61u/KLywKBgQC1TGfPde6ag2wxkmr4SKcPwEMihmd6DePUAUX36vLZo86lHGdv +I2AYmt2N15uoHxIr43Tr2Sg4rFld3pe8+QWcm2fymSpMgVXaYVgsuGiQ4fQ3Dyay +jsIvog5MVaYi2xQa4xGZi8e/kfD0dELKyCiVkjqsrjjkEaSzdckkxKmMEwKBgBxB +Gzre+MYEx99IiqMUTrvKU634RmmXu163A41eQhCpO8l3+PgEWqVv484gnCSdRB8d +mrBHIKApIWnAIvA9YfLuW8QXlRpspv5fnYPAsYjGsBNDVOrCqfUkreT+O2RxmGLc +MxqQ5eFEknAqds85EGqd3isQPHrGSxAy83la6OKPAoGBAKju8lOKvGuX5OSGzHdd +3rbxSbsCodJs4BwnfD6LsL1MnNsjZvN8MOaSvHUUc/FATbj1iv/iNQ8ZNLtYTQLf +83GzwZuqWKHw+dHzv5+32ITieF3qNMC/QNKxMmIOz4QthNpqOfC5LUiPf8rgXIMI +UQ1VHuQhTUaQtd53UABDuIwi +-----END PRIVATE KEY----- diff --git a/server/joeykimsey.com.pem b/server/joeykimsey.com.pem new file mode 100644 index 0000000..e8b8269 --- /dev/null +++ b/server/joeykimsey.com.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEqDCCA5CgAwIBAgIUDbwdQX307jhWxbOmrK7wkL03094wDQYJKoZIhvcNAQEL +BQAwgYsxCzAJBgNVBAYTAlVTMRkwFwYDVQQKExBDbG91ZEZsYXJlLCBJbmMuMTQw +MgYDVQQLEytDbG91ZEZsYXJlIE9yaWdpbiBTU0wgQ2VydGlmaWNhdGUgQXV0aG9y +aXR5MRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMRMwEQYDVQQIEwpDYWxpZm9ybmlh +MB4XDTI0MDgxNjA5MzQwMFoXDTM5MDgxMzA5MzQwMFowYjEZMBcGA1UEChMQQ2xv +dWRGbGFyZSwgSW5jLjEdMBsGA1UECxMUQ2xvdWRGbGFyZSBPcmlnaW4gQ0ExJjAk +BgNVBAMTHUNsb3VkRmxhcmUgT3JpZ2luIENlcnRpZmljYXRlMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgg8/8hffOiZWby/XJQr1QVfrpyRGC5vRVAku +K93TxveoXkFl9KiFeGp9uY5P22//7DuDDgN7ZkYmJLH917GDw+lmPnszYVMeIuAA +zutwkUbzXYCqM7KSNhdxa1q0IKe72eB4ERjXljRMXKBcrlvsfe0oOiPAhLy9hjzZ +/1L0OwVcoKwiOVZcqWIkHFbVlzavcxVyOqc/+LWZg0EnUQKDUY3DBHrSrCshtaBJ +23T4G/IHWlJqWv5U4I4lo/H1PQEuLBYBQsxzMs4552N5aJ8J9f2uq2Zsj2LPOQJ5 +Zckau27w31qtdhVV7o3izLed0SnRAr512iELDgC6cgH26wnM4QIDAQABo4IBKjCC +ASYwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcD +ATAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSHgiWJ7iIpiP0MfSt9sDTIBKHqMTAf +BgNVHSMEGDAWgBQk6FNXXXw0QIep65TbuuEWePwppDBABggrBgEFBQcBAQQ0MDIw +MAYIKwYBBQUHMAGGJGh0dHA6Ly9vY3NwLmNsb3VkZmxhcmUuY29tL29yaWdpbl9j +YTArBgNVHREEJDAighAqLmpvZXlraW1zZXkuY29tgg5qb2V5a2ltc2V5LmNvbTA4 +BgNVHR8EMTAvMC2gK6AphidodHRwOi8vY3JsLmNsb3VkZmxhcmUuY29tL29yaWdp +bl9jYS5jcmwwDQYJKoZIhvcNAQELBQADggEBAAAPi9X3zOoNfI08eNlX0zp5mmov +qi9zENvRKg0aWldhlrjM3DsnHS3I9pNpI13CSVwMTm6WNwaEC38+0HES8hnpNnXW +0l9EcvORkrvdgoHl32auzgjemt4j8ul59BtGovJ2NuPRxrRq5tjxZbL4eagz6WNj +2MZs4Jp4EfHhjV19eriWrkJl+Kusp6WASwVkx5tYT4Qd6sdzPJ8bKFV6cF6Z9vMt +LGxD4d97jqQDAEyYdaR2DRuBIZ6RbJNW0ivQiWsRhqLnYFIEnhFGeACj1sWLjBc/ +tfqu9ATVEDPg6bzSTgoVcczujoZbIoB2Zh2bhEu++Bhp7XndhmCCC50ZF9c= +-----END CERTIFICATE----- diff --git a/server/ttp.conf b/server/ttp.conf new file mode 100644 index 0000000..19ff09f --- /dev/null +++ b/server/ttp.conf @@ -0,0 +1,74 @@ +add_header X-Frame-Options "SAMEORIGIN"; +add_header X-Content-Type-Options "nosniff"; + +access_log /var/log/nginx/access.log; +error_log /var/log/nginx/error.log; + +index index.php; + +charset utf-8; + +error_page 404 /index.php; + +ssl_certificate /etc/nginx/ssl/joeykimsey.com.pem; +ssl_certificate_key /etc/nginx/ssl/joeykimsey.com.key; + +location = /favicon.ico { + log_not_found off; + access_log off; +} + +location = /robots.txt { + allow all; + log_not_found off; + access_log off; +} + +location ~ /\.(?!well-known).* { + deny all; +} + +location ~ /\.ht { + deny all; +} + +location ~ ^/(doc|sql|setup)/ { + deny all; +} + +location ~ /\. { + deny all; +} + +location ~* \.(?:js|css|png|jpg|gif|ico|woff|ttf|woff2)$ { + access_log off; + log_not_found off; +} + +location /js/ { + access_log off; + log_not_found off; + try_files $uri /index.php?error=js404&file=$uri; +} + +location /css/ { + access_log off; + log_not_found off; + try_files $uri /index.php?error=css404&file=$uri; +} + +location /images/ { + try_files $uri /index.php?error=image404&url=$uri; +} + +location /uploads/ { + try_files $uri /index.php?error=upload404&url=$uri; +} + +location /errors/ { + try_files $uri /index.php?error=$uri; +} + +location / { + rewrite ^/(.+)$ /index.php?url=$1&$args; +} \ No newline at end of file