Skip to content

Commit

Permalink
Add promo page (#73)
Browse files Browse the repository at this point in the history
* feat: Add support for pub mode

* chore: add promo page for WiiLink
  • Loading branch information
Repflez authored May 11, 2024
1 parent d619725 commit da994af
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
'3ds' => ['3ds.example.com', '3ds.example2.com'],
'wiiu' => [],
'web' => [],
'pub' => [],
'admin' => [],
],

Expand Down
3 changes: 3 additions & 0 deletions core.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
} else if (in_array($siteUrl, config('sites.admin'))) {
$template = 'admin';
require_once path('routes/admin.php');
} else if (in_array($siteUrl, config('sites.pub'))) {
$template = 'pub';
require_once path('routes/pub.php');
} else {
require_once path('routes/default.php');
}
Expand Down
Binary file added public/img/promo/rverse_logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions resources/views/pub/wiilink.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>rverse on WiiLink</title>
<style type="text/css">
body {
background-color: #06038d;
color: #dedede;
}
</style>
</head>
<body>
<img src="/img/promo/rverse_logo.jpg">
<br />
rverse is a recreation of Miiverse on your 3DS,<br />and soon on your Wii U!
<br />
<br />
Connect with other people in a familiar yet<br />nostalgic envrionment.
<br />
<br />
Or do you want to show the world the artist<br />you are? You can!
<br />
<br />
<br />
Here is a sampler of art posts that people<br />have made on rverse!<br /><small>(Taken at random from our art community)</small>
<br />
<br />
<br />
{% for post in posts %}
<img src="/img/drawings/{{ post.image }}">
<br />
{% endfor %}
<br />
<br />
Visit our Discord server at https://discord.gg/rverse
</body>
</html>
14 changes: 14 additions & 0 deletions routes/pub.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/*
* Router paths
*/

// Define namespace
namespace Miiverse;

// Checks

Router::group([], function() {
// Homepage
Router::get('/wiilink', 'Pub.WiiLink@index', 'wiilink.promo');
});
17 changes: 17 additions & 0 deletions src/Pages/Pub/Page.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* Holds the base page for titles.
*/

namespace Miiverse\Pages\Pub;

use Miiverse\Pages\Page as BasePage;

/**
* Base titles controller (which other controllers should extend on).
*
* @author RverseTeam
*/
class Page extends BasePage
{
}
28 changes: 28 additions & 0 deletions src/Pages/Pub/WiiLink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* Holds the WiiLink Promo page.
*/

namespace Miiverse\Pages\Pub;

use Miiverse\DB;

/**
* WiiLink promo page controller
*
* @author RverseTeam
*/
class WiiLink extends Page
{
public function index() : string
{
// TODO: Set this on config and get user data
$posts = DB::table('posts')
->where('community', 16)
->inRandomOrder()
->limit(5)
->get(['image']);

return view('wiilink', compact('posts'));
}
}

0 comments on commit da994af

Please sign in to comment.