Add get_icon() (issue #2)

This commit is contained in:
Skylar Ittner 2018-04-21 18:21:18 -06:00
parent 7fa0c00cda
commit ac90969eec
3 changed files with 26 additions and 0 deletions

Binary file not shown.

View File

@ -84,6 +84,23 @@ function get_component($name, $context = null, $echo = true) {
} }
} }
function get_icon($name, $context = null, $echo = true) {
$db = getdatabase();
if ($context == null) {
$context = get_page_slug(false);
}
$pageid = $db->get("pages", "pageid", ["AND" => ["slug" => $context, "siteid" => getsiteid()]]);
$content = "";
if ($db->has("icons", ["AND" => ["pageid" => $pageid, "name" => $name]])) {
$content = $db->get("icons", "content", ["AND" => ["pageid" => $pageid, "name" => $name]]);
}
if ($echo) {
echo $content;
} else {
return $content;
}
}
function get_page_content($slug = null) { function get_page_content($slug = null) {
get_component("content", $slug); get_component("content", $slug);
} }

9
public/contact.php Normal file
View File

@ -0,0 +1,9 @@
<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// TODO: Add contact form receiving script