Add get_icon() (issue #2)

master
Skylar Ittner 6 years ago
parent 7fa0c00cda
commit ac90969eec

Binary file not shown.

@ -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) {
get_component("content", $slug);
}

@ -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
Loading…
Cancel
Save