예제 #1
0
 $a = mysql_fetch_assoc($r);
 if (get_user_class() >= $submanage_class || $a["uppedby"] == $CURUSER["id"]) {
     $sure = $_GET["sure"];
     if ($sure == 1) {
         $reason = $_POST["reason"];
         sql_query("DELETE FROM subs WHERE id={$delete}") or sqlerr(__FILE__, __LINE__);
         if (!unlink("{$SUBSPATH}/{$a['torrent_id']}/{$a['id']}.{$a['ext']}")) {
             stdmsg($lang_subtitles['std_error'], $lang_subtitles['std_this_file'] . "{$a['filename']}" . $lang_subtitles['std_is_invalid']);
             stdfoot();
             die;
         } else {
             KPS("-", $uploadsubtitle_bonus, $a["uppedby"]);
             //subtitle uploader loses bonus for deleted subtitle
         }
         if ($CURUSER['id'] != $a['uppedby']) {
             $owner_res = get_user_resource($a['uppedby'])['delete_sub_target'];
             $owner_lang = get_fix_user_lang($a['uppedby']);
             // 标题
             $subject = $owner_res['msg_deleted_your_sub'];
             // 带有用户链接的用户信息。
             $deleter_info = MessageFormatter::formatMessage("", "[url=userdetails.php?id={0}]{1}[/url]", array($CURUSER['id'], $CURUSER['username']));
             // 消息模板,根据是否有注释,使用不同类型。
             $msg_format = $reason ? $owner_res['msg_delete_sub_format_reason'] : $owner_res['msg_delete_sub_format'];
             // 正文。
             $msg = MessageFormatter::formatMessage($owner_lang, $msg_format, array($a['id'], $a['title'], $deleter_info, $reason));
             $time = (string) date("Y-m-d H:i:s");
             $sql = new_mysqli();
             $query = $sql->prepare("INSERT INTO `messages` (`sender`, `receiver`, `added`, `msg`, `subject`) VALUES (0, ?, ?, ?, ?)");
             $query->bind_param("isss", $a['uppedby'], $time, $msg, $subject);
             $query->execute() or sqlerr(__FILE__, __LINE__);
             $sql->close();
예제 #2
0
파일: delete.php 프로젝트: CptTZ/NexusPHP-1
};
// 删除字幕的完整列表字符串。
$deleted_sub_title_text = join(", ", array_map($generate_subtitle_info, $subtitle_id_list));
// 删除者字符串。
$deleter = $is_anonymous ? "its anonymous uploader" : $CURUSER[username];
// 写入删除消息。
$message_format = empty($subtitle_id_list) ? "Torrent {0} ({1}) was deleted by {2}: {4}" : "Torrent {0} ({1}) and its subtitles {3} were deleted by {2}: {4}";
write_log(MessageFormatter::formatMessage("", $message_format, array($id, $row['name'], $deleter, $deleted_sub_title_text, $reason_str_log)), "normal");
//===remove karma
KPS("-", $uploadtorrent_bonus, $row["owner"]);
//Send pm to torrent uploader
if ($CURUSER["id"] != $row["owner"]) {
    // 作者语言
    $owner_lang = get_fix_user_lang($row["owner"]);
    // 删除种子相关的资源。
    $owner_delete_res = get_user_resource($row["owner"])['delete_torrent_target'];
    // 返回给种子作者的原因说明
    $reason_str = generate_delete_reason($row["owner"], $rt, $reason);
    // 带有用户链接的用户信息。
    $deleter_info = MessageFormatter::formatMessage("", "[url=userdetails.php?id={0}]{1}[/url]", array($CURUSER['id'], $CURUSER['username']));
    // 删除消息标题。
    $subject = $owner_delete_res['msg_torrent_deleted'];
    // 删除消息正文。
    $msg = MessageFormatter::formatMessage($owner_lang, $owner_delete_res['msg_torrent_deleted_format'], array($id, $row['name'], $deleter_info, $reason_str));
    // 时间。
    $dt = (string) date("Y-m-d H:i:s");
    $sql = new_mysqli();
    $query = $sql->prepare("INSERT INTO `messages` (`sender`, `receiver`, `subject`, `added`, `msg`) VALUES (0, ?, ?, ?, ?)");
    $query->bind_param("isss", $row['owner'], $subject, $dt, $msg);
    $query->execute() or sqlerr(__FILE__, __LINE__);
    $sql->close();