die('抱歉,不允许对置顶的种子进行编辑'); } return $row; } if ($action == "prm") { //促销 $id = htmlspecialchars($_POST['torrentid']); $prmtype = htmlspecialchars($_POST['type']); $time = htmlspecialchars($_POST['time']); if (!preg_match("/^[\\d]{1,8}\$/", $id) || !preg_match("/^[\\d]{1,8}\$/", $time) || $prmtype < '2' || $prmtype > '7') { echo "再玩 ban了你"; die; } $torrentid = (int) $id; $prmtime = (int) $time; $record = checktorrent($torrentid); if (!$record) { echo "不要玩了,没有该ID的种子"; die; } if (((int) $record['sp_state'] == 2 || (int) $record['sp_state'] == 4) && (int) $record['endfree'] == 0) { if ($prmtype != "7") { echo "你在玩我么,该种子已经永久免费了"; die; } } $charge = 0; if ($prmtype == "2") { $charge = (int) $prmtime * $ycharge['setallfree']; if ($charge > $userbouns) { echo "麦粒不足,攒点麦粒再来吧^_^";
dbconn(); $res = get_torrent_downloaded(); echo "1111111</br>"; if (mysql_affected_rows()) { while ($item = mysql_fetch_array($res)) { // $fnam=iconv("gb2312//IGNORE","UTF-8",$item['filename']); $targetpath = $rss_torrent_path . "/test.torrent"; echo "" . $targetpath . "</br>"; $id = $item['id']; $dl_url = $item['dl_url']; echo "connecting to " . $dl_url . "\n"; if ($item['length'] > $size_filter + 0) { echo "torrent: " . $item['name'] . "size too big,skip download \n"; continue; } $fn = curlTool::downloadFile($dl_url, $targetpath); echo "goggo"; checktorrent($fn); $torrent = new Torrent($fn); $hash = $torrent->hash_info(); echo "torrent: " . $fn . " hash_info: " . $hash . "\n"; echo "updating torrent:" . $fn . ",id :" . $id . "\n"; $basename = basename($fn); $dest_file = $watch_path . $basename; if (!copy($fn, $dest_file)) { echo "copy torrent: " . $fn . "to dest: " . $watch_path . " fails \n"; } update_torrent_downloaded($id, $fn, $hash); } } mysql_free_result($res);