2013-06-15 08:00:45 +00:00
|
|
|
<?
|
|
|
|
$PerPage = POSTS_PER_PAGE;
|
|
|
|
list($Page, $Limit) = Format::page_limit($PerPage);
|
|
|
|
|
|
|
|
$CanEdit = check_perms('users_mod');
|
|
|
|
|
|
|
|
if ($CanEdit && isset($_POST['perform'])) {
|
|
|
|
authorize();
|
|
|
|
if ($_POST['perform'] == 'add' && !empty($_POST['message'])) {
|
|
|
|
$Message = db_string($_POST['message']);
|
|
|
|
$Author = db_string($_POST['author']);
|
|
|
|
$DB->query("
|
|
|
|
INSERT INTO changelog (Message, Author, Time)
|
|
|
|
VALUES ('$Message', '$Author', NOW())");
|
2013-07-28 08:00:53 +00:00
|
|
|
$ID = $DB->inserted_id();
|
|
|
|
SiteHistory::add_event(sqltime(), "Changelog $ID", "tools.php?action=change_log", 1, 3, "", $Message, $LoggedUser['ID']);
|
|
|
|
|
2013-06-15 08:00:45 +00:00
|
|
|
}
|
|
|
|
if ($_POST['perform'] == 'remove' && !empty($_POST['change_id'])) {
|
|
|
|
$ID = (int) $_POST['change_id'];
|
|
|
|
$DB->query("
|
|
|
|
DELETE FROM changelog
|
|
|
|
WHERE ID = '$ID'");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$DB->query("
|
|
|
|
SELECT
|
|
|
|
SQL_CALC_FOUND_ROWS
|
|
|
|
ID,
|
|
|
|
Message,
|
|
|
|
Author,
|
|
|
|
Date(Time) as Time
|
|
|
|
FROM changelog
|
|
|
|
ORDER BY ID DESC
|
|
|
|
LIMIT $Limit");
|
|
|
|
$ChangeLog = $DB->to_array();
|
|
|
|
$DB->query('SELECT FOUND_ROWS()');
|
|
|
|
list($NumResults) = $DB->next_record();
|
|
|
|
|
|
|
|
View::show_header('Gazelle Change Log');
|
|
|
|
?>
|
|
|
|
<div class="thin">
|
|
|
|
<h2>Gazelle Change Log</h2>
|
|
|
|
<div class="linkbox">
|
|
|
|
<?
|
|
|
|
$Pages = Format::get_pages($Page, $NumResults, $PerPage, 11);
|
|
|
|
echo "\t\t$Pages\n";
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
<? if ($CanEdit) { ?>
|
2013-06-17 08:01:02 +00:00
|
|
|
<div class="box box2 edit_changelog">
|
2013-06-16 08:01:11 +00:00
|
|
|
<div class="head">
|
|
|
|
<strong>Manually submit a new change to the change log</strong>
|
|
|
|
</div>
|
|
|
|
<div class="pad">
|
|
|
|
<form method="post">
|
|
|
|
<input type="hidden" name="perform" value="add" />
|
|
|
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
|
|
|
<div class="field_div" id="cl_message">
|
|
|
|
<span class="label">Commit message:</span><br />
|
|
|
|
<textarea name="message" /></textarea>
|
|
|
|
</div>
|
|
|
|
<div class="field_div" id="cl_author">
|
|
|
|
<span class="label">Author:</span><br />
|
|
|
|
<input type="text" name="author" value="<?=$LoggedUser['Username']?>" />
|
2013-06-15 08:00:45 +00:00
|
|
|
</div>
|
2013-06-16 08:01:11 +00:00
|
|
|
<div class="submit_div" id="cl_submit">
|
2013-06-15 08:00:45 +00:00
|
|
|
<input type="submit" value="Submit" />
|
|
|
|
</div>
|
2013-06-16 08:01:11 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-06-15 08:00:45 +00:00
|
|
|
<? }
|
|
|
|
|
|
|
|
foreach ($ChangeLog as $Change) { ?>
|
2013-06-17 08:01:02 +00:00
|
|
|
<div class="box box2">
|
2013-06-16 08:01:11 +00:00
|
|
|
<div class="head">
|
|
|
|
<span><?=$Change['Time']?> by <?=$Change['Author']?></span>
|
2013-06-15 08:00:45 +00:00
|
|
|
<? if ($CanEdit) { ?>
|
2013-06-16 08:01:11 +00:00
|
|
|
<span style="float: right;">
|
|
|
|
<form id="delete_<?=$Change['ID']?>" method="POST">
|
|
|
|
<input type="hidden" name="perform" value="remove" />
|
|
|
|
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
|
|
|
<input type="hidden" name="change_id" value="<?=$Change['ID']?>" />
|
|
|
|
</form>
|
|
|
|
<a href="#" onclick="$('#delete_<?=$Change['ID']?>').raw().submit(); return false;" class="brackets">Delete</a>
|
|
|
|
</span>
|
2013-06-15 08:00:45 +00:00
|
|
|
<? } ?>
|
|
|
|
</div>
|
2013-06-16 08:01:11 +00:00
|
|
|
<div class="pad">
|
|
|
|
<?=$Change['Message']?>
|
|
|
|
</div>
|
2013-06-15 08:00:45 +00:00
|
|
|
</div>
|
2013-06-16 08:01:11 +00:00
|
|
|
<? } ?>
|
2013-06-15 08:00:45 +00:00
|
|
|
</div>
|
|
|
|
<? View::show_footer(); ?>
|