Allow static pages to contain iframe elements. This is necessary for twitch embedding.
Allow static pages to contain iframe elements. This is necessary for twitch embedding.

File last commit:

c1e4c31f199d
293d44211c32
Show More
rss-adminlog.php
36 lines | 1.7 KiB | text/x-php | XmlPhpLexer
/ rss-adminlog.php
Add most necessary files for admin interface.
r1 <?php
require_once('include/admin.inc.php');
auth_basic();
$count = isset($_REQUEST['count']) && ctype_digit($_REQUEST['count']) ? $_REQUEST['count'] : 25;
$entries = $mtdb->getAll("SELECT UNIX_TIMESTAMP(l.logdate) AS logdate, c.name AS cname, c.email AS cmail, s.name AS section, action, level, message FROM admin_log l JOIN admin_section s ON l.section = s.id LEFT JOIN contributor c ON l.contributor = c.id ORDER BY l.logdate DESC LIMIT $count");
header("Content-Type: application/rss+xml;charset=utf-8");
echo "<?xml version=\"1.0\" ?>\n";
?>
<rss version="2.0">
<channel>
<title>Megatokyo Admin Log</title>
<link>http://www.megatokyo.com/admin</link>
<description>Listing of administrative events: errors, warnings, and notifications.</description>
<language>en-us</language>
<?php foreach($entries as $k=>$v) { ?>
<item>
<title><?php echo htmlentities($v->message, ENT_COMPAT, 'UTF-8') ?></title>
<author><?php printf('%s (%s)', $v->cmail, $v->cname) ?></author>
<pubDate><?php echo date( DATE_RFC822, $v->logdate ) ?></pubDate>
<guid><?php printf('%s%s/%s/view-adminlog.php?timestamp=%d', SITE_HOST, SITE_PATH, SITE_ADMIN, $v->logdate) ?></guid>
<category domain="<?php printf('%s%s/%s/log-levels', SITE_HOST, SITE_PATH, SITE_ADMIN) ?>"><?php echo $v->level ?></category>
<category domain="<?php printf('%s%s/%s/log-section', SITE_HOST, STE_PATH, SITE_ADMIN) ?>"><?php echo $v->section ?></category>
<category domain="<?php printf('%s%s/%s/log-acion', SITE_HOST, SITE_PATH, SITE_ADMIN) ?>"><?php echo $v->action ?></category>
<description><?php echo htmlentities($v->message, ENT_COMPAT, 'UTF-8') ?></description>
</item>
<?php } ?>
</channel>
</rss>