mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 04:20:49 +08:00
add attendance
This commit is contained in:
46
classes/class_attendance.php
Normal file
46
classes/class_attendance.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
class Attendance
|
||||
{
|
||||
protected $userid;
|
||||
protected $curdate;
|
||||
public function __construct($userid){
|
||||
$this->userid = $userid;
|
||||
$this->curdate = date('Y-m-d');
|
||||
$this->cachename = sprintf('attendance_%u_%s', $this->userid, $this->curdate);
|
||||
}
|
||||
|
||||
public function check($flush = false)
|
||||
{
|
||||
global $Cache;
|
||||
if($flush || ($row = $Cache->get_value($this->cachename)) === false){
|
||||
$res = sql_query(sprintf('SELECT * FROM `attendance` WHERE `uid` = %u AND DATE(`added`) = %s', $this->userid, sqlesc($this->curdate.' 00:00:00'))) or sqlerr(__FILE__,__LINE__);
|
||||
$row = mysql_num_rows($res) ? mysql_fetch_assoc($res) : array();
|
||||
$Cache->cache_value($this->cachename, $row, 86400);
|
||||
}
|
||||
return empty($row) ? false : $row;
|
||||
}
|
||||
|
||||
public function attend($initial = 10, $step = 5, $maximum = 2000, $continous = array())
|
||||
{
|
||||
if($this->check(true)) return false;
|
||||
$count = get_row_count('attendance', sprintf('WHERE `uid` = %u', $this->userid));
|
||||
$points = min($initial + $step * $count, $maximum);
|
||||
$res = sql_query(sprintf('SELECT DATEDIFF(%s, `added`) AS diff, `days` FROM `attendance` WHERE `uid` = %u ORDER BY `id` DESC LIMIT 1', sqlesc($this->curdate), $this->userid)) or sqlerr(__FILE__,__LINE__);
|
||||
list($datediff, $days) = mysql_num_rows($res) ? mysql_fetch_row($res) : array('diff' => 0, 'days' => 0);
|
||||
$cdays = $datediff == 1 ? ++$days : 1;
|
||||
if($cdays > 1){
|
||||
krsort($continous);
|
||||
foreach($continous as $sday => $svalue){
|
||||
if($cdays >= $sday){
|
||||
$points += $svalue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sql_query(sprintf('INSERT INTO `attendance` (`uid`,`added`,`points`,`days`) VALUES (%u, %s, %u, %u)', $this->userid, sqlesc(date('Y-m-d H:i:s')), $points, $cdays)) or sqlerr(__FILE__, __LINE__);
|
||||
KPS('+', $points, $this->userid);
|
||||
global $Cache;
|
||||
$Cache->delete_value($this->cachename);
|
||||
return array(++$count, $cdays, $points);
|
||||
}
|
||||
}
|
||||
@@ -12,4 +12,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . $rootpath);
|
||||
$rootpath .= "/";
|
||||
require $rootpath . 'include/functions.php';
|
||||
require $rootpath . 'include/globalfunctions.php';
|
||||
require $rootpath . 'classes/class_advertisement.php';
|
||||
require $rootpath . 'classes/class_attendance.php';
|
||||
require $rootpath . 'include/core.php';
|
||||
|
||||
@@ -307,6 +307,10 @@ $basictax_bonus = $BONUS['basictax'];
|
||||
$taxpercentage_bonus = $BONUS['taxpercentage'];
|
||||
$prolinkpoint_bonus = $BONUS['prolinkpoint'];
|
||||
$prolinktime_bonus = $BONUS['prolinktime'];
|
||||
$attendance_initial_bonus = isset($BONUS['attendance_initial']) ? (int) $BONUS['attendance_initial'] : 10;
|
||||
$attendance_step_bonus = isset($BONUS['attendance_step']) ? (int) $BONUS['attendance_step'] : 5;
|
||||
$attendance_max_bonus = isset($BONUS['attendance_max']) ? (int) $BONUS['attendance_max'] : 1000;
|
||||
$attendance_continuous_bonus = isset($BONUS['attendance_continuous']) && is_array($BONUS['attendance_continuous']) ? $BONUS['attendance_continuous'] : array(10 => 200, 20 => 500, 30 => 1000);
|
||||
|
||||
$neverdelete_account = $ACCOUNT['neverdelete'];
|
||||
$neverdeletepacked_account = $ACCOUNT['neverdeletepacked'];
|
||||
|
||||
@@ -25,7 +25,6 @@ ini_set('display_errors', 0);
|
||||
|
||||
require $rootpath . 'vendor/autoload.php';
|
||||
require $rootpath . 'nexus/Database/helpers.php';
|
||||
require $rootpath . 'classes/class_advertisement.php';
|
||||
require $rootpath . 'classes/class_cache_redis.php';
|
||||
require $rootpath . 'include/config.php';
|
||||
if (!IS_ANNOUNCE) {
|
||||
|
||||
@@ -2426,6 +2426,8 @@ else {
|
||||
}
|
||||
|
||||
$inboxpic = "<img class=\"".($unread ? "inboxnew" : "inbox")."\" src=\"pic/trans.gif\" alt=\"inbox\" title=\"".($unread ? $lang_functions['title_inbox_new_messages'] : $lang_functions['title_inbox_no_new_messages'])."\" />";
|
||||
$attend_desk = new Attendance($CURUSER['id']);
|
||||
$attendance = $attend_desk->check();
|
||||
?>
|
||||
|
||||
<table id="info_block" cellpadding="4" cellspacing="0" border="0" width="100%"><tr>
|
||||
@@ -2439,6 +2441,7 @@ else {
|
||||
<?php if (get_user_class() >= UC_SYSOP) { ?> [<a href="settings.php"><?php echo $lang_functions['text_site_settings'] ?></a>]<?php } ?>
|
||||
[<a href="torrents.php?inclbookmarked=1&allsec=1&incldead=0"><?php echo $lang_functions['text_bookmarks'] ?></a>]
|
||||
<font class = 'color_bonus'><?php echo $lang_functions['text_bonus'] ?></font>[<a href="mybonus.php"><?php echo $lang_functions['text_use'] ?></a>]: <?php echo number_format($CURUSER['seedbonus'], 1)?>
|
||||
<?php if($attendance){ printf(' '.$lang_functions['text_attended'], $attendance['points']); }else{ printf(' <a href="attendance.php" class="faqlink">%s</a>', $lang_functions['text_attendance']);}?>
|
||||
<font class = 'color_invite'><?php echo $lang_functions['text_invite'] ?></font>[<a href="invite.php?id=<?php echo $CURUSER['id']?>"><?php echo $lang_functions['text_send'] ?></a>]: <?php echo $CURUSER['invites']?><br />
|
||||
<font class="color_ratio"><?php echo $lang_functions['text_ratio'] ?></font> <?php echo $ratio?>
|
||||
<font class='color_uploaded'><?php echo $lang_functions['text_uploaded'] ?></font> <?php echo mksize($CURUSER['uploaded'])?>
|
||||
|
||||
13
lang/chs/lang_attendance.php
Normal file
13
lang/chs/lang_attendance.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$lang_attendance = array
|
||||
(
|
||||
'title' => "签到",
|
||||
'success' => "签到成功",
|
||||
'attend_info' => "这是您的第 <b>%u</b> 次签到,已连续签到 <b>%u</b> 天,本次签到获得 <b>%u</b> 个魔力值。",
|
||||
'initial' => "首次签到获得 %u 个魔力值。",
|
||||
'steps' => "每次签到可额外获得 %u 个魔力值,直到 %u 封顶。",
|
||||
'continuous' => "连续签到 %u 天后,每次签到额外获得 %u 魔力值(不累计)。",
|
||||
'sorry' => "抱歉",
|
||||
'already_attended' => "您今天已经签到过了,请勿重复刷新。",
|
||||
);
|
||||
@@ -5,6 +5,7 @@ $lang_functions = array
|
||||
'std_access_denied' => "访问拒绝!",
|
||||
'std_fake_account' => "我们怀疑你在使用伪造账户,因此记录了本次行为!",
|
||||
'std_permission_denied' => "你没有该权限!",
|
||||
'std_target_not_exists' => '目标不存在',
|
||||
'std_already_logged_in' => "你已经登录!",
|
||||
'text_page_last_updated' => "本页面最后更新于",
|
||||
'text_browser_cookies_note' => "如果在启用Cookies后仍然无法登录,则你的登录Cookie可能有问题。我们建议你在删除Cookies后重试。删除Internet Explorer的Cookies的方法是,进入<b>工具</b>→<b>Internet选项...</b>然后点击<b>删除Cookies</b>按钮。注意这样也会删除保存在你电脑中其他站点的Cookies。",
|
||||
@@ -29,6 +30,14 @@ $lang_functions = array
|
||||
'std_used_many_times' => "已经被很多帐户使用...<b>".$SITENAME."</b>不允许该IP注册更多账户。",
|
||||
'std_invalid_image_code' => "图片代码无效!<br /><b>不要返回,图片代码已被清除!</b><br /><br />点击",
|
||||
'std_here_to_request_new' => "<b>这里</b></a>获取新的图片代码。",
|
||||
'std_action' => '操作',
|
||||
'std_report' => '举报',
|
||||
'std_desc' => '描述',
|
||||
'std_comment' => '评论',
|
||||
'std_quick_comment' => '快速评论',
|
||||
'std_click_here_to_goback' => '点击这里返回',
|
||||
'std_you_will_get' => '你将获得',
|
||||
'std_by' => '由',
|
||||
'row_security_image' => "验证图片:",
|
||||
'row_security_code' => "验证码:",
|
||||
'text_slots' => "连接数:",
|
||||
@@ -285,6 +294,8 @@ $lang_functions = array
|
||||
'text_thirty_percent_down' => "30%",
|
||||
'text_please_download_something_within' => "请在",
|
||||
'text_inactive_account_be_deleted' => "内做些下载。没有流量的用户会被删除账号。",
|
||||
'text_attendance' => '签到得魔力',
|
||||
'text_attended' => '(签到已得%u)',
|
||||
'row_pt_gen_douban_url' => "PT-Gen douban 链接",
|
||||
'text_pt_gen_douban_url_note' => "(来自 <strong><a href=\"https://www.douban.com/\">douban</a></strong> 的链接。如电影 <b>Transformers</b> 的链接是<b> https://movie.douban.com/subject/1794171/</b>)",
|
||||
'row_pt_gen_imdb_url' => "PT-Gen imdb 链接",
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
$lang_viewrequests = [
|
||||
'page_title' => '求种区',
|
||||
'add_request' => '添加',
|
||||
'request' => '求种',
|
||||
'add_request' => '添加求种',
|
||||
'request_name' => '求种名称',
|
||||
'view_request_all' => '查看所有',
|
||||
'view_request_resolved' => '查看已解决',
|
||||
'view_request_unresolved' => '查看未解决',
|
||||
@@ -18,4 +20,46 @@ $lang_viewrequests = [
|
||||
'request_status_resolved' => '求种成功',
|
||||
'request_status_resolving' => '求种中',
|
||||
'action_search' => '搜索',
|
||||
'basic_info' => '基本信息',
|
||||
'created_at' => '发表于',
|
||||
'reward' => '悬赏',
|
||||
'newest_bidding' => '最新竞价为',
|
||||
'original_bidding' => '原始竞价为',
|
||||
'on_request' => '应求',
|
||||
'recycle' => '回收',
|
||||
'recycle_title' => '回收返还80%魔力值',
|
||||
'add_reward' => '追加悬赏',
|
||||
'add_reward_desc' => '追加悬赏每次将扣减25个魔力值作为手续费',
|
||||
'no_request_yet' => '还没有应求',
|
||||
'btn_select_text' => '使用勾选的资源作为所需资源',
|
||||
'request_already_resolved' => '该求种已完成!',
|
||||
'add_request_desc' => '赏金不得低于100魔力值,每次求种将扣去100魔力值作为手续费。',
|
||||
'description_required' => '介绍未填!',
|
||||
'name_required' => '名称未填!',
|
||||
'amount_required' => '赏金未填!',
|
||||
'amount_must_be_numeric' => '赏金必须为数字!',
|
||||
'add_request_amount_minimum' => '发布求种赏金不得小于100个魔力值!',
|
||||
'add_request_amount_maximum' => '发布求种赏金不得大于10000个魔力值!',
|
||||
'bouns_not_enough' => '你没有那么多魔力值!!!',
|
||||
'add_request_success' => '新增求种成功',
|
||||
'request_id_must_be_numeric' => '求种 ID 必须为数字',
|
||||
'request_deleted' => '该求种已被删除!',
|
||||
'edit_request_success' => '编辑求种成功',
|
||||
'do_request' => '我要应求',
|
||||
'type_in_torrent_id' => '请输入种子的ID',
|
||||
'delete_request_success' => '删除求种成功',
|
||||
'torrent_is_picked_for_request' => '你的种子被人应求',
|
||||
'confirm_request_success' => '确认成功',
|
||||
'message_required' => '留言不能为空!',
|
||||
'request_created_at' => '添加于',
|
||||
'request_get_new_reply' => '你的求种请求收到新回复',
|
||||
'request_comment_get_new_reply' => '你的求种评论收到新回复',
|
||||
'torrent_not_release_yet' => '该种尚未正式发布',
|
||||
'supply_already_exists' => '该应求已经存在!',
|
||||
'message_please_confirm_supply' => '有人应求你的求种请求,请及时确认该应求',
|
||||
'please_confirm_supply' => '请及时确认该应求',
|
||||
'supply_success' => '应求成功',
|
||||
'add_reward_amount_minimum' => '追加悬赏赏金不得小于100个魔力值!',
|
||||
'add_reward_amount_maximum' => '追加悬赏赏金不得小于5000个魔力值!',
|
||||
'add_reward_success' => '追加悬赏成功',
|
||||
];
|
||||
13
lang/cht/lang_attendance.php
Normal file
13
lang/cht/lang_attendance.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$lang_attendance = array
|
||||
(
|
||||
'title' => "簽到",
|
||||
'success' => "簽到成功",
|
||||
'attend_info' => "這是您的第 <b>%u</b> 次簽到,已連續簽到 <b>%u</b> 天,本次簽到獲得 <b>%u</b> 個魔力值。",
|
||||
'initial' => "首次簽到獲得 %u 個魔力值。",
|
||||
'steps' => "每次簽到可額外獲得 %u 個魔力值,直到 %u 封頂。",
|
||||
'continuous' => "連續簽到 %u 天后,每次簽到額外獲得 %u 魔力值(不累計)。",
|
||||
'sorry' => "抱歉",
|
||||
'already_attended' => "您今天已經簽到過了,請勿重複刷新。",
|
||||
);
|
||||
@@ -5,6 +5,7 @@ $lang_functions = array
|
||||
'std_access_denied' => "訪問拒絕!",
|
||||
'std_fake_account' => "我們懷疑你在使用偽造帳戶,因此記錄了本次行為!",
|
||||
'std_permission_denied' => "你沒有該許可權!",
|
||||
'std_target_not_exists' => '目標不存在',
|
||||
'std_already_logged_in' => "你已經登錄!",
|
||||
'text_page_last_updated' => "本頁面最後更新於",
|
||||
'text_browser_cookies_note' => "如果在啟用Cookies後仍然無法登錄,則你的登錄Cookie可能有問題。我們建議你在刪除Cookies後重試。刪除Internet Explorer的Cookies的方法是,進入<b>工具</b>→<b>Internet選項...</b>然後點擊<b>刪除Cookies</b>按鈕。注意這樣也會刪除保存在你電腦中其他站點的Cookies。",
|
||||
@@ -29,6 +30,14 @@ $lang_functions = array
|
||||
'std_used_many_times' => "已經被很多帳戶使用...<b>".$SITENAME."</b>不允許該IP註冊更多帳戶。",
|
||||
'std_invalid_image_code' => "圖片代碼無效!<br /><b>不要返回,圖片代碼已被清除!</b><br /><br />點擊",
|
||||
'std_here_to_request_new' => "<b>這裏</b></a>獲取新的圖片代碼。",
|
||||
'std_action' => '操作',
|
||||
'std_report' => '舉報',
|
||||
'std_desc' => '描述',
|
||||
'std_comment' => '評論',
|
||||
'std_quick_comment' => '快速評論',
|
||||
'std_click_here_to_goback' => '點擊這裏返回',
|
||||
'std_you_will_get' => '妳將獲得',
|
||||
'std_by' => '由',
|
||||
'row_security_image' => "驗證圖片:",
|
||||
'row_security_code' => "驗證碼:",
|
||||
'text_slots' => "連接數:",
|
||||
@@ -287,6 +296,8 @@ $lang_functions = array
|
||||
'text_thirty_percent_down' => "30%",
|
||||
'text_please_download_something_within' => "請在",
|
||||
'text_inactive_account_be_deleted' => "內做些下載。沒有流量的用戶會被移除賬號。",
|
||||
'text_attendance' => '簽到得魔力',
|
||||
'text_attended' => '(簽到已得%u)',
|
||||
'text_pt_gen_douban_url_note' => "(來自 <strong><a href=\"https://www.douban.com/\">douban</a></strong> 的鏈接。如電影 <b>Transformers</b> 的鏈接是<b> https://movie.douban.com/subject/1794171/</b>)",
|
||||
'row_pt_gen_imdb_url' => "PT-Gen imdb 鏈接",
|
||||
'text_pt_gen_imdb_url_note' => "(來自 <strong><a href=\"https://www.imdb.com//\">imdb</a></strong> 的鏈接。如電影 <b>Transformers</b> 的鏈接是<b> https://www.imdb.com/title/tt0418279/</b>)",
|
||||
|
||||
@@ -1,5 +1,65 @@
|
||||
<?php
|
||||
$lang_viewrequests = [
|
||||
'page_title' => 'Requests',
|
||||
''
|
||||
'page_title' => '求種區',
|
||||
'request' => '求種',
|
||||
'add_request' => '添加求種',
|
||||
'request_name' => '求種名稱',
|
||||
'view_request_all' => '查看所有',
|
||||
'view_request_resolved' => '查看已解決',
|
||||
'view_request_unresolved' => '查看未解決',
|
||||
'view_request_resolving' => '查看解決中',
|
||||
'view_request_my' => '查看我發布的',
|
||||
'thead_name' => '名稱',
|
||||
'thead_price_newest' => '最新出價',
|
||||
'thead_price_original' => '原始出價',
|
||||
'thead_comment_count' => '評論數',
|
||||
'thead_on_request_count' => '應求數',
|
||||
'thead_request_user' => '求種者',
|
||||
'thead_created_at' => '時間',
|
||||
'thead_status' => '狀態',
|
||||
'request_status_resolved' => '求種成功',
|
||||
'request_status_resolving' => '求種中',
|
||||
'action_search' => '搜索',
|
||||
'basic_info' => '基本信息',
|
||||
'created_at' => '發表於',
|
||||
'reward' => '懸賞',
|
||||
'newest_bidding' => '最新競價為',
|
||||
'original_bidding' => '原始競價為',
|
||||
'on_request' => '應求',
|
||||
'recycle' => '回收',
|
||||
'recycle_title' => '回收返還80%魔力值',
|
||||
'add_reward' => '追加懸賞',
|
||||
'add_reward_desc' => '追加懸賞每次將扣減25個魔力值作為手續費',
|
||||
'no_request_yet' => '還沒有應求',
|
||||
'btn_select_text' => '使用勾選的資源作為所需資源',
|
||||
'request_already_resolved' => '該求種已完成!',
|
||||
'add_request_desc' => '賞金不得低於100魔力值,每次求種將扣去100魔力值作為手續費。',
|
||||
'description_required' => '介紹未填!',
|
||||
'name_required' => '名稱未填!',
|
||||
'amount_required' => '賞金未填!',
|
||||
'amount_must_be_numeric' => '賞金必須為數字!',
|
||||
'add_request_amount_minimum' => '發布求種賞金不得小於100個魔力值!',
|
||||
'add_request_amount_maximum' => '發布求種賞金不得大於10000個魔力值!',
|
||||
'bouns_not_enough' => '妳沒有那麽多魔力值!!!',
|
||||
'add_request_success' => '新增求種成功',
|
||||
'request_id_must_be_numeric' => '求種 ID 必須為數字',
|
||||
'request_deleted' => '該求種已被刪除!',
|
||||
'edit_request_success' => '編輯求種成功',
|
||||
'do_request' => '我要應求',
|
||||
'type_in_torrent_id' => '請輸入種子的ID',
|
||||
'delete_request_success' => '刪除求種成功',
|
||||
'torrent_is_picked_for_request' => '妳的種子被人應求',
|
||||
'confirm_request_success' => '確認成功',
|
||||
'message_required' => '留言不能為空!',
|
||||
'request_created_at' => '添加於',
|
||||
'request_get_new_reply' => '妳的求種請求收到新回復',
|
||||
'request_comment_get_new_reply' => '妳的求種評論收到新回復',
|
||||
'torrent_not_release_yet' => '該種尚未正式發布',
|
||||
'supply_already_exists' => '該應求已經存在!',
|
||||
'message_please_confirm_supply' => '有人應求妳的求種請求,請及時確認該應求',
|
||||
'please_confirm_supply' => '請及時確認該應求',
|
||||
'supply_success' => '應求成功',
|
||||
'add_reward_amount_minimum' => '追加懸賞賞金不得小於100個魔力值!',
|
||||
'add_reward_amount_maximum' => '追加懸賞賞金不得小於5000個魔力值!',
|
||||
'add_reward_success' => '追加懸賞成功',
|
||||
];
|
||||
13
lang/en/lang_attendance.php
Normal file
13
lang/en/lang_attendance.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$lang_attendance = array
|
||||
(
|
||||
'title' => "Attendance",
|
||||
'success' => "Success",
|
||||
'attend_info' => "You have already attended <b>%u</b> days. C <b>%u</b> day,this time you will get <b>%u</b> bonus.",
|
||||
'initial' => "First attendance get %u bonus.",
|
||||
'steps' => "Every attendance get %u bonus,unless reach maximum %u",
|
||||
'continuous' => "Attend %u day continuous,every time will get %u bouns additional(no aggregate).",
|
||||
'sorry' => "Sorry",
|
||||
'already_attended' => "You have already attend, no refresh please.",
|
||||
);
|
||||
@@ -5,6 +5,7 @@ $lang_functions = array
|
||||
'std_access_denied' => "Access Denied!",
|
||||
'std_fake_account' => "We come to believe you are using a fake account, therefore we've logged this action!",
|
||||
'std_permission_denied' => "Permission denied!",
|
||||
'std_target_not_exists' => 'Target not exists',
|
||||
'std_already_logged_in' => "You have already logged in!",
|
||||
'text_page_last_updated' => "This page last updated ",
|
||||
'text_browser_cookies_note' => "If you enable cookies and are still unable to log in, perhaps something happened to cause a problem with your login cookie. We suggest delete your cookies and trying again. To delete cookies in Internet Explorer, go to Tools > Internet Options... and click on the Delete Cookies button. Note that this will delete all cookies stored on your system for other sites as well.",
|
||||
@@ -29,6 +30,14 @@ $lang_functions = array
|
||||
'std_used_many_times' => " is already being used on too many account.... No more accounts allowed at <b>".$SITENAME."</b>.",
|
||||
'std_invalid_image_code' => "Invalid Image Code! <br /><b>Do not go back, The image code has been cleared!</b> <br /><br />Please click ",
|
||||
'std_here_to_request_new' => "<b>here</b></a> to request a new image code.",
|
||||
'std_action' => 'Action',
|
||||
'std_report' => 'Report',
|
||||
'std_desc' => 'Description',
|
||||
'std_comment' => 'Comment',
|
||||
'std_quick_comment' => 'Quick comment',
|
||||
'std_click_here_to_goback' => 'Click here to goback',
|
||||
'std_you_will_get' => 'You will get',
|
||||
'std_by' => 'By',
|
||||
'row_security_image' => "Security Image:",
|
||||
'row_security_code' => "Security Code:",
|
||||
'text_slots' => "Slots: ",
|
||||
@@ -287,6 +296,8 @@ $lang_functions = array
|
||||
'text_thirty_percent_down' => "30%",
|
||||
'text_please_download_something_within' => "Please download something within ",
|
||||
'text_inactive_account_be_deleted' => ". Inactive accounts (with no transfer amount) will be deleted.",
|
||||
'text_attendance' => 'Attend get bouns',
|
||||
'text_attended' => '(Attend got bouns %u)',
|
||||
'row_pt_gen_douban_url' => "PT-Gen douban link",
|
||||
'text_pt_gen_douban_url_note' => "(URL taken from <strong><a href=\"https://www.douban.com/\">douban</a></strong>. e.g. for movie <b>Transformers</b> the URL is <b> https://movie.douban.com/subject/1794171//</b>)",
|
||||
'row_pt_gen_imdb_url' => "PT-Gen imdb link",
|
||||
|
||||
@@ -1,5 +1,65 @@
|
||||
<?php
|
||||
$lang_viewrequests = [
|
||||
'page_title' => 'Requests',
|
||||
''
|
||||
'request' => 'Request',
|
||||
'add_request' => 'Add request',
|
||||
'request_name' => 'Request name',
|
||||
'view_request_all' => 'View all',
|
||||
'view_request_resolved' => 'View resolved',
|
||||
'view_request_unresolved' => 'View unresolved',
|
||||
'view_request_resolving' => 'View resolving',
|
||||
'view_request_my' => 'View My',
|
||||
'thead_name' => 'Name',
|
||||
'thead_price_newest' => 'Newest bidding',
|
||||
'thead_price_original' => 'Original bidding',
|
||||
'thead_comment_count' => 'Comment count',
|
||||
'thead_on_request_count' => 'Supply count',
|
||||
'thead_request_user' => 'User',
|
||||
'thead_created_at' => 'Time',
|
||||
'thead_status' => 'Status',
|
||||
'request_status_resolved' => 'Request success',
|
||||
'request_status_resolving' => 'Requesting',
|
||||
'action_search' => 'Search',
|
||||
'basic_info' => 'Basic info',
|
||||
'created_at' => 'Created at',
|
||||
'reward' => 'Reward',
|
||||
'newest_bidding' => 'Newest Bidding',
|
||||
'original_bidding' => 'Original bidding',
|
||||
'on_request' => 'Supply',
|
||||
'recycle' => 'Recycle',
|
||||
'recycle_title' => 'Recycle only give back 80% bouns',
|
||||
'add_reward' => 'Add resard',
|
||||
'add_reward_desc' => 'Add reward will deduct 25 bouns as service charge',
|
||||
'no_request_yet' => 'Nothing yet',
|
||||
'btn_select_text' => 'Use select resource for request',
|
||||
'request_already_resolved' => 'This requst is resolved',
|
||||
'add_request_desc' => 'Reward can not less than 100 bouns, and will deduct 100 bouns as service charge for every request',
|
||||
'description_required' => 'Description required!',
|
||||
'name_required' => 'Name required!',
|
||||
'amount_required' => 'Reward required!',
|
||||
'amount_must_be_numeric' => 'Amount must be numeric!',
|
||||
'add_request_amount_minimum' => 'Reward can not less than 100 bouns!',
|
||||
'add_request_amount_maximum' => 'Reward can not more than 10000 bouns!',
|
||||
'bouns_not_enough' => 'Your bouns is not enough!!!',
|
||||
'add_request_success' => 'Add request success',
|
||||
'request_id_must_be_numeric' => 'Request ID must be numeric',
|
||||
'request_deleted' => 'Request was deleted!',
|
||||
'edit_request_success' => 'Edit request success',
|
||||
'do_request' => 'I want request',
|
||||
'type_in_torrent_id' => 'Type in torrent ID',
|
||||
'delete_request_success' => 'Delete request success',
|
||||
'torrent_is_picked_for_request' => 'Your request got supply',
|
||||
'confirm_request_success' => 'Confirm success',
|
||||
'message_required' => 'Message required!',
|
||||
'request_created_at' => 'Created at',
|
||||
'request_get_new_reply' => 'Your request get new reply',
|
||||
'request_comment_get_new_reply' => 'Your request comment get new reply',
|
||||
'torrent_not_release_yet' => 'This torrent not release yet',
|
||||
'supply_already_exists' => 'This supply already exists!',
|
||||
'message_please_confirm_supply' => 'Someone supply your request, please confirm it on time',
|
||||
'please_confirm_supply' => 'Please confirm supply on time',
|
||||
'supply_success' => 'Request success',
|
||||
'add_reward_amount_minimum' => 'Add reward amount can not less than 100 bonus!',
|
||||
'add_reward_amount_maximum' => 'Add reward amount can not more than 5000 bonus!',
|
||||
'add_reward_success' => 'Add reward success',
|
||||
];
|
||||
29
public/attendance.php
Normal file
29
public/attendance.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
require '../include/bittorrent.php';
|
||||
dbconn();
|
||||
require get_langfile_path();
|
||||
loggedinorreturn();
|
||||
parked();
|
||||
$desk = new Attendance($CURUSER['id']);
|
||||
|
||||
if($result = $desk->attend($attendance_initial_bonus, $attendance_step_bonus, $attendance_max_bonus, $attendance_continuous_bonus)){
|
||||
list($count, $cdays, $points) = $result;
|
||||
stdhead($lang_attendance['title']);
|
||||
begin_main_frame();
|
||||
begin_frame($lang_attendance['success']);
|
||||
printf('<p>'.$lang_attendance['attend_info'].'</p>', $count, $cdays, $points);
|
||||
end_frame();
|
||||
echo '<ul>';
|
||||
printf('<li>'.$lang_attendance['initial'].'</li>', $attendance_initial_bonus);
|
||||
printf('<li>'.$lang_attendance['steps'].'</li>', $attendance_step_bonus, $attendance_max_bonus);
|
||||
echo '<li><ol>';
|
||||
foreach($attendance_continuous_bonus as $day => $value){
|
||||
printf('<li>'.$lang_attendance['continuous'].'</li>', $day, $value);
|
||||
}
|
||||
echo '</ol></li>';
|
||||
echo '</ul>';
|
||||
end_main_frame();
|
||||
stdfoot();
|
||||
}else{
|
||||
stderr($lang_attendance['sorry'], $lang_attendance['already_attended']);
|
||||
}
|
||||
@@ -372,3 +372,15 @@ document.getElementById("giftselect").disabled = true;
|
||||
document.getElementById("giftcustom").disabled = false;
|
||||
}
|
||||
}
|
||||
// settings.php
|
||||
function NewRow(anchor,up){
|
||||
var thisRow = anchor.parentNode.parentNode;
|
||||
var newRow = thisRow.cloneNode(true);
|
||||
var InputBoxes = newRow.getElementsByTagName("input");
|
||||
for(i=0; i<InputBoxes.length; i++) InputBoxes.item(i).value = "";
|
||||
var position = up ? "beforeBegin" : "afterEnd";
|
||||
thisRow.insertAdjacentElement(position,newRow);
|
||||
}
|
||||
function DelRow(anchor){
|
||||
anchor.parentNode.parentNode.parentNode.parentNode.deleteRow(anchor.parentNode.parentNode.rowIndex);
|
||||
}
|
||||
@@ -91,12 +91,20 @@ elseif ($action == 'savesettings_code') // save database
|
||||
elseif ($action == 'savesettings_bonus') // save bonus
|
||||
{
|
||||
stdhead($lang_settings['head_save_bonus_settings']);
|
||||
$validConfig = array('donortimes','perseeding','maxseeding','tzero','nzero','bzero','l', 'uploadtorrent','uploadsubtitle','starttopic','makepost','addcomment','pollvote','offervote', 'funboxvote','saythanks','receivethanks','funboxreward','onegbupload','fivegbupload','tengbupload', 'ratiolimit','dlamountlimit','oneinvite','customtitle','vipstatus','bonusgift', 'basictax', 'taxpercentage', 'prolinkpoint', 'prolinktime');
|
||||
$validConfig = array('donortimes','perseeding','maxseeding','tzero','nzero','bzero','l', 'uploadtorrent','uploadsubtitle','starttopic','makepost','addcomment','pollvote','offervote', 'funboxvote','saythanks','receivethanks','funboxreward','onegbupload','fivegbupload','tengbupload', 'ratiolimit','dlamountlimit','oneinvite','customtitle','vipstatus','bonusgift', 'basictax', 'taxpercentage', 'prolinkpoint', 'prolinktime', 'attendance_initial', 'attendance_step', 'attendance_max');
|
||||
GetVar($validConfig);
|
||||
$BONUS = [];
|
||||
foreach($validConfig as $config) {
|
||||
$BONUS[$config] = $$config ?? null;
|
||||
}
|
||||
$BONUS['attendance_continuous'] = array();
|
||||
if(count($_POST['attendance_continuous_day']) == count($_POST['attendance_continuous_value'])){
|
||||
foreach($_POST['attendance_continuous_day'] as $k => $day){
|
||||
$value = (int) $_POST['attendance_continuous_value'][$k];
|
||||
if($day > 0 && $value > 0) $BONUS['attendance_continuous'][$day] = $value;
|
||||
}
|
||||
}
|
||||
ksort($BONUS['attendance_continuous']);
|
||||
saveSetting('bonus', $BONUS);
|
||||
$actiontime = date("F j, Y, g:i a");
|
||||
write_log("Tracker bonus settings updated by $CURUSER[username]. $actiontime",'mod');
|
||||
@@ -510,6 +518,24 @@ elseif ($action == 'bonussettings'){
|
||||
tr($lang_settings['row_vip_status'],$lang_settings['text_it_costs_user']."<input type='text' style=\"width: 50px\" name=vipstatus value='".(isset($BONUS["vipstatus"]) ? $BONUS["vipstatus"] : 8000 )."'>".$lang_settings['text_vip_status_note'], 1);
|
||||
yesorno($lang_settings['row_allow_giving_bonus_gift'], 'bonusgift', $BONUS["bonusgift"], $lang_settings['text_giving_bonus_gift_note']);
|
||||
tr($lang_settings['row_bonus_gift_tax'], $lang_settings['text_system_charges']."<input type='text' style=\"width: 50px\" name='basictax' value='".(isset($BONUS["basictax"]) ? $BONUS["basictax"] : 5 )."'>".$lang_settings['text_bonus_points_plus']."<input type='text' style=\"width: 50px\" name='taxpercentage' value='".(isset($BONUS["taxpercentage"]) ? $BONUS["taxpercentage"] : 10 )."'>".$lang_settings['text_bonus_gift_tax_note'], 1);
|
||||
echo '<tr><td colspan="2" align="center"><b>签到奖励</b></td></tr>';
|
||||
tr('初始奖励',sprintf('首次签到获得 <input type="number" style="width: 30px" name="attendance_initial" value="%u" min="0" /> 个魔力值。', $attendance_initial_bonus),true);
|
||||
tr('奖励增量',sprintf('每次签到增加 <input type="number" style="width: 30px" name="attendance_step" value="%u" min="0" /> 个魔力值。', $attendance_step_bonus),true);
|
||||
tr('奖励上限',sprintf('签到奖励最高 <input type="number" style="width: 50px" name="attendance_max" value="%u" min="0" /> 个魔力值。', $attendance_max_bonus),true);
|
||||
$row = '<table><tr><td class="colhead">连续签到天数</td><td class="colhead">附加奖励</td><td class="colhead">操作</td></tr>'.PHP_EOL;
|
||||
if(is_array($attendance_continuous_bonus)){
|
||||
foreach($attendance_continuous_bonus as $days => $value){
|
||||
$row .= sprintf('<tr>
|
||||
<td><input type="number" min="0" style="width: 40px" name="attendance_continuous_day[]" value="%u" /> 天</td>
|
||||
<td><input type="number" min="0" style="width: 50px;" name="attendance_continuous_value[]" value="%u" /> 魔力值</td>
|
||||
<td><a href="javascript:;" onclick="DelRow(this);">删除</a></td></tr>', $days, $value);
|
||||
}
|
||||
}
|
||||
$row .= '<tr><td colspan="3">请从小到大添加规则。</td></tr><tr>
|
||||
<td><input type="number" min="0" style="width: 40px" name="attendance_continuous_day[]" value="" /> 天</td>
|
||||
<td><input type="number" min="0" style="width: 50px;" name="attendance_continuous_value[]" value="" /> 魔力值</td>
|
||||
<td><a href="javascript:;" onclick="NewRow(this,false);">添加</a></td></tr></table>';
|
||||
tr('连续签到',$row,true);
|
||||
tr($lang_settings['row_save_settings'], "<input type='submit' name='save' value='".$lang_settings['submit_save_settings']."'>", 1);
|
||||
print ("</form>");
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//if (!in_array($finished, $allowed_finished)){$limit = "finish = 'no'";(get_user_class() >= 13?$limitorder="Totalreq DESC ,":"");}
|
||||
//if (!in_array($finished, $allowed_finished)){$limit = "finish = 'no'";(get_user_class() >= UC_UPLOADER?$limitorder="Totalreq DESC ,":"");}
|
||||
//else $limit = ( $finished=="all" ? "1" : ( $finished=="all" ? "1" : "finish ='".$finished."'"));
|
||||
|
||||
|
||||
@@ -111,46 +111,46 @@ else {
|
||||
if (is_numeric($_GET["id"])) {
|
||||
$id = $_GET["id"];
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_GET["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("错误", "ID不存在");
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], $lang_functions['std_target_not_exists']);
|
||||
else $arr = mysql_fetch_assoc($res);
|
||||
stdhead("求种区");
|
||||
print("<h1 align=center id=top>求种-" . htmlspecialchars($arr["request"]) . "</h1>\n");
|
||||
stdhead($lang_viewrequests['page_title']);
|
||||
print("<h1 align=center id=top>{$lang_viewrequests['request']}-" . htmlspecialchars($arr["request"]) . "</h1>\n");
|
||||
print("<table width=940 cellspacing=0 cellpadding=5>\n");
|
||||
$res = sql_query("SELECT * FROM resreq WHERE reqid ='" . $_GET["id"] . "'" . $limit) or sqlerr(__FILE__, __LINE__);
|
||||
tr("基本信息", get_username($arr['userid']) . "发表于" . gettime($arr["added"], true, false) . "\n", 1);
|
||||
tr("悬赏", "最新竞价为" . $arr['amount'] . " 原始竞价为" . $arr["ori_amount"] . "\n", 1);
|
||||
tr("操作", "<a href='report.php?reportrequestid=" . $id . "' >举报</a>" .
|
||||
(($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13) && $arr["finish"] == "no" ? " | <a href='viewrequests.php?action=edit&id=" . $id . "' >编辑</a>" : "") . "\n" .
|
||||
($arr['userid'] == $CURUSER['id'] || $arr["finish"] == "yes" ? "" : " | <a href='viewrequests.php?action=res&id=" . $id . "' >应求</a>\n") .
|
||||
((get_user_class() >= 13 || $arr['userid'] == $CURUSER['id']) && $arr['finish'] == "no" ? " | <a href='viewrequests.php?action=delete&id=" . $id . "' " . (mysql_num_rows($res) ? ">删除" : "title='回收返还80%魔力值'>回收") . "</a>" : "") . "\n"
|
||||
tr($lang_viewrequests['basic_info'], get_username($arr['userid']) . $lang_viewrequests['created_at'] . gettime($arr["added"], true, false) . "\n", 1);
|
||||
tr($lang_viewrequests['reward'], $lang_viewrequests['newest_bidding'] . $arr['amount'] . " {$lang_viewrequests['original_bidding']}" . $arr["ori_amount"] . "\n", 1);
|
||||
tr($lang_functions['std_action'], "<a href='report.php?reportrequestid=" . $id . "' >{$lang_functions['std_report']}</a>" .
|
||||
(($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER) && $arr["finish"] == "no" ? " | <a href='viewrequests.php?action=edit&id=" . $id . "' >{$lang_functions['title_edit']}</a>" : "") . "\n" .
|
||||
($arr['userid'] == $CURUSER['id'] || $arr["finish"] == "yes" ? "" : " | <a href='viewrequests.php?action=res&id=" . $id . "' >{$lang_viewrequests['on_request']}</a>\n") .
|
||||
((get_user_class() >= UC_UPLOADER || $arr['userid'] == $CURUSER['id']) && $arr['finish'] == "no" ? " | <a href='viewrequests.php?action=delete&id=" . $id . "' " . (mysql_num_rows($res) ? ">{$lang_functions['title_delete']}" : "title='{$lang_viewrequests['recycle_title']}'>{$lang_viewrequests['recycle']}") . "</a>" : "") . "\n"
|
||||
, 1);
|
||||
if ($arr["finish"] == "no") tr("追加悬赏", "<form action=viewrequests.php method=post> <input type=hidden name=action value=addamount><input type=hidden name=reqid value=" . $arr["id"] . "><input size=6 name=amount value=1000 ><input type=submit value=提交 > 追加悬赏每次将扣减25个魔力值作为手续费</form>", 1);
|
||||
tr("介绍", format_comment(unesc($arr["descr"])), 1);
|
||||
if ($arr["finish"] == "no") tr($lang_viewrequests['add_reward'], "<form action=viewrequests.php method=post> <input type=hidden name=action value=addamount><input type=hidden name=reqid value=" . $arr["id"] . "><input size=6 name=amount value=1000 ><input type=submit value={$lang_functions['submit_submit']} > {$lang_viewrequests['add_reward_desc']}</form>", 1);
|
||||
tr($lang_functions['std_desc'], format_comment(unesc($arr["descr"])), 1);
|
||||
$limit = ($arr['finish'] == "no" ? "" : " AND chosen = 'yes' ");
|
||||
$ress = "";
|
||||
if (mysql_num_rows($res) == 0) $ress = "还没有应求";
|
||||
if (mysql_num_rows($res) == 0) $ress = $lang_viewrequests['no_request_yet'];
|
||||
else {
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13)
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER)
|
||||
$ress .= "<form action=viewrequests.php method=post>\n<input type=hidden name=action value=confirm > <input type=hidden name=id value=" . $id . " >\n";
|
||||
while ($row = mysql_fetch_array($res)) {
|
||||
$each = mysql_fetch_assoc(sql_query("SELECT * FROM torrents WHERE id = '" . $row["torrentid"] . "'"));
|
||||
if (mysql_num_rows(sql_query("SELECT * FROM torrents WHERE id = '" . $row["torrentid"] . "'")) == 1)
|
||||
$ress .= (($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13) && $arr['finish'] == "no" ? "<input type=checkbox name=torrentid[] value=" . $each["id"] . ">" : "") . "<a href='details.php?id=" . $each["id"] . "&hit=1' >" . $each["name"] . "</a> " . ($arr['finish'] == "no" ? "" : "by " . get_username($each[owner])) . "<br/>\n";
|
||||
$ress .= (($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER) && $arr['finish'] == "no" ? "<input type=checkbox name=torrentid[] value=" . $each["id"] . ">" : "") . "<a href='details.php?id=" . $each["id"] . "&hit=1' >" . $each["name"] . "</a> " . ($arr['finish'] == "no" ? "" : "by " . get_username($each[owner])) . "<br/>\n";
|
||||
}
|
||||
$ress .= "";
|
||||
|
||||
if (($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13) && $arr['finish'] == "no")
|
||||
$ress .= "<input type=submit value=使用勾选的资源作为所需资源>\n";
|
||||
if (($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER) && $arr['finish'] == "no")
|
||||
$ress .= "<input type=submit value={$lang_viewrequests['btn_select_text']}>\n";
|
||||
$ress .= "</form>\n";
|
||||
}
|
||||
tr("应求", $ress, 1);
|
||||
tr($lang_viewrequests['request'], $ress, 1);
|
||||
print("</table><br/><br/>\n");
|
||||
|
||||
|
||||
$count = get_row_count("comments", "WHERE request=" . sqlesc($_GET["id"]));
|
||||
if ($count) {
|
||||
print("<br /><br />");
|
||||
print("<h1 align=\"center\" id=\"startcomments\">评论</h1>\n");
|
||||
print("<h1 align=\"center\" id=\"startcomments\">{$lang_functions['std_comment']}</h1>\n");
|
||||
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "viewrequests.php?action=view&id=" . $_GET["id"] . "&", array('lastpagedefault' => 1), "page");
|
||||
|
||||
$subres = sql_query("SELECT * FROM comments WHERE request=" . sqlesc($_GET["id"]) . " ORDER BY id $limit") or sqlerr(__FILE__, __LINE__);
|
||||
@@ -170,70 +170,70 @@ else {
|
||||
<tr><td class=\"text\" align=\"center\"><b>" . $lang_details['text_quick_comment'] . "</b><br /><br />
|
||||
<form id=\"compose\" name=\"comment\" method=\"post\" action=\"" . htmlspecialchars("comment.php?action=add&type=request") . "\" onsubmit=\"return postvalid(this);\">
|
||||
<input type=\"hidden\" name=\"pid\" value=\"" . $id . "\" /><br />");
|
||||
quickreply('comment', 'body', "添加");
|
||||
quickreply('comment', 'body', $lang_functions['std_quick_comment']);
|
||||
print("</form></td></tr></table>");
|
||||
|
||||
|
||||
print ("
|
||||
|
||||
<a class=\"index\" href='comment.php?action=add&pid=$id&type=request'>添加评论</a></td></tr></table>");
|
||||
<a class=\"index\" href='comment.php?action=add&pid=$id&type=request'>{$lang_functions['title_add_comments']}</a></td></tr></table>");
|
||||
|
||||
stdfoot();
|
||||
|
||||
} else stderr("出错了!!!", "ID不存在");
|
||||
} else stderr($lang_functions['std_error'], $lang_functions['std_target_not_exists']);
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
case "edit":
|
||||
{
|
||||
if (!is_numeric($_GET["id"])) stderr("出错了!!!", "求种ID必须为数字");
|
||||
if (!is_numeric($_GET["id"])) stderr($lang_functions['std_error'], $lang_functions['std_target_not_exists']);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_GET["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!");
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], $lang_functions['std_target_not_exists']);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if ($arr["finish"] == "yes") stderr("出错了!", "该求种已完成!");
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13) {
|
||||
stdhead("编辑求种");
|
||||
if ($arr["finish"] == "yes") stderr($lang_functions['std_error'], $lang_viewrequests['request_already_resolved']);
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER) {
|
||||
stdhead($lang_functions['title_edit'] . $lang_viewrequests['request']);
|
||||
print(
|
||||
"<form id=edit method=post name=edit action=viewrequests.php >\n
|
||||
<input type=hidden name=action value=takeedit >
|
||||
<input type=hidden name=reqid value=" . $_GET["id"] . " >
|
||||
");
|
||||
print("<table width=940 cellspacing=0 cellpadding=3><tr><td class=colhead align=center colspan=2>编辑求种</td></tr>");
|
||||
tr("标题:", "<input name=request value=\"" . $arr["request"] . "\" size=134 ><br/>", 1);
|
||||
print("<tr><td class=rowhead align=right valign=top><b>介绍:</b></td><td class=rowfollow align=left>");
|
||||
print("<table width=940 cellspacing=0 cellpadding=3><tr><td class=colhead align=center colspan=2>{$lang_functions['title_edit']}{$lang_viewrequests['request']}</td></tr>");
|
||||
tr("{$lang_functions['col_name']}:", "<input name=request value=\"" . $arr["request"] . "\" size=134 ><br/>", 1);
|
||||
print("<tr><td class=rowhead align=right valign=top><b>{$lang_functions['std_desc']}:</b></td><td class=rowfollow align=left>");
|
||||
textbbcode("edit", "descr", $arr["descr"]);
|
||||
print("</td></tr>");
|
||||
print("</td></tr><tr><td class=toolbox align=center colspan=2><input id=qr type=submit class=btn value=编辑求种 ></td></tr></table></form><br />\n");
|
||||
print("</td></tr><tr><td class=toolbox align=center colspan=2><input id=qr type=submit class=btn value={$lang_functions['text_edit']}{$lang_viewrequests['request']} ></td></tr></table></form><br />\n");
|
||||
stdfoot();
|
||||
die;
|
||||
} else stderr("出错了!!!", "你没有该权限!!!<a href='viewrequests.php?action=view&id=" . $_GET["id"] . "'>点击这里返回</a>", 0);
|
||||
} else stderr($lang_functions['std_error'], "{$lang_functioins['std_permission_denied']}<a href='viewrequests.php?action=view&id=" . $_GET["id"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
}
|
||||
|
||||
case "new":
|
||||
{
|
||||
if (get_user_class() >= 1) {
|
||||
stdhead("新增求种");
|
||||
stdhead($lang_viewrequests['add_request']);
|
||||
print(
|
||||
"<form id=edit method=post name=edit action=viewrequests.php >\n<input type=hidden name=action value=takeadded >\n");
|
||||
print("<table width=940 cellspacing=0 cellpadding=3><tr><td class=colhead align=center colspan=2>新增求种</td></tr>\n");
|
||||
tr("标题:", "<input name=request size=134><br/>", 1);
|
||||
tr("悬赏:", "<input name=amount size=11 value=2000>赏金不得低于100魔力值,每次求种将扣去100魔力值作为手续费。<br/>", 1);
|
||||
print("<tr><td class=rowhead align=right valign=top><b>介绍:</b></td><td class=rowfollow align=left>");
|
||||
print("<table width=940 cellspacing=0 cellpadding=3><tr><td class=colhead align=center colspan=2>{$lang_viewrequests['add_request']}</td></tr>\n");
|
||||
tr("{$lang_functions['col_name']}:", "<input name=request size=134><br/>", 1);
|
||||
tr("{$lang_viewrequests['reward']}:", "<input name=amount size=11 value=2000>{$lang_viewrequests['add_request_desc']}<br/>", 1);
|
||||
print("<tr><td class=rowhead align=right valign=top><b>{$lang_functions['std_desc']}:</b></td><td class=rowfollow align=left>");
|
||||
textbbcode("edit", "descr", $arr["descr"]);
|
||||
print("</td></tr>");
|
||||
print("<tr><td class=toolbox style=vertical-align: middle; padding-top: 10px; padding-bottom: 10px; align=center colspan=2><input id=qr type=submit value=新增求种 class=btn /></td></tr></table></form><br />\n");
|
||||
print("<tr><td class=toolbox style=vertical-align: middle; padding-top: 10px; padding-bottom: 10px; align=center colspan=2><input id=qr type=submit value={$lang_viewrequests['add_request']} class=btn /></td></tr></table></form><br />\n");
|
||||
|
||||
stdfoot();
|
||||
die;
|
||||
} else stderr("出错了!!!", "你没有该权限!!!<a href='viewrequests.php'>点击这里返回</a>", 0);
|
||||
} else stderr($lang_functions['std_error'], "{$lang_functions['std_permission_denied']}<a href='viewrequests.php'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
}
|
||||
|
||||
case "newmessage":
|
||||
{
|
||||
|
||||
{
|
||||
stdhead("回复");
|
||||
stdhead($lang_functions['text_reply']);
|
||||
|
||||
|
||||
//<input type=hidden name=id value=$id ><br />");
|
||||
@@ -249,12 +249,12 @@ else {
|
||||
|
||||
print("<tr><td class=rowfollow align=left>");
|
||||
if ($ruserid) {
|
||||
textbbcode("reply", "message", "[b]回复:" . get_plain_username($ruserid) . "[/b]\n");
|
||||
textbbcode("reply", "message", "[b]{$lang_functions['text_reply']}:" . get_plain_username($ruserid) . "[/b]\n");
|
||||
print("<input id=ruserid type=hidden value=$ruserid />");
|
||||
} else
|
||||
textbbcode("reply", "message");
|
||||
print("</td></tr>");
|
||||
print("</table><input id=qr type=submit value=添加评论 class=btn /></form><br />\n");
|
||||
print("</table><input id=qr type=submit value={$lang_functions['title_add_comments']} class=btn /></form><br />\n");
|
||||
|
||||
stdfoot();
|
||||
die;
|
||||
@@ -265,15 +265,15 @@ else {
|
||||
{
|
||||
|
||||
{
|
||||
stdhead("搜索");
|
||||
stdhead($lang_functions['text_search']);
|
||||
|
||||
|
||||
print("<table border=1 cellspacing=0 cellpadding=5>\n");
|
||||
print("<tr><td class=colhead align=left>搜索</td></tr>\n");
|
||||
print("<tr><td class=colhead align=left>{$lang_functions['text_search']}</td></tr>\n");
|
||||
print("<tr><td class=toolbox align=left><form method=\"post\" action='viewrequests.php'>\n");
|
||||
print("<input type=\"text\" name=\"query\" style=\"width:500px\" >\n");
|
||||
print("<input type=\"hidden\" name=\"action\" value='list'>");
|
||||
print("<input type=submit value='搜索'></form>\n");
|
||||
print("<input type=submit value='{$lang_functions['text_search']}'></form>\n");
|
||||
print("</td></tr></table><br />\n");
|
||||
|
||||
|
||||
@@ -284,52 +284,52 @@ else {
|
||||
}
|
||||
case "takeadded":
|
||||
{
|
||||
if (!$_POST["descr"]) stderr("出错了!", "介绍未填!<a href='viewrequests.php?action=new'>点击这里返回</a>", 0);
|
||||
if (!$_POST["request"]) stderr("出错了!", "名称未填!<a href='viewrequests.php?action=new'>点击这里返回</a>", 0);
|
||||
if (!$_POST["amount"]) stderr("出错了!", "赏金未填!<a href='viewrequests.php?action=new'>点击这里返回</a>", 0);
|
||||
if (!is_numeric($_POST["amount"])) stderr("出错了!!!", "赏金必须为数字!<a href=viewrequests.php?action=new>点击这里返回</a>", 0);
|
||||
if (!$_POST["descr"]) stderr($lang_functions['std_error'], "{$lang_viewrequests['description_required']}<a href='viewrequests.php?action=new'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (!$_POST["request"]) stderr($lang_functions['std_error'], "{$lang_viewrequests['name_required']}<a href='viewrequests.php?action=new'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (!$_POST["amount"]) stderr($lang_functions['std_error'], "{$lang_viewrequests['amount_required']}<a href='viewrequests.php?action=new'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (!is_numeric($_POST["amount"])) stderr($lang_functions['std_error'], "{$lang_viewrequests['amount_must_be_numeric']}<a href=viewrequests.php?action=new>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$amount = $_POST["amount"];
|
||||
if ($amount < 100) stderr("出错了!", "发布求种赏金不得小于100个魔力值!<a href='viewrequests.php?action=new'>点击这里返回</a>", 0);
|
||||
if ($amount > 10000) stderr("出错了!", "发布求种赏金不得大于10000个魔力值!<a href='viewrequests.php?action=new'>点击这里返回</a>", 0);
|
||||
if ($amount < 100) stderr($lang_functions['std_error'], "{$lang_viewrequests['add_request_amount_minimum']}<a href='viewrequests.php?action=new'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if ($amount > 10000) stderr($lang_functions['std_error'], "{$lang_viewrequests['add_request_amount_maximum']}<a href='viewrequests.php?action=new'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$amount += 100;
|
||||
if ($amount + 100 > $CURUSER['seedbonus']) stderr("出错了!", "你没有那么多魔力值!!!<a href='viewrequests.php?action=new'>点击这里返回</a>", 0);
|
||||
if ($amount + 100 > $CURUSER['seedbonus']) stderr($lang_functions['std_error'], "{$lang_viewrequests['bouns_not_enough']}<a href='viewrequests.php?action=new'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (get_user_class() >= 1) {
|
||||
sql_query("UPDATE users SET seedbonus = seedbonus - " . $amount . " WHERE id = " . $CURUSER['id']);
|
||||
sql_query("UPDATE users SET seedbonus = seedbonus - " . $amount . " WHERE id = " . sqlesc($CURUSER['id']));
|
||||
sql_query("INSERT requests ( request , descr, ori_descr ,amount , ori_amount , userid ,added ) VALUES ( " . sqlesc($_POST["request"]) . " , " . sqlesc($_POST["descr"]) . " , " . sqlesc($_POST["descr"]) . " , " . sqlesc($_POST["amount"]) . " , " . sqlesc($_POST["amount"]) . " , " . sqlesc($CURUSER['id']) . " , '" . date("Y-m-d H:i:s") . "' )") or sqlerr(__FILE__, __LINE__);
|
||||
// shoutbox_into('[rid' . ($id = mysql_insert_id()) . ']');
|
||||
$id = mysql_insert_id();
|
||||
stderr("成功", "新增求种成功,<a href='viewrequests.php?action=view&id=" . $id . "'>点击这里返回</a>", 0);
|
||||
} else stderr("出错了!!!", "你没有该权限!!!<a href='viewrequests.php'>点击这里返回</a>", 0);
|
||||
stderr($lang_functions['std_success'], "{$lang_viewrequests['add_request_success']},<a href='viewrequests.php?action=view&id=" . $id . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
} else stderr($lang_functions['std_error'], "{$lang_functions['std_permission_denied']}<a href='viewrequests.php'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
case "takeedit":
|
||||
{
|
||||
if (!is_numeric($_POST["reqid"])) stderr("出错了!!!", "求种ID必须为数字!<a href='viewrequests.php?action=edit&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_POST["reqid"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (!$_POST["descr"]) stderr("出错了!!!", "介绍未填!<a href='viewrequests.php?action=edit&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if (!$_POST["request"]) stderr("出错了!!!", "名称未填!<a href='viewrequests.php?action=edit&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!<a href='viewrequests.php'>点击这里返回</a>", 0);
|
||||
if (!is_numeric($_POST["reqid"])) stderr($lang_functions['std_error'], "{$lang_viewrequests['request_id_must_be_numeric']}<a href='viewrequests.php?action=edit&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . sqlesc( $_POST["reqid"]) . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (!$_POST["descr"]) stderr($lang_functions['std_error'], "{$lang_viewrequests['description_required']}<a href='viewrequests.php?action=edit&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (!$_POST["request"]) stderr($lang_functions['std_error'], "{$lang_viewrequests['name_required']}<a href='viewrequests.php?action=edit&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], "{$lang_viewrequests['request_deleted']}<a href='viewrequests.php'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if ($arr["finish"] == "yes") stderr("出错了!", "该求种已完成!<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13) {
|
||||
sql_query("UPDATE requests SET descr = " . sqlesc($_POST["descr"]) . " , request = " . sqlesc($_POST["request"]) . " WHERE id ='" . $_POST["reqid"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
stderr("成功", "编辑成功,<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
} else stderr("出错了!!!", "你没有该权限!!!<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if ($arr["finish"] == "yes") stderr($lang_functions['std_error'], "{$lang_viewrequests['request_already_resolved']}<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER) {
|
||||
sql_query("UPDATE requests SET descr = " . sqlesc($_POST["descr"]) . " , request = " . sqlesc($_POST["request"]) . " WHERE id ='" . sqlesc($_POST["reqid"]) . "'") or sqlerr(__FILE__, __LINE__);
|
||||
stderr($lang_functions['std_success'], "{$lang_viewrequests['edit_request_success']},<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
} else stderr($lang_functions['std_error'], "{$lang_functions['std_permission_denied']}<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
case "res":
|
||||
{
|
||||
stdhead("应求");
|
||||
stdmsg("我要应求", "
|
||||
stdhead($lang_viewrequests['request']);
|
||||
stdmsg($lang_viewrequests['do_request'], "
|
||||
<form action=viewrequests.php method=post>
|
||||
<input type=hidden name=action value=takeres />
|
||||
<input type=hidden name=reqid value=\"" . $_GET["id"] . "\" />
|
||||
请输入种子的ID:http://$BASEURL/details.php?id=<input type=text name=torrentid size=11/>
|
||||
<input type=submit value=提交></form><a href='viewrequests.php?action=view&id=" . $_GET["id"] . "'>点击这里返回</a>", 0);
|
||||
{$lang_viewrequests['type_in_torrent_id']}:http://$BASEURL/details.php?id=<input type=text name=torrentid size=11/>
|
||||
<input type=submit value={$lang_functions['submit_submit']}></form><a href='viewrequests.php?action=view&id=" . $_GET["id"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
stdfoot();
|
||||
die;
|
||||
break;
|
||||
@@ -337,80 +337,80 @@ else {
|
||||
|
||||
case "takeres":
|
||||
{
|
||||
if (!is_numeric($_POST["reqid"])) stderr("出错了!!!", "不要试图入侵系统!");
|
||||
if (!is_numeric($_POST["reqid"])) stderr($lang_functions['std_error'], $lang_viewrequests['request_id_must_be_numeric']);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_POST["reqid"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!<a href='viewrequests.php'>点击这里返回</a>", 0);
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], "{$lang_viewrequests['request_deleted']}<a href='viewrequests.php'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if ($arr["finish"] == "yes") stderr("出错了!", "该求种已完成!<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if (!is_numeric($_POST["torrentid"])) stderr("出错了!!!", "种子ID必须为数字!<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if ($arr["finish"] == "yes") stderr($lang_functions['std_error'], "{$lang_viewrequests['request_already_resolved']}<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (!is_numeric($_POST["torrentid"])) stderr($lang_functions['std_error'], "{$lang_viewrequests['request_id_must_be_numeric']}<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$res = sql_query("SELECT * FROM torrents WHERE id ='" . $_POST["torrentid"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该种子不存在!<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], "{$lang_functions['std_target_not_exists']}<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
$tor = mysql_fetch_assoc($res);
|
||||
if ($tor[last_seed] == "0000-00-00 00:00:00") stderr("出错了!!!", "该种子尚未正式发布!<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
if ($tor[last_seed] == "0000-00-00 00:00:00") stderr($lang_functions['std_error'], "{$lang_viewrequests['torrent_not_release_yet']}<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
if (get_row_count('resreq', "where reqid ='" . $_POST["reqid"] . "' and torrentid='" . $_POST["torrentid"] . "'"))
|
||||
stderr("出错了!!!", "该应求已经存在!<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
stderr($lang_functions['std_error'], "{$lang_viewrequests['supply_already_exists']}<a href='viewrequests.php?action=res&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
sql_query("INSERT resreq (reqid , torrentid) VALUES ( '" . $_POST["reqid"] . "' , '" . $_POST["torrentid"] . "')");
|
||||
|
||||
|
||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||
$subject = sqlesc("有人应求你的求种请求,请及时确认该应求");
|
||||
$notifs = sqlesc("求种名称:[url=viewrequests.php?id=$arr[id]] " . $arr['request'] . "[/url],请及时确认该应求.");
|
||||
$subject = sqlesc($lang_viewrequests['message_please_confirm_supply']);
|
||||
$notifs = sqlesc("{$lang_viewrequests['request_name']}:[url=viewrequests.php?id=$arr[id]] " . $arr['request'] . "[/url],{$lang_viewrequests['please_confirm_supply']}.");
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $arr['userid'] . ", $subject, $notifs, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
|
||||
stderr("成功", "应求成功,<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
stderr($lang_functions['std_success'], "{$lang_viewrequests['supply_success']},<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
case "addamount":
|
||||
{
|
||||
if (!is_numeric($_POST["reqid"])) stderr("出错了!!!", "不要试图入侵系统");
|
||||
if (!is_numeric($_POST["reqid"])) stderr($lang_functions['std_error'], $lang_viewrequests['request_id_must_be_numeric']);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_POST["reqid"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!");
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], $lang_viewrequests['request_deleted']);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if ($arr["finish"] == "yes") stderr("出错了!", "该求种已完成!");
|
||||
if (!is_numeric($_POST["amount"])) stderr("出错了!", "赏金必须为数字!");
|
||||
if ($arr["finish"] == "yes") stderr($lang_functions['std_error'], $lang_viewrequests['request_already_resolved']);
|
||||
if (!is_numeric($_POST["amount"])) stderr($lang_functions['std_error'], $lang_viewrequests['amount_must_be_numeric']);
|
||||
$amount = $_POST["amount"];
|
||||
if ($amount < 100) stderr("出错了!", "追加悬赏赏金不得小于100个魔力值!");
|
||||
if ($amount > 5000) stderr("出错了!", "追加悬赏赏金不得大于5000个魔力值!");
|
||||
if ($amount < 100) stderr($lang_functions['std_error'], $lang_viewrequests['add_reward_amount_minimum']);
|
||||
if ($amount > 5000) stderr($lang_functions['std_error'], $lang_viewrequests['add_reward_amount_maximum']);
|
||||
$amount += 25;
|
||||
if ($amount > $CURUSER['seedbonus']) stderr("出错了!", "你没有那么多魔力值!");
|
||||
if ($amount > $CURUSER['seedbonus']) stderr($lang_functions['std_error'], $lang_viewrequests['bouns_not_enough']);
|
||||
sql_query("UPDATE users SET seedbonus = seedbonus - " . $amount . " WHERE id = " . $CURUSER['id']);
|
||||
sql_query("UPDATE requests SET amount = amount + " . $_POST["amount"] . " WHERE id = " . $_POST["reqid"]);
|
||||
stderr("成功", "追加悬赏成功,<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>点击这里返回</a>", 0);
|
||||
stderr($lang_functions['std_success'], "{$lang_viewrequests['add_reward_success']},<a href='viewrequests.php?action=view&id=" . $_POST["reqid"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
case "delete":
|
||||
{
|
||||
if (!is_numeric($_GET["id"])) stderr("出错了!!!", "求种ID必须为数字");
|
||||
if (!is_numeric($_GET["id"])) stderr($lang_functions['std_error'], $lang_viewrequests['request_id_must_be_numeric']);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_GET["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!");
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], $lang_viewrequests['request_deleted']);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if (get_user_class() >= 13 || $arr['userid'] == $CURUSER["id"] && $arr['finish'] == 'no') {
|
||||
if (get_user_class() >= UC_UPLOADER || $arr['userid'] == $CURUSER["id"] && $arr['finish'] == 'no') {
|
||||
if (!get_row_count("resreq", "WHERE reqid=" . sqlesc($_GET["id"]))) {
|
||||
KPS("+", $arr['amount'] * 8 / 10, $arr['userid']);
|
||||
}
|
||||
sql_query("DELETE FROM requests WHERE id ='" . $_GET["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
sql_query("DELETE FROM resreq WHERE reqid ='" . $_GET["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
sql_query("DELETE FROM comments WHERE request ='" . $_GET["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
stderr("成功", "删除求种成功,<a href='viewrequests.php'>点击这里返回</a>", 0);
|
||||
} else stderr("出错了!!!", "你没有该权限!!!");
|
||||
stderr($lang_functions['std_success'], "{$lang_viewrequests['delete_request_success']},<a href='viewrequests.php'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
} else stderr($lang_functions['std_error'], "{$lang_functions['std_permission_denied']}");
|
||||
die;
|
||||
break;
|
||||
}
|
||||
|
||||
case "confirm":
|
||||
{
|
||||
if (!is_numeric($_POST["id"])) stderr("出错了!!!", "不要试图入侵系统");
|
||||
if (!is_numeric($_POST["id"])) stderr($lang_functions['std_error'], $lang_viewrequests['request_id_must_be_numeric']);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_POST["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!");
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], $lang_viewrequests['request_deleted']);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
if (empty($_POST["torrentid"])) stderr("出错了!", "你没有选择符合条件的应求!");
|
||||
if (empty($_POST["torrentid"])) stderr($lang_functions['std_error'], $lang_functions['std_target_not_exists']);
|
||||
else $torrentid = $_POST["torrentid"];
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= 13) {
|
||||
if ($arr['userid'] == $CURUSER['id'] || get_user_class() >= UC_UPLOADER) {
|
||||
$amount = $arr["amount"] / count($torrentid);
|
||||
sql_query("UPDATE requests SET finish = 'yes' WHERE id = " . $_POST["id"]);
|
||||
sql_query("UPDATE resreq SET chosen = 'yes' WHERE reqid = " . $_POST["id"] . " AND ( torrentid = '" . join("' OR torrentid = '", $torrentid) . "' )") or sqlerr(__FILE__, __LINE__);
|
||||
@@ -420,13 +420,13 @@ else {
|
||||
|
||||
$owner[] = $row[0];
|
||||
$added = sqlesc(date("Y-m-d H:i:s"));
|
||||
$subject = sqlesc("你的种子被人应求");
|
||||
$notifs = sqlesc("求种名称:[url=viewrequests.php?id=$arr[id]] " . $arr['request'] . "[/url].你获得: $amount 魔力值");
|
||||
$subject = sqlesc($lang_viewrequests['torrent_is_picked_for_request']);
|
||||
$notifs = sqlesc("{$lang_viewrequests['request_name']}:[url=viewrequests.php?id=$arr[id]] " . $arr['request'] . "[/url].{$lang_functions['std_you_will_get']}: $amount {$lang_functions['text_bonus']}");
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $row[0] . ", $subject, $notifs, $added)") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
}
|
||||
sql_query("UPDATE users SET seedbonus = seedbonus + $amount WHERE id = '" . join("' OR id = '", $owner) . "'") or sqlerr(__FILE__, __LINE__);
|
||||
stderr("成功", "确认成功,<a href='viewrequests.php?action=view&id=" . $_POST["id"] . "'>点击这里返回</a>", 0);
|
||||
stderr($lang_functions['std_success'], "{$lang_viewrequests['confirm_request_success']},<a href='viewrequests.php?action=view&id=" . $_POST["id"] . "'>{$lang_functions['std_click_here_to_goback']}</a>", 0);
|
||||
|
||||
}
|
||||
|
||||
@@ -434,13 +434,13 @@ else {
|
||||
|
||||
case "message":
|
||||
{
|
||||
if (!is_numeric($_POST["id"])) stderr("出错了!!!", "不要试图入侵系统");
|
||||
if (!is_numeric($_POST["id"])) stderr($lang_functions['std_error'], $lang_viewrequests['request_id_must_be_numeric']);
|
||||
$res = sql_query("SELECT * FROM requests WHERE id ='" . $_POST["id"] . "'") or sqlerr(__FILE__, __LINE__);
|
||||
if (mysql_num_rows($res) == 0) stderr("出错了!", "该求种已被删除!");
|
||||
if (!$_POST["message"]) stderr("出错了!", "留言不能为空!");
|
||||
if (mysql_num_rows($res) == 0) stderr($lang_functions['std_error'], $lang_viewrequests['request_deleted']);
|
||||
if (!$_POST["message"]) stderr($lang_functions['std_error'], $lang_viewrequests['message_required']);
|
||||
$arr = mysql_fetch_assoc($res);
|
||||
$message = $arr["message"];
|
||||
$message .= "<tr><td width=240>由" . $CURUSER["username"] . "添加于" . date("Y-m-d H:i:s") . "</td><td>" . $_POST["message"] . "</td></tr>";
|
||||
$message .= "<tr><td width=240>{$lang_functions['std_by']}" . $CURUSER["username"] . $lang_viewrequests['request_created_at']. date("Y-m-d H:i:s") . "</td><td>" . $_POST["message"] . "</td></tr>";
|
||||
|
||||
|
||||
//sql_query("UPDATE requests SET message = '".$message."' WHERE id = ".$_POST["id"])or sqlerr(__FILE__, __LINE__);
|
||||
@@ -448,10 +448,10 @@ else {
|
||||
//sql_query("INSERT reqcommen (user , added ,text ,reqid) VALUES ( '".$CURUSER["id"]."' , ".sqlesc(date("Y-m-d H:i:s"))." , ".sqlesc($_POST["message"])." , '".$_POST["id"]."' )");
|
||||
sql_query("INSERT INTO comments (user, request, added, text, ori_text) VALUES (" . $CURUSER["id"] . ",{$_POST['id']}, '" . date("Y-m-d H:i:s") . "', " . sqlesc($_POST["message"]) . "," . sqlesc($_POST["message"]) . ")");
|
||||
|
||||
if ($CURUSER["id"] <> $arr['userid']) sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $arr['userid'] . ", '你的求种请求收到新回复', " . sqlesc(" [url=viewrequests.php?action=view&id={$_POST['id']}] " . $arr['request'] . "[/url].") . ", " . sqlesc(date("Y-m-d H:i:s")) . ")") or sqlerr(__FILE__, __LINE__);
|
||||
if ($CURUSER["id"] <> $arr['userid']) sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $arr['userid'] . ", '{$lang_viewrequests['request_get_new_reply']}', " . sqlesc(" [url=viewrequests.php?action=view&id={$_POST['id']}] " . $arr['request'] . "[/url].") . ", " . sqlesc(date("Y-m-d H:i:s")) . ")") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
$ruserid = 0 + $_POST["ruserid"];
|
||||
if ($ruserid <> $CURUSER["id"] && $ruserid <> $arr['userid']) sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $ruserid . ", '你的求种评论收到新回复', " . sqlesc(" [url=viewrequests.php?action=view&id={$_POST['id']}] " . $arr['request'] . "[/url].") . ", " . sqlesc(date("Y-m-d H:i:s")) . ")") or sqlerr(__FILE__, __LINE__);
|
||||
if ($ruserid <> $CURUSER["id"] && $ruserid <> $arr['userid']) sql_query("INSERT INTO messages (sender, receiver, subject, msg, added) VALUES(0, " . $ruserid . ", '{$lang_viewrequests['request_comment_get_new_reply']}', " . sqlesc(" [url=viewrequests.php?action=view&id={$_POST['id']}] " . $arr['request'] . "[/url].") . ", " . sqlesc(date("Y-m-d H:i:s")) . ")") or sqlerr(__FILE__, __LINE__);
|
||||
|
||||
header("Location: viewrequests.php?action=view&id=" . $_POST['id']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user