1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-24 05:03:00 +00:00
Pepperminty-Wiki/modules/page-credits.php

100 lines
4 KiB
PHP
Raw Normal View History

2015-09-19 09:19:56 +00:00
<?php
register_module([
"name" => "Credits",
"version" => "0.7.1",
2015-09-19 09:19:56 +00:00
"author" => "Starbeamrainbowlabs",
"description" => "Adds the credits page. You *must* have this module :D",
"id" => "page-credits",
"code" => function() {
/*
* ██████ ██████ ███████ ██████ ██ ████████ ███████
* ██ ██ ██ ██ ██ ██ ██ ██ ██
* ██ ██████ █████ ██ ██ ██ ██ ███████
* ██ ██ ██ ██ ██ ██ ██ ██ ██
* ██████ ██ ██ ███████ ██████ ██ ██ ███████
*/
2015-09-19 09:19:56 +00:00
add_action("credits", function() {
global $settings, $version, $pageindex, $modules;
$credits = [
"Code" => [
"author" => "Starbeamrainbowlabs",
"author_url" => "https://starbeamrmainbowlabs.com/",
2016-03-21 19:23:14 +00:00
"thing_url" => "https://github.com/sbrl/Pepprminty-Wiki",
"icon" => "https://avatars0.githubusercontent.com/u/9929737?v=3&s=24"
2015-09-19 09:19:56 +00:00
],
"Slightly modified version of Slimdown" => [
"author" => "Johnny Broadway",
"author_url" => "https://github.com/jbroadway",
2016-03-21 19:23:14 +00:00
"thing_url" => "https://gist.github.com/jbroadway/2836900",
"icon" => "https://avatars2.githubusercontent.com/u/87886?v=3&s=24"
2015-09-19 09:19:56 +00:00
],
"Default Favicon" => [
"author" => "bluefrog23",
"author_url" => "https://openclipart.org/user-detail/bluefrog23/",
"thing_url" => "https://openclipart.org/detail/19571/peppermint-candy-by-bluefrog23"
],
"Bug Reports" => [
"author" => "nibreh",
"author_url" => "https://github.com/nibreh/",
2016-03-21 19:23:14 +00:00
"thing_url" => "",
"icon" => "https://avatars2.githubusercontent.com/u/7314006?v=3&s=24"
2015-09-19 09:19:56 +00:00
]
];
//// Credits html renderer ////
2015-09-19 09:19:56 +00:00
$credits_html = "<ul>\n";
foreach($credits as $thing => $author_details)
{
$credits_html .= " <li>";
$credits_html .= "<a href='" . $author_details["thing_url"] . "'>$thing</a> by ";
2016-03-21 19:23:14 +00:00
if(isset($author_details["icon"]))
$credits_html .= "<img style='vertical-align: middle;' src='" . $author_details["icon"] . "' /> ";
2015-09-19 09:19:56 +00:00
$credits_html .= "<a href='" . $author_details["author_url"] . "'>" . $author_details["author"] . "</a>";
$credits_html .= "</li>\n";
}
$credits_html .= "</ul>";
///////////////////////////////
//// Module html renderer ////
$modules_html = "<table>
<tr>
<th>Name</th>
<th>Version</th>
<th>Author</th>
<th>Description</th>
</tr>";
foreach($modules as $module)
{
$modules_html .= " <tr>
<td title='" . $module["id"] . "'>" . $module["name"] . "</td>
<td>" . $module["version"] . "</td>
<td>" . $module["author"] . "</td>
<td>" . $module["description"] . "</td>
</tr>\n";
}
$modules_html .= "</table>";
//////////////////////////////
2015-09-19 09:19:56 +00:00
$title = "Credits - $settings->sitename";
$content = "<h1>$settings->sitename credits</h1>
<p>$settings->sitename is powered by Pepperminty Wiki - an entire wiki packed inside a single file, which was built by <a href='//starbeamrainbowlabs.com'>Starbeamrainbowlabs</a>, and can be found <a href='//github.com/sbrl/Pepperminty-Wiki/'>on GitHub</a> (contributors will ablso be listed here in the future).</p>
<h2>Main Credits</h2>
$credits_html
<h2>Site status</h2>
<table>
<tr><th>Site name:</th><td>$settings->sitename (<a href='?action=update'>$settings->admindisplaychar Update</a>, <a href='?action=export'>Export as zip - Check for permission first</a>)</td></tr>
2015-09-19 09:19:56 +00:00
<tr><th>Pepperminty Wiki version:</th><td>$version</td></tr>
<tr><th>Number of pages:</th><td>" . count(get_object_vars($pageindex)) . "</td></tr>
<tr><th>Number of modules:</th><td>" . count($modules) . "</td></tr>
</table>
<h2>Installed Modules</h2>
$modules_html";
2015-09-19 09:19:56 +00:00
exit(page_renderer::render_main($title, $content));
});
}
]);
?>