myaac/system/pages/admin/changelog.php
Lee 876b1b988a Code clean up + datatables (#64)
* Reformat Code

Reformat Code
- spaces + tabs

* Code cleanup

removed duplicated datatables code

* Datatables

replace spells, monsters tables with JavaScript Sortable Tables (DataTables?)
2018-12-02 06:30:36 +01:00

27 lines
654 B
PHP

<?php
/**
* CHANGELOG viewer
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC
* @link http://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'MyAAC Changelog';
if (!file_exists(BASE . 'CHANGELOG')) {
echo 'File CHANGELOG doesn\'t exist.';
return;
}
$changelog = file_get_contents(BASE . 'CHANGELOG');
$changelog = htmlspecialchars($changelog);
// replace URLs with <a href...> elements
$changelog = preg_replace('/\s(\w+:\/\/)(\S+)/', ' <a href="\\1\\2" target="_blank">\\1\\2</a>', $changelog);
$changelog = nl2br($changelog);
echo '<div>' . $changelog . '</div>';