diff --git a/Changelog b/Changelog
index 266eeccb6..8ca83fba0 100755
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,5 @@
+2018-04-08 DariusIII
+ * Chg: Add ContentController and route
2018-04-07 DariusIII
* Chg: Add BtcPaymentController
* Chg: Update libraries to their latest versions
diff --git a/app/Http/Controllers/ContentController.php b/app/Http/Controllers/ContentController.php
new file mode 100644
index 000000000..bd90c3d31
--- /dev/null
+++ b/app/Http/Controllers/ContentController.php
@@ -0,0 +1,82 @@
+userdata) && Auth::check()) {
+ $role = $this->userdata['role'];
+ }
+
+ /* The role column in the content table values are :
+ * 1 = logged in users
+ * 2 = admins
+ *
+ * The user role values are:
+ * 1 = user
+ * 2 = admin
+ * 3 = disabled
+ * 4 = moderator
+ *
+ * Admins and mods should be the only ones to see admin content.
+ */
+ $this->smarty->assign('admin', (($role === 2 || $role === 4) ? 'true' : 'false'));
+
+ $contentId = 0;
+ if ($request->has('id')) {
+ $contentId = $request->input('id');
+ }
+
+ $contentPage = false;
+ if ($request->has('page')) {
+ $contentPage = $request->input('page');
+ }
+
+ if ($contentId === 0 && $contentPage === 'content') {
+ $content = $contents->getAllButFront();
+ $this->smarty->assign('front', false);
+ $meta_title = 'Contents page';
+ $meta_keywords = 'contents';
+ $meta_description = 'This is the contents page.';
+ } elseif ($contentId !== 0 && $contentPage !== false) {
+ $content = [$contents->getByID($contentId, $role)];
+ $this->smarty->assign('front', false);
+ $meta_title = 'Contents page';
+ $meta_keywords = 'contents';
+ $meta_description = 'This is the contents page.';
+ } else {
+ $content = $contents->getFrontPage();
+ $index = $contents->getIndex();
+ $this->smarty->assign('front', true);
+ $meta_title = $index->title;
+ $meta_keywords = $index->metakeywords;
+ $meta_description = $index->metadescription;
+ }
+
+ if (empty($content)) {
+ $this->show404();
+ }
+
+ $this->smarty->assign('content', $content);
+
+ $content = $this->smarty->fetch('content.tpl');
+ $this->smarty->assign(
+ [
+ 'content' => $content,
+ 'meta_title' => $meta_title,
+ 'meta_keywords' => $meta_keywords,
+ 'meta_description' => $meta_description,
+ ]
+ );
+ $this->pagerender();
+ }
+}
diff --git a/public/pages/contact-us.php b/public/pages/contact-us.php
deleted file mode 100644
index 9c9f5d996..000000000
--- a/public/pages/contact-us.php
+++ /dev/null
@@ -1,36 +0,0 @@
-getError() === false && request()->has('useremail')) {
- $email = request()->input('useremail');
- $mailTo = Settings::settingValue('site.main.email');
- $mailBody = "Values submitted from contact form:\n";
- $request = request()->all();
-
- foreach ($request as $key => $value) {
- if ($key !== 'submit') {
- $mailBody .= "$key : $value
\r\n";
- }
- }
-
- if (! preg_match("/\n/i", request()->input('useremail'))) {
- Mail::to($mailTo)->send(new ContactUs($email, $mailBody));
- }
- $msg = "