本文整理汇总了PHP中Misc::write_log方法的典型用法代码示例。如果您正苦于以下问题:PHP Misc::write_log方法的具体用法?PHP Misc::write_log怎么用?PHP Misc::write_log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Misc
的用法示例。
在下文中一共展示了Misc::write_log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list
}
//Log and delete
if (isset($Escaped['delete']) && check_perms('users_mod')) {
$DB->query("\n\t\t\tSELECT Username\n\t\t\tFROM users_main\n\t\t\tWHERE ID = {$UploaderID}");
list($UpUsername) = $DB->next_record();
$Log = "Torrent {$TorrentID} ({$RawName}) uploaded by {$UpUsername} was deleted by " . $LoggedUser['Username'];
$Log .= $Escaped['resolve_type'] == 'custom' ? '' : ' for the reason: ' . $ResolveType['title'] . ".";
if (isset($Escaped['log_message']) && $Escaped['log_message'] != '') {
$Log .= ' ( ' . $Escaped['log_message'] . ' )';
}
$DB->query("\n\t\t\tSELECT GroupID, hex(info_hash)\n\t\t\tFROM torrents\n\t\t\tWHERE ID = {$TorrentID}");
list($GroupID, $InfoHash) = $DB->next_record();
Torrents::delete_torrent($TorrentID, 0, $ResolveType['reason']);
//$InfoHash = unpack("H*", $InfoHash);
$Log .= ' (' . strtoupper($InfoHash) . ')';
Misc::write_log($Log);
$Log = 'deleted torrent for the reason: ' . $ResolveType['title'] . '. ( ' . $Escaped['log_message'] . ' )';
Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $Log, 0);
} else {
$Log = "No log message (torrent wasn't deleted).";
}
//Warnings / remove upload
if ($Upload) {
$Cache->begin_transaction("user_info_heavy_{$UploaderID}");
$Cache->update_row(false, array('DisableUpload' => '1'));
$Cache->commit_transaction(0);
$DB->query("\n\t\t\tUPDATE users_info\n\t\t\tSET DisableUpload = '1'\n\t\t\tWHERE UserID = {$UploaderID}");
}
if ($Warning > 0) {
$WarnLength = $Warning * (7 * 24 * 60 * 60);
$Reason = "Uploader of torrent ({$TorrentID}) {$RawName} which was resolved with the preset: " . $ResolveType['title'] . '.';
示例2: foreach
//Do we need to get artists?
if ($CategoryName === 'Music') {
$ArtistForm = Requests::get_artists($RequestID);
$ArtistName = Artists::display_artists($ArtistForm, false, true);
$FullName = $ArtistName . $Title;
} else {
$FullName = $Title;
}
// Delete request, votes and tags
$DB->query("DELETE FROM requests WHERE ID = '{$RequestID}'");
$DB->query("DELETE FROM requests_votes WHERE RequestID = '{$RequestID}'");
$DB->query("DELETE FROM requests_tags WHERE RequestID = '{$RequestID}'");
Comments::delete_page('requests', $RequestID);
$DB->query("\n\tSELECT ArtistID\n\tFROM requests_artists\n\tWHERE RequestID = {$RequestID}");
$RequestArtists = $DB->to_array();
foreach ($RequestArtists as $RequestArtist) {
$Cache->delete_value("artists_requests_{$RequestArtist}");
}
$DB->query("\n\tDELETE FROM requests_artists\n\tWHERE RequestID = '{$RequestID}'");
$Cache->delete_value("request_artists_{$RequestID}");
G::$DB->query("\n\tREPLACE INTO sphinx_requests_delta\n\t\t(ID)\n\tVALUES\n\t\t({$RequestID})");
if ($UserID != $LoggedUser['ID']) {
Misc::send_pm($UserID, 0, 'A request you created has been deleted', "The request \"{$FullName}\" was deleted by [url=" . site_url() . 'user.php?id=' . $LoggedUser['ID'] . ']' . $LoggedUser['Username'] . '[/url] for the reason: [quote]' . $_POST['reason'] . '[/quote]');
}
Misc::write_log("Request {$RequestID} ({$FullName}) was deleted by user " . $LoggedUser['ID'] . ' (' . $LoggedUser['Username'] . ') for the reason: ' . $_POST['reason']);
$Cache->delete_value("request_{$RequestID}");
$Cache->delete_value("request_votes_{$RequestID}");
if ($GroupID) {
$Cache->delete_value("requests_group_{$GroupID}");
}
header('Location: requests.php');
示例3: error
<?php
if (!check_perms('admin_manage_wiki')) {
error(403);
}
if (!isset($_GET['id']) || !is_number($_GET['id'])) {
error(404);
}
$ID = (int) $_GET['id'];
if ($ID == INDEX_ARTICLE) {
error('You cannot delete the main wiki article.');
}
$DB->query("\n\tSELECT Title\n\tFROM wiki_articles\n\tWHERE ID = {$ID}");
if (!$DB->has_results()) {
error(404);
}
list($Title) = $DB->next_record(MYSQLI_NUM, false);
//Log
Misc::write_log("Wiki article {$ID} ({$Title}) was deleted by " . $LoggedUser['Username']);
//Delete
$DB->query("DELETE FROM wiki_articles WHERE ID = {$ID}");
$DB->query("DELETE FROM wiki_aliases WHERE ArticleID = {$ID}");
$DB->query("DELETE FROM wiki_revisions WHERE ID = {$ID}");
Wiki::flush_aliases();
Wiki::flush_article($ID);
header("location: wiki.php");
示例4: list
list($ID, $Deleted) = $DB->next_record();
if ($Deleted) {
$Err = 'That collection already exists but needs to be recovered; please <a href="staffpm.php">contact</a> the staff team!';
} else {
$Err = "That collection already exists: <a href=\"/collages.php?id={$ID}\">{$ID}</a>.";
}
}
}
if (!$Err) {
if (empty($CollageCats[$P['category']])) {
$Err = 'Please select a category';
}
}
if ($Err) {
$Name = $_POST['name'];
$Category = $_POST['category'];
$Tags = $_POST['tags'];
$Description = $_POST['description'];
include SERVER_ROOT . '/sections/collages/new.php';
die;
}
$TagList = explode(',', $_POST['tags']);
foreach ($TagList as $ID => $Tag) {
$TagList[$ID] = Misc::sanitize_tag($Tag);
}
$TagList = implode(' ', $TagList);
$DB->query("\n\tINSERT INTO collages\n\t\t(Name, Description, UserID, TagList, CategoryID)\n\tVALUES\n\t\t('{$P['name']}', '{$P['description']}', {$LoggedUser['ID']}, '{$TagList}', '{$P['category']}')");
$CollageID = $DB->inserted_id();
$Cache->delete_value("collage_{$CollageID}");
Misc::write_log("Collage {$CollageID} (" . $_POST['name'] . ') was created by ' . $LoggedUser['Username']);
header("Location: collages.php?id={$CollageID}");
示例5: delete_artist
/**
* Deletes an artist and their requests, wiki, and tags.
* Does NOT delete their torrents.
*
* @param int $ArtistID
*/
public static function delete_artist($ArtistID)
{
$QueryID = G::$DB->get_query_id();
G::$DB->query("\n\t\t\tSELECT Name\n\t\t\tFROM artists_group\n\t\t\tWHERE ArtistID = " . $ArtistID);
list($Name) = G::$DB->next_record(MYSQLI_NUM, false);
// Delete requests
G::$DB->query("\n\t\t\tSELECT RequestID\n\t\t\tFROM requests_artists\n\t\t\tWHERE ArtistID = {$ArtistID}\n\t\t\t\tAND ArtistID != 0");
$Requests = G::$DB->to_array();
foreach ($Requests as $Request) {
list($RequestID) = $Request;
G::$DB->query('DELETE FROM requests WHERE ID=' . $RequestID);
G::$DB->query('DELETE FROM requests_votes WHERE RequestID=' . $RequestID);
G::$DB->query('DELETE FROM requests_tags WHERE RequestID=' . $RequestID);
G::$DB->query('DELETE FROM requests_artists WHERE RequestID=' . $RequestID);
}
// Delete artist
G::$DB->query('DELETE FROM artists_group WHERE ArtistID=' . $ArtistID);
G::$DB->query('DELETE FROM artists_alias WHERE ArtistID=' . $ArtistID);
G::$Cache->decrement('stats_artist_count');
// Delete wiki revisions
G::$DB->query('DELETE FROM wiki_artists WHERE PageID=' . $ArtistID);
// Delete tags
G::$DB->query('DELETE FROM artists_tags WHERE ArtistID=' . $ArtistID);
// Delete artist comments, subscriptions and quote notifications
Comments::delete_page('artist', $ArtistID);
G::$Cache->delete_value('artist_' . $ArtistID);
G::$Cache->delete_value('artist_groups_' . $ArtistID);
// Record in log
if (!empty(G::$LoggedUser['Username'])) {
$Username = G::$LoggedUser['Username'];
} else {
$Username = 'System';
}
Misc::write_log("Artist {$ArtistID} ({$Name}) was deleted by {$Username}");
G::$DB->set_query_id($QueryID);
}
示例6: authorize
</ul>
<input type="submit" value="Confirm" />
</form>
</div>
</div>
<?php
View::show_footer();
} else {
authorize();
$DB->query("\n\t\tUPDATE torrents\n\t\tSET\tGroupID = '{$GroupID}'\n\t\tWHERE ID = {$TorrentID}");
// Delete old torrent group if it's empty now
$DB->query("\n\t\tSELECT COUNT(ID)\n\t\tFROM torrents\n\t\tWHERE GroupID = '{$OldGroupID}'");
list($TorrentsInGroup) = $DB->next_record();
if ($TorrentsInGroup == 0) {
// TODO: votes etc!
$DB->query("\n\t\t\tUPDATE comments\n\t\t\tSET PageID = '{$GroupID}'\n\t\t\tWHERE Page = 'torrents'\n\t\t\t\tAND PageID = '{$OldGroupID}'");
$Cache->delete_value("torrent_comments_{$GroupID}_catalogue_0");
$Cache->delete_value("torrent_comments_{$GroupID}");
Torrents::delete_group($OldGroupID);
} else {
Torrents::update_hash($OldGroupID);
}
Torrents::update_hash($GroupID);
Misc::write_log("Torrent {$TorrentID} was edited by " . $LoggedUser['Username']);
// TODO: this is probably broken
Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "merged group {$OldGroupID}", 0);
$DB->query("\n\t\tUPDATE group_log\n\t\tSET GroupID = {$GroupID}\n\t\tWHERE GroupID = {$OldGroupID}");
$Cache->delete_value("torrents_details_{$GroupID}");
$Cache->delete_value("torrent_download_{$TorrentID}");
header("Location: torrents.php?id={$GroupID}");
}
示例7: freeleech_torrents
/**
* Will freeleech / neutral leech / normalise a set of torrents
*
* @param array $TorrentIDs An array of torrent IDs to iterate over
* @param int $FreeNeutral 0 = normal, 1 = fl, 2 = nl
* @param int $FreeLeechType 0 = Unknown, 1 = Staff picks, 2 = Perma-FL (Toolbox, etc.), 3 = Vanity House
*/
public static function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLeechType = 0)
{
if (!is_array($TorrentIDs)) {
$TorrentIDs = array($TorrentIDs);
}
$QueryID = G::$DB->get_query_id();
G::$DB->query("\n\t\t\tUPDATE torrents\n\t\t\tSET FreeTorrent = '{$FreeNeutral}', FreeLeechType = '{$FreeLeechType}'\n\t\t\tWHERE ID IN (" . implode(', ', $TorrentIDs) . ')');
G::$DB->query('
SELECT ID, GroupID, info_hash
FROM torrents
WHERE ID IN (' . implode(', ', $TorrentIDs) . ')
ORDER BY GroupID ASC');
$Torrents = G::$DB->to_array(false, MYSQLI_NUM, false);
$GroupIDs = G::$DB->collect('GroupID');
G::$DB->set_query_id($QueryID);
foreach ($Torrents as $Torrent) {
list($TorrentID, $GroupID, $InfoHash) = $Torrent;
Tracker::update_tracker('update_torrent', array('info_hash' => rawurlencode($InfoHash), 'freetorrent' => $FreeNeutral));
G::$Cache->delete_value("torrent_download_{$TorrentID}");
Misc::write_log(G::$LoggedUser['Username'] . " marked torrent {$TorrentID} freeleech type {$FreeLeechType}!");
Torrents::write_group_log($GroupID, $TorrentID, G::$LoggedUser['ID'], "marked as freeleech type {$FreeLeechType}!", 0);
}
foreach ($GroupIDs as $GroupID) {
Torrents::update_hash($GroupID);
}
}
示例8: error
$DB->query("\n\t\t\t\t\tUPDATE artists_alias\n\t\t\t\t\tSET ArtistID = '{$ArtistID}', Redirect = 0\n\t\t\t\t\tWHERE AliasID = '{$CloneAliasID}'");
Misc::write_log("Redirection for the alias {$CloneAliasID} ({$DBAliasName}) for the artist {$ArtistID} was removed by user {$LoggedUser['ID']} ({$LoggedUser['Username']})");
} else {
error('No changes were made as the target alias did not redirect anywhere.');
}
} else {
error('An alias by that name already exists <a href="artist.php?id=' . $CloneArtistID . '">here</a>. You can try renaming that artist to this one.');
}
}
}
if (!$CloneAliasID) {
if ($Redirect) {
$DB->query("\n\t\t\tSELECT ArtistID, Redirect\n\t\t\tFROM artists_alias\n\t\t\tWHERE AliasID = {$Redirect}");
if (!$DB->has_results()) {
error('Cannot redirect to a nonexistent artist alias.');
}
list($FoundArtistID, $FoundRedirect) = $DB->next_record();
if ($ArtistID != $FoundArtistID) {
error('Redirection must target an alias for the current artist.');
}
if ($FoundRedirect != 0) {
$Redirect = $FoundRedirect;
}
}
$DB->query("\n\t\tINSERT INTO artists_alias\n\t\t\t(ArtistID, Name, Redirect, UserID)\n\t\tVALUES\n\t\t\t({$ArtistID}, '{$DBAliasName}', {$Redirect}, " . $LoggedUser['ID'] . ')');
$AliasID = $DB->inserted_id();
$DB->query("\n\t\tSELECT Name\n\t\tFROM artists_group\n\t\tWHERE ArtistID = {$ArtistID}");
list($ArtistName) = $DB->next_record(MYSQLI_NUM, false);
Misc::write_log("The alias {$AliasID} ({$DBAliasName}) was added to the artist {$ArtistID} (" . db_string($ArtistName) . ') by user ' . $LoggedUser['ID'] . ' (' . $LoggedUser['Username'] . ')');
}
header('Location: ' . $_SERVER['HTTP_REFERER']);
示例9: error
<?php
if (!check_perms('site_collages_recover')) {
error(403);
}
if ($_POST['collage_id'] && is_number($_POST['collage_id'])) {
authorize();
$CollageID = $_POST['collage_id'];
$DB->query("\n\t\tSELECT Name\n\t\tFROM collages\n\t\tWHERE ID = {$CollageID}");
if (!$DB->has_results()) {
error('Collage is completely deleted');
} else {
$DB->query("\n\t\t\tUPDATE collages\n\t\t\tSET Deleted = '0'\n\t\t\tWHERE ID = {$CollageID}");
$Cache->delete_value("collage_{$CollageID}");
Misc::write_log("Collage {$CollageID} was recovered by " . $LoggedUser['Username']);
header("Location: collages.php?id={$CollageID}");
}
}
View::show_header('Collage recovery!');
?>
<div class="thin center">
<div class="box" style="width: 600px; margin: 0px auto;">
<div class="head colhead">
Recover deleted collage
</div>
<div class="pad">
<form class="undelete_form" name="collage" action="collages.php" method="post">
<input type="hidden" name="action" value="recover" />
<input type="hidden" name="auth" value="<?php
echo $LoggedUser['AuthKey'];
?>
示例10: site_url
// If we can't take it all out of upload, zero that out and add whatever is left as download.
$DB->query("\n\t\tUPDATE users_main\n\t\tSET Uploaded = 0\n\t\tWHERE ID = {$FillerID}");
$DB->query('
UPDATE users_main
SET Downloaded = Downloaded + ' . ($RequestVotes['TotalBounty'] - $Uploaded) . "\n\t\tWHERE ID = {$FillerID}");
} else {
$DB->query('
UPDATE users_main
SET Uploaded = Uploaded - ' . $RequestVotes['TotalBounty'] . "\n\t\tWHERE ID = {$FillerID}");
}
Misc::send_pm($FillerID, 0, 'A request you filled has been unfilled', "The request \"[url=" . site_url() . "requests.php?action=view&id={$RequestID}]{$FullName}" . "[/url]\" was unfilled by [url=" . site_url() . 'user.php?id=' . $LoggedUser['ID'] . ']' . $LoggedUser['Username'] . '[/url] for the reason: [quote]' . $_POST['reason'] . "[/quote]\nIf you feel like this request was unjustly unfilled, please [url=" . site_url() . "reports.php?action=report&type=request&id={$RequestID}]report the request[/url] and explain why this request should not have been unfilled.");
$Cache->delete_value("user_stats_{$FillerID}");
if ($UserID !== $LoggedUser['ID']) {
Misc::send_pm($UserID, 0, 'A request you created has been unfilled', "The request \"[url=" . site_url() . "requests.php?action=view&id={$RequestID}]{$FullName}" . "[/url]\" was unfilled by [url=" . site_url() . 'user.php?id=' . $LoggedUser['ID'] . ']' . $LoggedUser['Username'] . "[/url] for the reason: [quote]" . $_POST['reason'] . '[/quote]');
}
Misc::write_log("Request {$RequestID} ({$FullName}), with a " . Format::get_size($RequestVotes['TotalBounty']) . ' bounty, was unfilled by user ' . $LoggedUser['ID'] . ' (' . $LoggedUser['Username'] . ') for the reason: ' . $_POST['reason']);
$Cache->delete_value("request_{$RequestID}");
$Cache->delete_value("request_artists_{$RequestID}");
if ($GroupID) {
$Cache->delete_value("requests_group_{$GroupID}");
}
Requests::update_sphinx_requests($RequestID);
if (!empty($ArtistForm)) {
foreach ($ArtistForm as $ArtistType) {
foreach ($ArtistType as $Artist) {
$Cache->delete_value('artists_requests_' . $Artist['id']);
}
}
}
$SphQL = new SphinxqlQuery();
$SphQL->raw_query("\n\t\tUPDATE requests, requests_delta\n\t\tSET torrentid = 0, fillerid = 0\n\t\tWHERE id = {$RequestID}", false);
示例11: error
//******************************************************************************//
//--------------- Validate data in edit form -----------------------------------//
// FIXME: Still need a better perm name
if (!check_perms('site_moderate_requests')) {
error(403);
}
$Validate->SetFields('torrentid', '1', 'number', 'Invalid torrent ID.', array('maxlength' => 1000000000, 'minlength' => 1));
// we shouldn't have torrent IDs higher than a billion
$Validate->SetFields('groupid', '1', 'number', 'Invalid group ID.', array('maxlength' => 1000000000, 'minlength' => 1));
// we shouldn't have group IDs higher than a billion either
$Validate->SetFields('subject', '0', 'string', 'Invalid subject.', array('maxlength' => 1000, 'minlength' => 1));
$Validate->SetFields('message', '0', 'string', 'Invalid message.', array('maxlength' => 10000, 'minlength' => 1));
$Err = $Validate->ValidateForm($_POST);
// Validate the form
if ($Err) {
error($Err);
header('Location: ' . $_SERVER['HTTP_REFERER']);
die;
}
//******************************************************************************//
//--------------- Send PMs to users --------------------------------------------//
$DB->query("\n\tSELECT uid\n\tFROM xbt_snatched\n\tWHERE fid = {$TorrentID}");
if ($DB->has_results()) {
// Save this because send_pm uses $DB to run its own query... Oops...
$Snatchers = $DB->to_array();
foreach ($Snatchers as $UserID) {
Misc::send_pm($UserID[0], 0, $Subject, $Message);
}
}
Misc::write_log($LoggedUser['Username'] . " sent mass notice to snatchers of torrent {$TorrentID} in group {$GroupID}");
header("Location: torrents.php?id={$GroupID}");
示例12: list
list($Importance, $ArtistID) = explode(';', $Artist);
if (is_number($ArtistID) && is_number($Importance)) {
$CleanArtists[] = array($Importance, $ArtistID);
$ArtistIDs[] = $ArtistID;
}
}
if (count($CleanArtists) > 0) {
$ArtistsString = implode(',', $ArtistIDs);
if ($_POST['manager_action'] == 'delete') {
$DB->query("\n\t\t\tSELECT Name\n\t\t\tFROM torrents_group\n\t\t\tWHERE ID = '" . $_POST['groupid'] . "'");
list($GroupName) = $DB->next_record();
$DB->query("\n\t\t\tSELECT ArtistID, Name\n\t\t\tFROM artists_group\n\t\t\tWHERE ArtistID IN ({$ArtistsString})");
$ArtistNames = $DB->to_array('ArtistID', MYSQLI_ASSOC, false);
foreach ($CleanArtists as $Artist) {
list($Importance, $ArtistID) = $Artist;
Misc::write_log('Artist (' . $ArtistTypes[$Importance] . ") {$ArtistID} (" . $ArtistNames[$ArtistID]['Name'] . ") was removed from the group " . $_POST['groupid'] . " ({$GroupName}) by user " . $LoggedUser['ID'] . ' (' . $LoggedUser['Username'] . ')');
Torrents::write_group_log($GroupID, 0, $LoggedUser['ID'], "Removed artist " . $ArtistNames[$ArtistID]['Name'] . " (" . $ArtistTypes[$Importance] . ")", 0);
$DB->query("\n\t\t\t\tDELETE FROM torrents_artists\n\t\t\t\tWHERE GroupID = '{$GroupID}'\n\t\t\t\t\tAND ArtistID = '{$ArtistID}'\n\t\t\t\t\tAND Importance = '{$Importance}'");
$Cache->delete_value("artist_groups_{$ArtistID}");
}
$DB->query("\n\t\t\tSELECT ArtistID\n\t\t\t\tFROM requests_artists\n\t\t\t\tWHERE ArtistID IN ({$ArtistsString})\n\t\t\tUNION\n\t\t\tSELECT ArtistID\n\t\t\t\tFROM torrents_artists\n\t\t\t\tWHERE ArtistID IN ({$ArtistsString})");
$Items = $DB->collect('ArtistID');
$EmptyArtists = array_diff($ArtistIDs, $Items);
foreach ($EmptyArtists as $ArtistID) {
Artists::delete_artist($ArtistID);
}
} else {
$DB->query("\n\t\t\tUPDATE IGNORE torrents_artists\n\t\t\tSET Importance = '" . $_POST['importance'] . "'\n\t\t\tWHERE GroupID = '{$GroupID}'\n\t\t\t\tAND ArtistID IN ({$ArtistsString})");
}
$Cache->delete_value("groups_artists_{$GroupID}");
Torrents::update_hash($GroupID);
示例13: authorize
<?php
authorize();
if (!check_perms('torrents_edit')) {
error(403);
}
$AliasID = $_GET['aliasid'];
if (!is_number($AliasID)) {
error(0);
}
$DB->query("\n\tSELECT aa.AliasID\n\tFROM artists_alias AS aa\n\t\tJOIN artists_alias AS aa2 ON aa.ArtistID=aa2.ArtistID\n\tWHERE aa.AliasID=" . $AliasID);
if ($DB->record_count() === 1) {
//This is the last alias on the artist
error("That alias is the last alias for that artist; removing it would cause bad things to happen.");
}
$DB->query("\n\tSELECT GroupID\n\tFROM torrents_artists\n\tWHERE AliasID='{$AliasID}'");
if ($DB->has_results()) {
list($GroupID) = $DB->next_record();
if ($GroupID != 0) {
error("That alias still has the group (<a href=\"torrents.php?id={$GroupID}\">{$GroupID}</a>) attached. Fix that first.");
}
}
$DB->query("\n\tSELECT aa.ArtistID, ag.Name, aa.Name\n\tFROM artists_alias AS aa\n\t\tJOIN artists_group AS ag ON aa.ArtistID=ag.ArtistID\n\tWHERE aa.AliasID={$AliasID}");
list($ArtistID, $ArtistName, $AliasName) = $DB->next_record(MYSQLI_NUM, false);
$DB->query("\n\tDELETE FROM artists_alias\n\tWHERE AliasID='{$AliasID}'");
$DB->query("\n\tUPDATE artists_alias\n\tSET Redirect='0'\n\tWHERE Redirect='{$AliasID}'");
Misc::write_log("The alias {$AliasID} ({$AliasName}) was removed from the artist {$ArtistID} ({$ArtistName}) by user {$LoggedUser['ID']} ({$LoggedUser['Username']})");
header("Location: {$_SERVER['HTTP_REFERER']}");
示例14: error
if (!is_number($CollageID) || !$CollageID) {
error(404);
}
$DB->query("\n\tSELECT Name, CategoryID, UserID\n\tFROM collages\n\tWHERE ID = '{$CollageID}'");
list($Name, $CategoryID, $UserID) = $DB->next_record(MYSQLI_NUM, false);
if (!check_perms('site_collages_delete') && $UserID !== $LoggedUser['ID']) {
error(403);
}
$Reason = trim($_POST['reason']);
if (!$Reason) {
error('You must enter a reason!');
}
$DB->query("\n\tSELECT GroupID\n\tFROM collages_torrents\n\tWHERE CollageID = '{$CollageID}'");
while (list($GroupID) = $DB->next_record()) {
$Cache->delete_value("torrents_details_{$GroupID}");
$Cache->delete_value("torrent_collages_{$GroupID}");
$Cache->delete_value("torrent_collages_personal_{$GroupID}");
}
//Personal collages have CategoryID 0
if ($CategoryID == 0) {
$DB->query("\n\t\tDELETE FROM collages\n\t\tWHERE ID = '{$CollageID}'");
$DB->query("\n\t\tDELETE FROM collages_torrents\n\t\tWHERE CollageID = '{$CollageID}'");
Comments::delete_page('collages', $CollageID);
} else {
$DB->query("\n\t\tUPDATE collages\n\t\tSET Deleted = '1'\n\t\tWHERE ID = '{$CollageID}'");
Subscriptions::flush_subscriptions('collages', $CollageID);
Subscriptions::flush_quote_notifications('collages', $CollageID);
}
Misc::write_log("Collage {$CollageID} ({$Name}) was deleted by " . $LoggedUser['Username'] . ": {$Reason}");
$Cache->delete_value("collage_{$CollageID}");
header('Location: collages.php');
示例15: list
}
// End competiton
$DB->query("\n\tSELECT LogScore\n\tFROM torrents\n\tWHERE ID = {$TorrentID}");
list($LogScore) = $DB->next_record();
if ($Properties['Trumpable'] == 1 && $LogScore == 100) {
$DB->query("\n\t\tUPDATE torrents\n\t\tSET LogScore = 99\n\t\tWHERE ID = {$TorrentID}");
$Results = array();
$Results[] = 'The original uploader has chosen to allow this log to be deducted one point for using EAC v0.95., -1 point [1]';
$Details = db_string(serialize($Results));
$DB->query("\n\t\tUPDATE torrents_logs_new\n\t\tSET Score = 99, Details = '{$Details}'\n\t\tWHERE TorrentID = {$TorrentID}");
}
$DB->query("\n\tSELECT Enabled\n\tFROM users_main\n\tWHERE ID = {$UserID}");
list($Enabled) = $DB->next_record();
if ($Properties['Trumpable'] == 0 && $LogScore == 99 && $Enabled == 1 && strtotime($Time) < 1284422400) {
$DB->query("\n\t\tSELECT Log\n\t\tFROM torrents_logs_new\n\t\tWHERE TorrentID = {$TorrentID}");
list($Log) = $DB->next_record();
if (strpos($Log, 'EAC extraction') === 0) {
$DB->query("\n\t\t\tUPDATE torrents\n\t\t\tSET LogScore = 100\n\t\t\tWHERE ID = {$TorrentID}");
$DB->query("\n\t\t\tUPDATE torrents_logs_new\n\t\t\tSET Score = 100, Details = ''\n\t\t\tWHERE TorrentID = {$TorrentID}");
}
}
$DB->query("\n\tSELECT Name\n\tFROM torrents_group\n\tWHERE ID = {$GroupID}");
list($Name) = $DB->next_record(MYSQLI_NUM, false);
Misc::write_log("Torrent {$TorrentID} ({$Name}) in group {$GroupID} was edited by " . $LoggedUser['Username'] . " ({$LogDetails})");
// TODO: this is probably broken
Torrents::write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $LogDetails, 0);
$Cache->delete_value("torrents_details_{$GroupID}");
$Cache->delete_value("torrent_download_{$TorrentID}");
Torrents::update_hash($GroupID);
// All done!
header("Location: torrents.php?id={$GroupID}");