mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
First public release of MyAAC
This commit is contained in:
28
system/pages/custom.php
Normal file
28
system/pages/custom.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Custom pages loader
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Slawkens <slawkens@gmail.com>
|
||||
* @copyright 2017 MyAAC
|
||||
* @version 0.0.1
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$query = $db->query('SELECT `title`, `body`, `php` FROM `' . TABLE_PREFIX . 'pages` WHERE `name` LIKE ' . $db->quote($page) . ' AND `hidden` != 1');
|
||||
if($query->rowCount() > 0) // found page
|
||||
{
|
||||
$query = $query->fetch();
|
||||
$title = $query['title'];
|
||||
|
||||
if($query['php'] == '1') // execute it as php code
|
||||
eval($query['body']);
|
||||
else
|
||||
echo $query['body']; // plain html
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
?>
|
Reference in New Issue
Block a user