diff --git a/.gitignore b/.gitignore index d0ab042..f600f1b 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ kanga.world/composer.json kanga.world/index.php kanga.world/site/config/config.php kanga.world/content/home/*/ +kanga.world/content/1_home/*/ diff --git a/kanga.world/assets/css/main.css b/kanga.world/assets/css/main.css index cab49f2..540a412 100644 --- a/kanga.world/assets/css/main.css +++ b/kanga.world/assets/css/main.css @@ -1,4 +1,7 @@ -a:link:not(.dropdown-item), a:visited:not(.dropdown-item), a:hover:not(.dropdown-item), a:active:not(.dropdown-item) { +a:link:not(.dropdown-item):not(.nav-link), +a:visited:not(.dropdown-item):not(.nav-link), +a:hover:not(.dropdown-item):not(.nav-link), +a:active:not(.dropdown-item):not(.nav-link) { color: #ff0000; } diff --git a/kanga.world/content/home/comingsoon.png b/kanga.world/content/1_home/comingsoon.png similarity index 100% rename from kanga.world/content/home/comingsoon.png rename to kanga.world/content/1_home/comingsoon.png diff --git a/kanga.world/content/home/comingsoon.png.txt b/kanga.world/content/1_home/comingsoon.png.txt similarity index 100% rename from kanga.world/content/home/comingsoon.png.txt rename to kanga.world/content/1_home/comingsoon.png.txt diff --git a/kanga.world/content/home/home.txt b/kanga.world/content/1_home/home.txt similarity index 100% rename from kanga.world/content/home/home.txt rename to kanga.world/content/1_home/home.txt diff --git a/kanga.world/content/home/kanga-original.png b/kanga.world/content/1_home/kanga-original.png similarity index 100% rename from kanga.world/content/home/kanga-original.png rename to kanga.world/content/1_home/kanga-original.png diff --git a/kanga.world/content/home/kanga-original.png.txt b/kanga.world/content/1_home/kanga-original.png.txt similarity index 100% rename from kanga.world/content/home/kanga-original.png.txt rename to kanga.world/content/1_home/kanga-original.png.txt diff --git a/kanga.world/content/home/kangaworld.png b/kanga.world/content/1_home/kangaworld.png similarity index 100% rename from kanga.world/content/home/kangaworld.png rename to kanga.world/content/1_home/kangaworld.png diff --git a/kanga.world/content/home/kangaworld.png.txt b/kanga.world/content/1_home/kangaworld.png.txt similarity index 100% rename from kanga.world/content/home/kangaworld.png.txt rename to kanga.world/content/1_home/kangaworld.png.txt diff --git a/kanga.world/content/home/kangaworldlogo.png b/kanga.world/content/1_home/kangaworldlogo.png similarity index 100% rename from kanga.world/content/home/kangaworldlogo.png rename to kanga.world/content/1_home/kangaworldlogo.png diff --git a/kanga.world/content/home/onlinegamingnetwork.png b/kanga.world/content/1_home/onlinegamingnetwork.png similarity index 100% rename from kanga.world/content/home/onlinegamingnetwork.png rename to kanga.world/content/1_home/onlinegamingnetwork.png diff --git a/kanga.world/content/home/onlinegamingnetwork.png.txt b/kanga.world/content/1_home/onlinegamingnetwork.png.txt similarity index 100% rename from kanga.world/content/home/onlinegamingnetwork.png.txt rename to kanga.world/content/1_home/onlinegamingnetwork.png.txt diff --git a/kanga.world/content/activated/activated.txt b/kanga.world/content/activated/activated.txt new file mode 100644 index 0000000..1976e59 --- /dev/null +++ b/kanga.world/content/activated/activated.txt @@ -0,0 +1,5 @@ +Title: Activation Complete! + +---- + +Text: Your account is now active! Please login. diff --git a/kanga.world/content/newuser/newuser.txt b/kanga.world/content/newuser/newuser.txt new file mode 100644 index 0000000..8a98cb1 --- /dev/null +++ b/kanga.world/content/newuser/newuser.txt @@ -0,0 +1,5 @@ +Title: New User + +---- + +Text: Check your email for an activation link. \ No newline at end of file diff --git a/kanga.world/content/user/user.txt b/kanga.world/content/user/user.txt index ab1d601..8e9603c 100644 --- a/kanga.world/content/user/user.txt +++ b/kanga.world/content/user/user.txt @@ -1,4 +1,4 @@ -Title: User Settings +Title: Profile ---- @@ -26,9 +26,8 @@ Danger: Danger Zone ---- -Delete_Button: Delete Account +Delete-button: Delete Account ---- -Delete_Warning: Are you sure? This action cannot be reversed! - +Delete-warning: Are you sure? This action cannot be reversed! \ No newline at end of file diff --git a/kanga.world/site/blueprints/pages/activated.yml b/kanga.world/site/blueprints/pages/activated.yml new file mode 100644 index 0000000..9ec00f5 --- /dev/null +++ b/kanga.world/site/blueprints/pages/activated.yml @@ -0,0 +1,7 @@ +title: Avtivated User Landing Page +preset: page +fields: + text: + label: Text + type: textarea + size: large diff --git a/kanga.world/site/blueprints/pages/newuser.yml b/kanga.world/site/blueprints/pages/newuser.yml new file mode 100644 index 0000000..65b94b7 --- /dev/null +++ b/kanga.world/site/blueprints/pages/newuser.yml @@ -0,0 +1,7 @@ +title: New User Landing Page +preset: page +fields: + text: + label: Text + type: textarea + size: large diff --git a/kanga.world/site/config/config.php.example b/kanga.world/site/config/config.php.example index 57705e3..071a226 100644 --- a/kanga.world/site/config/config.php.example +++ b/kanga.world/site/config/config.php.example @@ -67,8 +67,8 @@ return [ if ($user = $kirby->users()->findBy('emailActivationToken', $token)) { if ($user->emailActivationToken()->toString() === Str::toType($token, 'string')) { $user->update(['emailActivation' => true]); - go('user'); - //go('CUSTOM_SUCCESSFUL_ACTIVATION_PAGE'); + $kirby->session()->set('kpActivated', true); + go('/activated'); } else { return false; //go('CUSTOM_ERROR_ACTIVATION_PAGE'); diff --git a/kanga.world/site/controllers/register.php b/kanga.world/site/controllers/register.php index 6b6a972..e724af1 100644 --- a/kanga.world/site/controllers/register.php +++ b/kanga.world/site/controllers/register.php @@ -4,8 +4,8 @@ return function ($kirby) { if($kirby->user()) { go('/'); - } - + } + $error = null; $alert = null; @@ -53,14 +53,14 @@ return function ($kirby) { // CHECK EMAIL ACTIVATION if (option('user.email.activation', false) === true) { - + $user->update([ 'emailActivation' => false, 'emailActivationToken' => $token ]); } - $kirby->impersonate(); + $kirby->impersonate(); } catch(Exception $e) { @@ -93,19 +93,18 @@ return function ($kirby) { ]); } - // LOGIN USER - if($user->login($data['password'])) { - go(); - } - + // Welcome new user. + $kirby->session()->set('kpNewUser', true); + go('/newuser'); + $data = []; } } }; - + return [ 'error' => $error, 'alert' => $alert, 'data' => $data ?? false ]; -}; \ No newline at end of file +}; diff --git a/kanga.world/site/plugins/download-kirbytag/index.php b/kanga.world/site/plugins/download-kirbytag/index.php index 1a21008..6e1c78a 100644 --- a/kanga.world/site/plugins/download-kirbytag/index.php +++ b/kanga.world/site/plugins/download-kirbytag/index.php @@ -7,23 +7,30 @@ Kirby::plugin('kangaroopunch/download-kirbytag', [ [ 'pattern' => 'download/(:any)/(:any)', 'action' => function($sourcepage, $filerequested) { - // Unmuddle the page ID that called us. - $slug = str_rot13(urldecode($sourcepage)); - $slug = str_replace('|', '/', $slug); - // Get page object. - $page = kirby()->api()->page($slug); - // Find the current download count. - $file = $page->file($filerequested); - $content = $file->content(); - if ($content->has('downloads')) { - $count = $content->get('downloads')->toInt(); - } else { - // Initialize counter. - $count = 0; + $file = ""; + kirby()->impersonate('kirby'); + try { + // Unmuddle the page ID that called us. + $slug = str_rot13(urldecode($sourcepage)); + $slug = str_replace('|', '/', $slug); + // Get page object. + $page = kirby()->api()->page($slug); + // Find the current download count. + $file = $page->file($filerequested); + $content = $file->content(); + if ($content->has('downloads')) { + $count = $content->get('downloads')->toInt(); + } else { + // Initialize counter. + $count = 0; + } + // Update download count. + $count++; + $file->update([ 'downloads' => $count ]); + } catch (Exception $ex){ + $file = $ex->getMessage(); } - // Update download count. - $count++; - $file->update([ 'downloads' => $count ]); + kirby()->impersonate(); // Send file to user. return $file; } @@ -37,39 +44,45 @@ Kirby::plugin('kangaroopunch/download-kirbytag', [ 'desc' ], 'html' => function($tag) { - // Did we get a valid file? - $file = $tag->file($tag->value()); - if (!$file === true) { - return '
diff --git a/kanga.world/site/templates/activated.php b/kanga.world/site/templates/activated.php new file mode 100644 index 0000000..d52d309 --- /dev/null +++ b/kanga.world/site/templates/activated.php @@ -0,0 +1,12 @@ +session()->get('kpActivated') !== true) { + go('/'); + } + + $kirby->session()->remove('kpActivated'); + snippet('header'); +?> + += $page->text()->kirbytext() ?> + + diff --git a/kanga.world/site/templates/newuser.php b/kanga.world/site/templates/newuser.php new file mode 100644 index 0000000..473dd67 --- /dev/null +++ b/kanga.world/site/templates/newuser.php @@ -0,0 +1,12 @@ +session()->get('kpNewUser') !== true) { + go('/'); + } + + $kirby->session()->remove('kpNewUser'); + snippet('header'); +?> + += $page->text()->kirbytext() ?> + +