mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 20:21:37 +00:00
Empty commit
This commit is contained in:
parent
51165f4c3d
commit
640e96bb46
@ -1,5 +1,8 @@
|
||||
CHANGELOG
|
||||
|
||||
2013-08-08 by Squiffy
|
||||
Drag and Drop ordering on the Do Not Upload page in toolbox
|
||||
|
||||
2013-08-05 by Ajax
|
||||
Search email blacklist
|
||||
|
||||
|
@ -252,6 +252,7 @@ CREATE TABLE `do_not_upload` (
|
||||
`Comment` varchar(255) COLLATE utf8_bin NOT NULL,
|
||||
`UserID` int(10) NOT NULL,
|
||||
`Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`Sequence` mediumint(8) NOT NULL,
|
||||
PRIMARY KEY (`ID`),
|
||||
KEY `Time` (`Time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
|
@ -5,7 +5,14 @@
|
||||
|
||||
authorize();
|
||||
|
||||
if ($_POST['submit'] == 'Delete') { //Delete
|
||||
if($_POST['submit'] == 'Reorder') { // Reorder
|
||||
foreach ($_POST['item'] as $Position => $Item) {
|
||||
$Position = db_string($Position);
|
||||
$Item = db_string($Item);
|
||||
$DB->query('UPDATE `do_not_upload` SET `Sequence` = ' . $Position . ' WHERE `id` = '. $Item);
|
||||
}
|
||||
|
||||
} else if ($_POST['submit'] == 'Delete') { //Delete
|
||||
if (!is_number($_POST['id']) || $_POST['id'] == '') {
|
||||
error(0);
|
||||
}
|
||||
@ -38,9 +45,9 @@
|
||||
} else { //Create
|
||||
$DB->query("
|
||||
INSERT INTO do_not_upload
|
||||
(Name, Comment, UserID, Time)
|
||||
(Name, Comment, UserID, Time, Sequence)
|
||||
VALUES
|
||||
('$P[name]','$P[comment]','$LoggedUser[ID]','".sqltime()."')");
|
||||
('$P[name]','$P[comment]','$LoggedUser[ID]','".sqltime()."', 9999)");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,68 +4,71 @@
|
||||
}
|
||||
$Title = 'Manage the "Do Not Upload" list';
|
||||
|
||||
View::show_header($Title);
|
||||
View::show_header($Title, 'jquery-ui,dnu_list');
|
||||
$DB->query("
|
||||
SELECT
|
||||
d.ID,
|
||||
d.Name,
|
||||
d.Comment,
|
||||
d.UserID,
|
||||
d.Time
|
||||
FROM do_not_upload as d
|
||||
LEFT JOIN users_main AS um ON um.ID=d.UserID
|
||||
ORDER BY d.Time DESC");
|
||||
?>
|
||||
<div class="header">
|
||||
<h2><?=($Title)?></h2>
|
||||
</div>
|
||||
<table>
|
||||
<tr class="colhead">
|
||||
<td colspan="4">Add an entry to the "Do Not Upload" list</td>
|
||||
</tr>
|
||||
<tr class="rowa">
|
||||
<form class="add_form" name="dnu" action="tools.php" method="post">
|
||||
<input type="hidden" name="action" value="dnu_alter" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<td>
|
||||
<input type="text" name="name" size="40" />
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<input type="text" name="comment" size="60" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Create" />
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<tr class="colhead">
|
||||
<td>Name</td>
|
||||
<td>Comment</td>
|
||||
<td>Added</td>
|
||||
<td>Submit</td>
|
||||
</tr>
|
||||
<? while (list($ID, $Name, $Comment, $UserID, $DNUTime) = $DB->next_record()) { ?>
|
||||
<tr>
|
||||
<form class="manage_form dnu" action="tools.php" method="post">
|
||||
<td>
|
||||
SELECT
|
||||
d.ID,
|
||||
d.Name,
|
||||
d.Comment,
|
||||
d.UserID,
|
||||
d.Time
|
||||
FROM do_not_upload as d
|
||||
LEFT JOIN users_main AS um ON um.ID=d.UserID
|
||||
ORDER BY d.Sequence");
|
||||
?>
|
||||
<div class="header">
|
||||
<h2><?=($Title)?></h2>
|
||||
<center><p>Drag and drop table rows to reorder.</p></center>
|
||||
</div>
|
||||
<table id="dnu">
|
||||
<tr class="colhead">
|
||||
<td colspan="4">Add an entry to the "Do Not Upload" list</td>
|
||||
</tr>
|
||||
<tr class="rowa">
|
||||
<form class="add_form" name="dnu" action="tools.php" method="post">
|
||||
<input type="hidden" name="action" value="dnu_alter" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="id" value="<?=$ID?>" />
|
||||
<input type="text" name="name" value="<?=display_str($Name)?>" size="40" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="comment" value="<?=display_str($Comment)?>" size="60" />
|
||||
</td>
|
||||
<td>
|
||||
<?=Users::format_username($UserID, false, false, false)?><br />
|
||||
<? echo time_diff($DNUTime, 1) . "\n"; ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="submit" value="Edit" />
|
||||
<input type="submit" name="submit" value="Delete" />
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</table>
|
||||
<? View::show_footer(); ?>
|
||||
<td>
|
||||
<input type="text" name="name" size="40" />
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<input type="text" name="comment" size="60" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Create" />
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<tr class="colhead">
|
||||
<td>Name</td>
|
||||
<td>Comment</td>
|
||||
<td>Added</td>
|
||||
<td>Submit</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
<? while (list($ID, $Name, $Comment, $UserID, $DNUTime) = $DB->next_record()) { ?>
|
||||
<tr id="item_<?=$ID?>">
|
||||
<form class="manage_form dnu" action="tools.php" method="post">
|
||||
<td>
|
||||
<input type="hidden" name="action" value="dnu_alter" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="id" value="<?=$ID?>" />
|
||||
<input type="text" name="name" value="<?=display_str($Name)?>" size="40" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="comment" value="<?=display_str($Comment)?>" size="60" />
|
||||
</td>
|
||||
<td>
|
||||
<?=Users::format_username($UserID, false, false, false)?><br />
|
||||
<? echo time_diff($DNUTime, 1) . "\n"; ?>
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" name="submit" value="Edit" />
|
||||
<input type="submit" name="submit" value="Delete" />
|
||||
</td>
|
||||
</form>
|
||||
</tr>
|
||||
<? } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<? View::show_footer(); ?>
|
||||
|
@ -99,7 +99,7 @@
|
||||
d.Comment,
|
||||
d.Time
|
||||
FROM do_not_upload as d
|
||||
ORDER BY d.Time DESC');
|
||||
ORDER BY d.Sequence');
|
||||
$DNU = $DB->to_array();
|
||||
list($Name, $Comment, $Updated) = reset($DNU);
|
||||
reset($DNU);
|
||||
|
25
static/functions/dnu_list.js
Normal file
25
static/functions/dnu_list.js
Normal file
@ -0,0 +1,25 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
// Helper function to preserve table cell dimentions
|
||||
var fixDimentions = function (unused, elements) {
|
||||
// Iterate through each table cell and correct width
|
||||
elements.children().each(function () {
|
||||
$(this).width($(this).width());
|
||||
});
|
||||
return elements;
|
||||
};
|
||||
// Make table sortable
|
||||
$('#dnu tbody').sortable({
|
||||
helper: fixDimentions,
|
||||
cancel: 'input, .colhead, .rowa',
|
||||
update: function (event, ui) {
|
||||
var post = $(this).sortable('serialize');
|
||||
request = $.ajax({
|
||||
url: 'tools.php',
|
||||
type: "post",
|
||||
data: 'action=dnu_alter&auth=' + authkey + '&' + post + '&submit=Reorder'
|
||||
});
|
||||
request.done(function (response, textStatus, jqXHR) {
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user