Add get_icon() (issue #2)
This commit is contained in:
parent
7fa0c00cda
commit
ac90969eec
BIN
database.mwb
BIN
database.mwb
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);
|
||||
}
|
||||
|
9
public/contact.php
Normal file
9
public/contact.php
Normal 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
|
Loading…
x
Reference in New Issue
Block a user