From e6d95488be4310b8bd85854c541777bb26299658 Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Wed, 16 Nov 2022 01:32:48 -0500 Subject: app: Cleanup dead files and organize hierarchy --- .gitignore | 10 +-- app/Routes.php | 31 ++++++++ app/controllers/about.controller.php | 3 + app/controllers/comments.controller.php | 3 + app/controllers/contact.controller.php | 56 ++++++++++++++ app/controllers/index.controller.php | 3 + app/controllers/wall.controller.php | 3 + app/model/Form.php | 9 +++ app/model/Navigation.php | 30 ++++++++ app/views/about.view.php | 7 ++ app/views/components/AudioPlayer.php | 51 +++++++++++++ app/views/contact.view.php | 88 +++++++++++++++++++++ app/views/index.view.php | 89 ++++++++++++++++++++++ app/views/partials/footer.php | 26 +++++++ app/views/partials/header.common.php | 25 ++++++ app/views/partials/header.error.php | 3 + app/views/partials/header.php | 46 +++++++++++ app/views/partials/navigator.links.php | 5 ++ app/views/partials/navigator.php | 79 +++++++++++++++++++ app/views/wall.view.php | 6 ++ assets/app.css | 0 assets/app.js | 13 ---- bootstrap/Router.php | 6 +- bootstrap/Routes.php | 31 -------- controllers/about.controller.php | 3 - controllers/comments.controller.php | 3 - controllers/contact.controller.php | 56 -------------- controllers/index.controller.php | 3 - controllers/wall.controller.php | 3 - .../hugo/themes/edwin/layouts/partials/footer.html | 2 +- .../hugo/themes/edwin/layouts/partials/header.html | 2 +- .../themes/edwin/layouts/partials/navigator.html | 2 +- model/Form.php | 9 --- model/Navigation.php | 30 -------- public/css/app.css | 39 ---------- public/dist/app.css | 39 ++++++++++ public/index.php | 4 +- public/js/app.js | 0 views/about.view.php | 7 -- views/components/AudioPlayer.php | 51 ------------- views/contact.view.php | 88 --------------------- views/index.view.php | 89 ---------------------- views/partials/footer.php | 26 ------- views/partials/header.common.php | 25 ------ views/partials/header.error.php | 3 - views/partials/header.php | 46 ----------- views/partials/navigator.links.php | 5 -- views/partials/navigator.php | 79 ------------------- views/wall.view.php | 6 -- 49 files changed, 613 insertions(+), 630 deletions(-) create mode 100644 app/Routes.php create mode 100644 app/controllers/about.controller.php create mode 100644 app/controllers/comments.controller.php create mode 100644 app/controllers/contact.controller.php create mode 100644 app/controllers/index.controller.php create mode 100644 app/controllers/wall.controller.php create mode 100644 app/model/Form.php create mode 100644 app/model/Navigation.php create mode 100644 app/views/about.view.php create mode 100644 app/views/components/AudioPlayer.php create mode 100644 app/views/contact.view.php create mode 100644 app/views/index.view.php create mode 100644 app/views/partials/footer.php create mode 100644 app/views/partials/header.common.php create mode 100644 app/views/partials/header.error.php create mode 100644 app/views/partials/header.php create mode 100644 app/views/partials/navigator.links.php create mode 100644 app/views/partials/navigator.php create mode 100644 app/views/wall.view.php delete mode 100644 assets/app.css delete mode 100644 assets/app.js delete mode 100644 bootstrap/Routes.php delete mode 100644 controllers/about.controller.php delete mode 100644 controllers/comments.controller.php delete mode 100644 controllers/contact.controller.php delete mode 100644 controllers/index.controller.php delete mode 100644 controllers/wall.controller.php delete mode 100644 model/Form.php delete mode 100644 model/Navigation.php delete mode 100644 public/css/app.css create mode 100644 public/dist/app.css delete mode 100644 public/js/app.js delete mode 100644 views/about.view.php delete mode 100644 views/components/AudioPlayer.php delete mode 100644 views/contact.view.php delete mode 100644 views/index.view.php delete mode 100644 views/partials/footer.php delete mode 100644 views/partials/header.common.php delete mode 100644 views/partials/header.error.php delete mode 100644 views/partials/header.php delete mode 100644 views/partials/navigator.links.php delete mode 100644 views/partials/navigator.php delete mode 100644 views/wall.view.php diff --git a/.gitignore b/.gitignore index 1d09c82..6d19387 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ -/vendor -/public/posts -/public/error/error.json -/public/error/error.html -generators/hugo/public +.hugo_build.lock /bootstrap/comments/comments +/public/posts +/vendor config.php +generators/hugo/public +google[a-z0-9]*.html diff --git a/app/Routes.php b/app/Routes.php new file mode 100644 index 0000000..59c0f40 --- /dev/null +++ b/app/Routes.php @@ -0,0 +1,31 @@ +get('', '../app/controllers/index.controller.php'); +$router->get('contact', '../app/controllers/contact.controller.php'); +$router->get('wall', '../app/controllers/wall.controller.php'); +$router->get('comments', '../app/controllers/comments.controller.php'); +$router->get('about', '../app/controllers/about.controller.php'); +$router->get('hashget', '../app/controllers/comments.controller.php'); +$router->get('hashover', '../app/controllers/comments.controller.php'); + +$router->head('', '../app/controllers/index.controller.php'); +$router->head('contact', '../app/controllers/contact.controller.php'); +$router->head('wall', '../app/controllers/wall.controller.php'); +$router->head('comments', '../app/controllers/comments.controller.php'); +$router->head('hashget', '../app/controllers/comments.controller.php'); +$router->head('hashover', '../app/controllers/comments.controller.php'); + +$router->post('contact', '../app/controllers/contact.controller.php'); +$router->post('hashpost', '../app/controllers/comments.controller.php'); + +/* backend routes */ + +$router->get('latestajax', '../bootstrap/comments/backend/latest-ajax.php'); +$router->get('countlinkajax', '../bootstrap/comments/backend/count-link-ajax.php'); + +$router->post('commentsajax', '../bootstrap/comments/backend/comments-ajax.php'); +$router->post('formactions', '../bootstrap/comments/backend/form-actions.php'); +$router->post('loadcomments', '../bootstrap/comments/backend/load-comments.php'); +$router->post('likecomment', '../bootstrap/comments/backend/like.php'); diff --git a/app/controllers/about.controller.php b/app/controllers/about.controller.php new file mode 100644 index 0000000..cb58a14 --- /dev/null +++ b/app/controllers/about.controller.php @@ -0,0 +1,3 @@ +name = $name = $_POST['26471'] ?? null; + $submit->email = $email = $_POST['26472'] ?? null; + $submit->message = $message = $_POST['26473'] ?? null; + $submit->spam = $spam = $_POST['agree'] ?? false; + + $validEmail = PHPMailer::validateAddress($submit->email, 'auto'); + + if ((bool) empty($submit->email) == true + || (bool) empty($submit->message) == true + ) { + include '../app/views/contact.view.php'; + return; + } + + if ((bool) $spam == true) { + error_log('Contact Form Spam: Error 403'); + return http_response_code(403); + } + + if ($validEmail === false ) { + $emailError = 'Invalid email: ' . "\r" . ''. $submit->email . ''; + include '../app/views/contact.view.php'; + return; + } + + $formSuccess = true; + + $name = null; + $email = null; + $message = null; + $spam = false; + + include '../app/views/contact.view.php'; + fastcgi_finish_request(); + + $contact['database']->insert( + 'contactform', [ + 'name' => $submit->name, + 'email' => $submit->email, + 'message' => $submit->message, + ] + ); + + return sendMail($submit->name, $submit->email, $submit->message); +} + +require '../app/views/contact.view.php'; diff --git a/app/controllers/index.controller.php b/app/controllers/index.controller.php new file mode 100644 index 0000000..7ec4a52 --- /dev/null +++ b/app/controllers/index.controller.php @@ -0,0 +1,3 @@ +requestContains($route) + ) { + return 'link-active text-black '; + } + return; + } +} diff --git a/app/views/about.view.php b/app/views/about.view.php new file mode 100644 index 0000000..ae28201 --- /dev/null +++ b/app/views/about.view.php @@ -0,0 +1,7 @@ + + +

+ Edwin is a voiceover artist specializing in low to mid-range voiceovers. +

+ + diff --git a/app/views/components/AudioPlayer.php b/app/views/components/AudioPlayer.php new file mode 100644 index 0000000..d3ba487 --- /dev/null +++ b/app/views/components/AudioPlayer.php @@ -0,0 +1,51 @@ +
+ +
+ +
+ +
+ +
+ +
+
+
0:00
+
+
+
+
+
+
+
0:00
+
+
+ +
+ +
+
+ + volume +
+
+ + + + + +
+ +
+ +
+ +
+ +
+ +
diff --git a/app/views/contact.view.php b/app/views/contact.view.php new file mode 100644 index 0000000..4b4da41 --- /dev/null +++ b/app/views/contact.view.php @@ -0,0 +1,88 @@ + + + + +
+ + +
+

Contact

+

+ Interested in collaborating together? + Send a message by using the form below. +

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

+ + +
+ +
+
+
+ + +
+
+ +
+ +
+ + + +
+ + diff --git a/app/views/index.view.php b/app/views/index.view.php new file mode 100644 index 0000000..29f17b4 --- /dev/null +++ b/app/views/index.view.php @@ -0,0 +1,89 @@ + + +

Let's bring a story to life

+ +

+ Strong voice for narration, trailers, storytelling, and more. +

+ +

Prologue

+ +

+ Focused introductory elements for literary, dramatic, and musical arts. +

+ + + + + + + +

Narrative

+ +

+ Spoken or written accounts of connected events. +

+ + + + + + + +

Dramatic

+ +

+ Sudden and striking narrative elements. +

+ + + + + + + +

Commercial

+ +

+ Old school narrative commercial style. +

+ + + + + + + + diff --git a/app/views/partials/footer.php b/app/views/partials/footer.php new file mode 100644 index 0000000..e2f2a6b --- /dev/null +++ b/app/views/partials/footer.php @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/app/views/partials/header.common.php b/app/views/partials/header.common.php new file mode 100644 index 0000000..3a21e8e --- /dev/null +++ b/app/views/partials/header.common.php @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/views/partials/header.error.php b/app/views/partials/header.error.php new file mode 100644 index 0000000..9f00aa9 --- /dev/null +++ b/app/views/partials/header.error.php @@ -0,0 +1,3 @@ + + + diff --git a/app/views/partials/header.php b/app/views/partials/header.php new file mode 100644 index 0000000..1809de0 --- /dev/null +++ b/app/views/partials/header.php @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + Edwin Mattiacci - <?php title();?> + + + + + + + + + + + + +
+ + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
diff --git a/app/views/partials/navigator.links.php b/app/views/partials/navigator.links.php new file mode 100644 index 0000000..f023e32 --- /dev/null +++ b/app/views/partials/navigator.links.php @@ -0,0 +1,5 @@ + +Home +Posts +Feedback +Contact diff --git a/app/views/partials/navigator.php b/app/views/partials/navigator.php new file mode 100644 index 0000000..78bb138 --- /dev/null +++ b/app/views/partials/navigator.php @@ -0,0 +1,79 @@ + + diff --git a/app/views/wall.view.php b/app/views/wall.view.php new file mode 100644 index 0000000..0635325 --- /dev/null +++ b/app/views/wall.view.php @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/app.css b/assets/app.css deleted file mode 100644 index e69de29..0000000 diff --git a/assets/app.js b/assets/app.js deleted file mode 100644 index 9e3b08a..0000000 --- a/assets/app.js +++ /dev/null @@ -1,13 +0,0 @@ - -// Javascript - -require('./js/SoundManager2'); -require('./js/InlinePlayer'); -require('./js/Navigator'); -require('./js/Popup'); -require('./js/BackgroundFade'); - -// CSS - -require('./css/edwin.css'); -require('./css/font-awesome.css'); diff --git a/bootstrap/Router.php b/bootstrap/Router.php index 34e278c..c78ab8b 100644 --- a/bootstrap/Router.php +++ b/bootstrap/Router.php @@ -1,6 +1,6 @@ [], @@ -26,7 +26,7 @@ class Router public static function load($file) { $router = new static; - require $file; + include $file; return $router; } @@ -35,8 +35,6 @@ class Router if (is_array($this->routes[$requestType]) && array_key_exists($uri, $this->routes[$requestType])) { return $this->routes[$requestType][$uri]; } - // throw new Exception('No route defined for this URI: "'.$uri.'"'); - die(http_response_code(404)); } } diff --git a/bootstrap/Routes.php b/bootstrap/Routes.php deleted file mode 100644 index 33576e4..0000000 --- a/bootstrap/Routes.php +++ /dev/null @@ -1,31 +0,0 @@ -get('', '../controllers/index.controller.php'); -$router->get('contact', '../controllers/contact.controller.php'); -$router->get('wall', '../controllers/wall.controller.php'); -$router->get('comments', '../controllers/comments.controller.php'); -$router->get('about', '../controllers/about.controller.php'); -$router->get('hashget', '../controllers/comments.controller.php'); -$router->get('hashover', '../controllers/comments.controller.php'); - -$router->head('', '../controllers/index.controller.php'); -$router->head('contact', '../controllers/contact.controller.php'); -$router->head('wall', '../controllers/wall.controller.php'); -$router->head('comments', '../controllers/comments.controller.php'); -$router->head('hashget', '../controllers/comments.controller.php'); -$router->head('hashover', '../controllers/comments.controller.php'); - -$router->post('contact', '../controllers/contact.controller.php'); -$router->post('hashpost', '../controllers/comments.controller.php'); - -/* backend routes */ - -$router->get('latestajax', '../bootstrap/comments/backend/latest-ajax.php'); -$router->get('countlinkajax', '../bootstrap/comments/backend/count-link-ajax.php'); - -$router->post('commentsajax', '../bootstrap/comments/backend/comments-ajax.php'); -$router->post('formactions', '../bootstrap/comments/backend/form-actions.php'); -$router->post('loadcomments', '../bootstrap/comments/backend/load-comments.php'); -$router->post('likecomment', '../bootstrap/comments/backend/like.php'); diff --git a/controllers/about.controller.php b/controllers/about.controller.php deleted file mode 100644 index e65098f..0000000 --- a/controllers/about.controller.php +++ /dev/null @@ -1,3 +0,0 @@ -name = $name = $_POST['26471'] ?? null; - $submit->email = $email = $_POST['26472'] ?? null; - $submit->message = $message = $_POST['26473'] ?? null; - $submit->spam = $spam = $_POST['agree'] ?? false; - - $validEmail = PHPMailer::validateAddress($submit->email, 'auto'); - - if ((bool) empty($submit->email) == true - || (bool) empty($submit->message) == true - ) { - include '../views/contact.view.php'; - return; - } - - if ((bool) $spam == true) { - error_log('Contact Form Spam: Error 403'); - return http_response_code(403); - } - - if ($validEmail === false ) { - $emailError = 'Invalid email: ' . "\r" . ''. $submit->email . ''; - include '../views/contact.view.php'; - return; - } - - $formSuccess = true; - - $name = null; - $email = null; - $message = null; - $spam = false; - - include '../views/contact.view.php'; - fastcgi_finish_request(); - - $contact['database']->insert( - 'contactform', [ - 'name' => $submit->name, - 'email' => $submit->email, - 'message' => $submit->message, - ] - ); - - return sendMail($submit->name, $submit->email, $submit->message); -} - -require '../views/contact.view.php'; diff --git a/controllers/index.controller.php b/controllers/index.controller.php deleted file mode 100644 index a4fa714..0000000 --- a/controllers/index.controller.php +++ /dev/null @@ -1,3 +0,0 @@ -" }} +{{ safeHTML "" }} diff --git a/generators/hugo/themes/edwin/layouts/partials/header.html b/generators/hugo/themes/edwin/layouts/partials/header.html index 8e8a798..a93da0f 100644 --- a/generators/hugo/themes/edwin/layouts/partials/header.html +++ b/generators/hugo/themes/edwin/layouts/partials/header.html @@ -8,4 +8,4 @@ {{- block "title" . }}{{ partial "title.html" . -}}{{- end }} - {{ safeHTML "" }} + {{ safeHTML "" }} diff --git a/generators/hugo/themes/edwin/layouts/partials/navigator.html b/generators/hugo/themes/edwin/layouts/partials/navigator.html index dfb8d4c..1b1829c 100644 --- a/generators/hugo/themes/edwin/layouts/partials/navigator.html +++ b/generators/hugo/themes/edwin/layouts/partials/navigator.html @@ -1 +1 @@ -{{ safeHTML "" }} +{{ safeHTML "" }} diff --git a/model/Form.php b/model/Form.php deleted file mode 100644 index d7cd5d9..0000000 --- a/model/Form.php +++ /dev/null @@ -1,9 +0,0 @@ -requestContains($route) - ) { - return 'link-active text-black '; - } - return; - } -} diff --git a/public/css/app.css b/public/css/app.css deleted file mode 100644 index 2a57771..0000000 --- a/public/css/app.css +++ /dev/null @@ -1,39 +0,0 @@ -.bg--white--light { background-color: #f3f3f3 } - -.max-w-xl { max-width: 88rem; } - -.logo-container { background-image: url(/images/crisp-paper-ruffles.png); } - -.link-active { border-bottom: 2px solid #85BDBF; } - -.footer-icons svg { color: #444; } - -nav svg { display: inline; } - -button, input, optgroup, select, textarea { line-height: initial; } - -.checkbox-agree { display: none; } - -.feather-download { color: #222; } - -.feather-download:hover { color: #3490dc; } - -.comment-post-odd { background-color: #f6f6f6 !important; } - -.hashover-message { display: none; } -.hashover-message-error { display: block; } - -@media screen and (max-width: 392px) { nav p { font-size: 0.6916em } } - -.journal-post a { - text-decoration: none; - border-bottom: 2px solid #a8c2cc; - padding-bottom: 2px; - color: #12283a; -} - -.splash-container { - background-image: url(/images/abstract-mix.jpg); - background-repeat: repeat; - min-height: 12rem; -} diff --git a/public/dist/app.css b/public/dist/app.css new file mode 100644 index 0000000..2a57771 --- /dev/null +++ b/public/dist/app.css @@ -0,0 +1,39 @@ +.bg--white--light { background-color: #f3f3f3 } + +.max-w-xl { max-width: 88rem; } + +.logo-container { background-image: url(/images/crisp-paper-ruffles.png); } + +.link-active { border-bottom: 2px solid #85BDBF; } + +.footer-icons svg { color: #444; } + +nav svg { display: inline; } + +button, input, optgroup, select, textarea { line-height: initial; } + +.checkbox-agree { display: none; } + +.feather-download { color: #222; } + +.feather-download:hover { color: #3490dc; } + +.comment-post-odd { background-color: #f6f6f6 !important; } + +.hashover-message { display: none; } +.hashover-message-error { display: block; } + +@media screen and (max-width: 392px) { nav p { font-size: 0.6916em } } + +.journal-post a { + text-decoration: none; + border-bottom: 2px solid #a8c2cc; + padding-bottom: 2px; + color: #12283a; +} + +.splash-container { + background-image: url(/images/abstract-mix.jpg); + background-repeat: repeat; + min-height: 12rem; +} diff --git a/public/index.php b/public/index.php index 4f61001..0311f71 100644 --- a/public/index.php +++ b/public/index.php @@ -1,8 +1,6 @@ direct(Request::uri(), Request::method()); diff --git a/public/js/app.js b/public/js/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/views/about.view.php b/views/about.view.php deleted file mode 100644 index ae28201..0000000 --- a/views/about.view.php +++ /dev/null @@ -1,7 +0,0 @@ - - -

- Edwin is a voiceover artist specializing in low to mid-range voiceovers. -

- - diff --git a/views/components/AudioPlayer.php b/views/components/AudioPlayer.php deleted file mode 100644 index d3ba487..0000000 --- a/views/components/AudioPlayer.php +++ /dev/null @@ -1,51 +0,0 @@ -
- -
- -
- -
- -
- -
-
-
0:00
-
-
-
-
-
-
-
0:00
-
-
- -
- -
-
- - volume -
-
- - - - - -
- -
- -
- -
- -
- -
diff --git a/views/contact.view.php b/views/contact.view.php deleted file mode 100644 index 4b4da41..0000000 --- a/views/contact.view.php +++ /dev/null @@ -1,88 +0,0 @@ - - - - -
- - -
-

Contact

-

- Interested in collaborating together? - Send a message by using the form below. -

-
- -
-
- -
- - - - - -
- -
- - - - - - -

- - -
- -
-
-
- - -
-
- -
- -
- - - -
- - diff --git a/views/index.view.php b/views/index.view.php deleted file mode 100644 index 29f17b4..0000000 --- a/views/index.view.php +++ /dev/null @@ -1,89 +0,0 @@ - - -

Let's bring a story to life

- -

- Strong voice for narration, trailers, storytelling, and more. -

- -

Prologue

- -

- Focused introductory elements for literary, dramatic, and musical arts. -

- - - - - - - -

Narrative

- -

- Spoken or written accounts of connected events. -

- - - - - - - -

Dramatic

- -

- Sudden and striking narrative elements. -

- - - - - - - -

Commercial

- -

- Old school narrative commercial style. -

- - - - - - - - diff --git a/views/partials/footer.php b/views/partials/footer.php deleted file mode 100644 index e2f2a6b..0000000 --- a/views/partials/footer.php +++ /dev/null @@ -1,26 +0,0 @@ -
-
- -
-
-

- - Email - -

-

© Copyright . Edwin Mattiacci Voiceover

-
-
- -
-
- - - -
- - - - - - diff --git a/views/partials/header.common.php b/views/partials/header.common.php deleted file mode 100644 index 4ea98df..0000000 --- a/views/partials/header.common.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/views/partials/header.error.php b/views/partials/header.error.php deleted file mode 100644 index 2aa019a..0000000 --- a/views/partials/header.error.php +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/views/partials/header.php b/views/partials/header.php deleted file mode 100644 index 6ddabcc..0000000 --- a/views/partials/header.php +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - Edwin Mattiacci - <?php title();?> - - - - - - - - - - - - -
- - - -
- -
- -
- -
-
- -
-
- -
- -
diff --git a/views/partials/navigator.links.php b/views/partials/navigator.links.php deleted file mode 100644 index f023e32..0000000 --- a/views/partials/navigator.links.php +++ /dev/null @@ -1,5 +0,0 @@ - -Home -Posts -Feedback -Contact diff --git a/views/partials/navigator.php b/views/partials/navigator.php deleted file mode 100644 index 78bb138..0000000 --- a/views/partials/navigator.php +++ /dev/null @@ -1,79 +0,0 @@ - - diff --git a/views/wall.view.php b/views/wall.view.php deleted file mode 100644 index 0635325..0000000 --- a/views/wall.view.php +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - -- cgit v1.2.3