} } } } } if ($prmtype >= '2' && $prmtype <= '6') { $oritime = $record['endfree']; $deadline = date('Y-m-d H:i:s', time() + 86400 * $prmtime); if ($prmtime >= 39) { if ($discount < 0.8) { sql_query("UPDATE torrents SET endfree = '" . date('Y-m-d H:i:s', time() + 86400 * 7) . "'where id=" . $torrentid) or sqlerr(__FILE__, __LINE__); echo "but活动期间不允许购买永久,自动变更为7天。多的麦粒没收了~"; } else { echo "你购买了永久促销"; sql_query("UPDATE torrents SET endfree = '0000-00-00 00:00:00'where id=" . $torrentid) or sqlerr(__FILE__, __LINE__); } } else { sql_query("UPDATE torrents SET endfree = '" . $deadline . "'where id=" . $torrentid) or sqlerr(__FILE__, __LINE__); } } sql_query("UPDATE users SET seedbonus =seedbonus -" . $charge . " WHERE id = " . $userid) or sqlerr(__FILE__, __LINE__); //扣麦粒 sendshoutbox("土豪君[@{$CURUSER['username']}] 花了{$charge} 个麦粒给种子 [url=details.php?id={$torrentid}]{$record['name']}[/url] 购买了促销~来瞅瞅是什么种子吧"); writeBonusComment($CURUSER[id], "购买促销 ,花费麦粒{$charge}"); write_log("自助购买促销:" . $info); if ($CURUSER['id'] != $record['owner']) { sendMessage($CURUSER['id'], $record['owner'], "我替你的种子购买了促销", "{$CURUSER['username']} 花了{$charge} 个麦粒给种子 [url=details.php?id={$torrentid}]{$record['name']}[/url] 购买了促销\n {$info} \n 此站内信由系统代替用户发送"); } sql_query("Insert comments(user,torrent,added,text) values(11,{$torrentid},now()," . sqlesc("你好我是替系统来留言的[em12]\n" . $info) . ")") or sqlerr(__FILE__, __LINE__); } stdfoot();
} else { at_user_message($text,'','shoutbox'); if(preg_match( "/.*(滚|贱|sb|傻b|傻逼|猪|f**k|我操|艹|2b|靠|我日|痴|2b|2B|操你|tmd)/",$text)) sendshoutbox("[@$CURUSER[username]]:要注意文明用语啊亲(* ̄︿ ̄) ","","",$date+5); elseif(preg_match( "/.*(不(能|会)下载|跑流量|在哪下载)/",$text)) sendshoutbox("[@$CURUSER[username]]:不会下载或者跑流量到论坛搜一下相关帖子吧,页面底部有麦田专用μt下载哦亲o(* ̄▽ ̄*)o ","","",$date+5); elseif(preg_match( "/.*(求麦粒|求种|送点麦粒)/",$text)) sendshoutbox("[@$CURUSER[username]]:(o ‵-′)ノ禁止刷屏,禁止求麦粒,禁止求外站邀请码,禁止求种~~求邀请码请到[url=forums.php?action=viewforum&forumid=8]论坛邀请交流区[/url],求种请到[url=viewrequest.php]求种区[/url] 看一眼公告嘛,慢走不送(ˉ▽ ̄~) ","","",$date+5); } if (!$memcache->get('app_shoutbox_cleanup') or preg_match( "/\[\@$robot\](.*?)清屏/",$text)) { $memcache->set('app_shoutbox_cleanup','1',false,60*60*6) or die ("请向管理员报告此错误"); $cleanres = sql_query("SELECT * FROM shoutbox WHERE userid = 11"); sendshoutbox("清屏完成,出来冒个泡~我才不会卖萌呢~[url=steal.php]你偷过麦粒么[/url]~~~[url=getcardnum.php]你绑定学号了么[/url]~~[url=autofaq/]你有什么问题要问么[/url]","","",$date+5); while ($cleanrow = mysql_fetch_assoc($cleanres)) { if(preg_match( "/(.*?)我还小着呢/",$cleanrow[text]) or preg_match( "/(.*?)不要问我问题啦/",$cleanrow[text])or preg_match( "/(.*?)我不认识否定词哎/",$cleanrow[text])) {sql_query("DELETE FROM shoutbox WHERE id=$cleanrow[id]"); } } } print "<script type=\"text/javascript\">parent.document.forms['shbox'].shbox_text.value='';</script>"; } } $limit = ($CURUSER['sbnum'] ? $CURUSER['sbnum'] : 70); if ($where == "helpbox") {
function drawlotteryfun() { global $memcache; if (!$memcache) { require_once "./memcache.php"; } $hapcharge = 100; //预设单注价格 $cash = array(); $cash[1] = 5000000; $cash[2] = 500000; $cash[3] = 10000; $cash[4] = 1000; $cash[5] = 0; $cash[6] = 0; $lasttime = $memcache->get('drawnumtime'); if (((int) date('w') == 5 || (int) date('w') == 2) && (int) date('H') >= 21 && (int) time() - $lasttime >= 24 * 3600) { $memcache->set('drawnumtime', (int) time()); //echo time(); $date = date('Y-m-d', time()); $num1 = mt_rand(1, 12); $num2 = mt_rand(1, 12); $num3 = mt_rand(1, 12); $num4 = mt_rand(1, 12); $num5 = mt_rand(1, 12); sql_query("INSERT INTO drawlottery (num1, num2, num3, num4, num5,drawtime) VALUES ('{$num1}', '{$num2}', '{$num3}', '{$num4}', '{$num5}','{$date}')") or sqlerr(__FILE__, __LINE__); $sql = "SELECT MAX(id) from drawlottery"; $res = sql_query($sql); $row = mysql_fetch_array($res); $drawid = (int) $row['0']; $memcache->set('drawid', $drawid + 1); sendshoutbox("开奖啦开奖啦,彩票第{$drawid} 期选出了[color=red][b]{$num1} -- {$num2} -- {$num3} -- {$num4} -- {$num5} [/b][/color]五个数字~记名彩票已经发奖了,不记名的快来兑奖吧~分给我一半吧(口水 "); $sql = "SELECT * from lottery where drawid='" . $drawid . "' and ownerid!= '0'"; $res = sql_query($sql) or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_array($res)) { //sendshoutbox("口水 "); $userid = $row['ownerid']; $lotteryid = $row['id']; $lnum1 = $row['num1']; $lnum2 = $row['num2']; $lnum3 = $row['num3']; $lnum4 = $row['num4']; $lnum5 = $row['num5']; $multiple = $row['multiple']; $level = 6; if ($lnum1 == $num1) { $level = $level - 1; } if ($lnum2 == $num2) { $level = $level - 1; } if ($lnum3 == $num3) { $level = $level - 1; } if ($lnum4 == $num4) { $level = $level - 1; } if ($lnum5 == $num5) { $level = $level - 1; } //sendshoutbox("$level "); if ($level < 5) { $bonus = $cash[$level] * $multiple; $sql = "UPDATE users SET seedbonus =seedbonus +" . $bonus . " WHERE id = " . $userid; sql_query($sql) or sqlerr(__FILE__, __LINE__); sql_query("UPDATE lottery SET isencase ='{$level}' WHERE \tid = " . $lotteryid) or sqlerr(__FILE__, __LINE__); $date = date('Y-m-d', time()); sql_query("UPDATE lottery SET encasetime ='" . $date . "' WHERE id = " . $lotteryid) or sqlerr(__FILE__, __LINE__); sendMessage(0, $userid, "恭喜你中奖了", "恭喜你在彩票第{$drawid} 期中获得{$level} 等奖,获得麦粒{$bonus}"); writeBonusComment($userid, "彩票第{$drawid} 期中获得{$level} 等奖,获得麦粒{$bonus}"); //sendshoutbox("彩票第$drawid 期中获得$level 等奖,获得麦粒$bonus"); if ($level <= 4) { sendshoutbox("有人在彩票第{$drawid} 期中了{$level} 等奖,获得麦粒{$bonus} !!!!土豪~~快检查一下站内信看看是不是你吧,土豪来做朋友吧!", '', $date + 5); } } } } }
if ($lnum4 == $dnum4) { $level = $level - 1; } if ($lnum5 == $dnum5) { $level = $level - 1; } $bonus = $cash[$level] * $multiple; if ($level < 5) { $sql = "UPDATE users SET seedbonus =seedbonus +" . $bonus . " WHERE id = " . $userid; echo $sql; if (sql_query($sql) or sqlerr(__FILE__, __LINE__)) { sql_query("UPDATE lottery SET isencase ='{$level}' WHERE id = " . $drawid) or sqlerr(__FILE__, __LINE__); $date = $date = date('Y-m-d', time()); sql_query("UPDATE lottery SET encasetime ='" . $date . "' WHERE id = " . $drawid) or sqlerr(__FILE__, __LINE__); writeBonusComment($userid, "把第{$drawid} 期中了奖的不记名id为{$lotteryid} 的彩票兑了奖啦,得到了{$bonus} 个麦粒"); sendshoutbox("幸运儿[@{$CURUSER['username']}] 把第{$drawid} 期中了奖的不记名id为{$lotteryid} 的彩票兑了奖啦,得到了{$bonus} 个麦粒~~喂你站住,交个朋友怎么样"); } stdmsg("恭喜", "恭喜你在该期开奖中获得{$level} 等奖,倍注为{$multiple} 倍,获得麦粒{$bonus}" . "<br/>"); } } if ($action == "drawlog") { print "<h2>近50期开奖纪录</h2><table>\n\t<tr>\n<td class='colhead'>期数</td><td class='colhead'>NUM1</td><td class='colhead'>NUM2</td><td class='colhead'>NUM3</td><td class='colhead'>NUM4</td><td class='colhead'>NUM5</td><td class='colhead'>开奖日期</td>"; if (get_user_class() > 14) { echo "<td class='colhead'>中奖人数(右边数据站长以上可见,请保密</td><td class='colhead'>出</td><td class='colhead'>入</td><td class='colhead'>入-出</td>"; } echo "</tr>"; $sql = "select * from drawlottery order by id desc limit 0,50"; $res = sql_query($sql); while ($row = mysql_fetch_array($res)) { print "<tr><td>" . $row['id'] . "</td><td>" . $row['num1'] . "</td><td>" . $row['num2'] . "</td><td>" . $row['num3'] . "</td><td>" . $row['num4'] . "</td><td>" . $row['num5'] . "</td><td>" . $row['drawtime'] . "</td>"; if (get_user_class() > 14) {
// die; // } // if (!$arr[id]){ // stdmsg($lang_mybonus['text_error'], $lang_mybonus['text_receiver_not_exists'], 0); // stdfoot(); // die; // } sql_query("UPDATE users SET seedbonus = seedbonus - {$points}, bonuscomment = " . sqlesc($bonuscomment) . " WHERE id = " . sqlesc($userid)) or sqlerr(__FILE__, __LINE__); if ($arr[id] == 11) { $addup = $points * 3456543; $adddown = $addup / 4; $newreceiverbonuscomment = date("Y-m-d") . " + " . $points2receiver . " Points (after tax) as a gift from " . $CURUSER[username] . ".把他们变成了上传下载量,努力升级~\n" . htmlspecialchars($receiverbonuscomment); sql_query("UPDATE users SET bonuscomment = " . sqlesc($newreceiverbonuscomment) . ", last_access=now() , last_login=now(), uploaded = uploaded + {$addup} , downloaded = downloaded + {$adddown} WHERE id = " . sqlesc($arr[id])) or sqlerr(__FILE__, __LINE__); $addup = mksize($addup); $adddown = mksize($adddown); sendshoutbox("亲爱的[@{$CURUSER['username']}] 送了 {$points} 个麦粒给我(¯﹃¯) ,爱死你了~我增长了{$addup} 上传和{$adddown} 下载,我要努力升级,我可是要当站长的机器人ノ ̄ー ̄)ノ"); } else { sql_query("UPDATE users SET seedbonus = seedbonus + {$aftertaxpoint}, bonuscomment = " . sqlesc($newreceiverbonuscomment) . " WHERE id = " . sqlesc($arr[id])) or sqlerr(__FILE__, __LINE__); } //为saythanks开辟的渠道 start SamuraiMe,2013.05.19 if (isset($_POST["torrent_id"])) { $ch = curl_init(); $res = sql_query("INSERT INTO thanks (torrentid, userid, bonus) VALUES (" . sqlesc($_POST["torrent_id"]) . ", " . sqlesc($CURUSER['id']) . ", " . sqlesc($points) . ")"); } //为saythanks开辟的渠道 end SamuraiMe,2013.05.19 //为论坛添加赠送麦粒显示 if ($postidarr[$i] != 0) { $postarr = array('info' => $CURUSER['username'] . "于" . date("Y-m-d H:i:s") . "赠送给" . sqlesc($usernamegift[$i]) . "  " . $points . "个麦粒" . "<br />"); sql_query("UPDATE posts SET sendlog = CONCAT(sendlog," . sqlesc(implode($postarr)) . ") WHERE id = " . $postidarr[$i]); } //===send message
$updateset[] = "picktype = 'recommended'"; $updateset[] = "picktime = " . sqlesc(date("Y-m-d H:i:s")); } } sql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = {$id}") or sqlerr(__FILE__, __LINE__); $beforeStatus = getTorrentStatus($row['status']); if ($_REQUEST["release"] == "yes") { write_log("种子:管理员 {$CURUSER['username']} 编辑并发布了 {$beforeStatus} 种子 {$id} ({$name}) " . $pick_info . $place_info); sendMessage(0, $row['owner'], "你的{$beforeStatus} 种子被管理员编辑了", "管理员[url=userdetails.php?id={$CURUSER['id']}] {$CURUSER['username']} [/url] 编辑并发布了 {$beforeStatus} 种子 [url=details.php?id={$id}] ({$name})[/url]" . $pick_info . $place_info . ""); } else { if ($CURUSER["id"] == $row["owner"]) { if ($row["anonymous"] == 'yes') { write_log("种子:发布者 匿名用户 编辑了 {$beforeStatus} 种子 {$id} ({$name}) " . $pick_info . $place_info); } else { write_log("种子:发布者 {$CURUSER['username']} 编辑了 {$beforeStatus} 种子 {$id} ({$name}) " . $pick_info . $place_info); } } else { write_log("种子:管理员 {$CURUSER['username']} 编辑了 {$beforeStatus} 种子 {$id} ({$name}) " . $pick_info . $place_info); sendMessage(0, $row['owner'], "你发布的{$beforeStatus} 种子被管理员编辑了", "管理员[url=userdetails.php?id={$CURUSER['id']}] {$CURUSER['username']} [/url] 编辑了种子 [url=details.php?id={$id}] ({$name})[/url]" . $pick_info . $place_info . ""); } } $shoutbox = $pick_info . $place_info; if ($shoutbox && !$notshout) { sendshoutbox("管理员将 [url=details.php?id={$id}] {$name} [/url]" . $shoutbox . " ~快去看看吧看看吧o( ̄︶ ̄)o"); } $edited = $edited ? 2 : 1; $returl = "details.php?id={$id}&edited={$edited}"; if (isset($_POST["returnto"])) { $returl = $_POST["returnto"]; } header("Refresh: 0; url={$returl}");
if ($amount < 100) { stderr("出错了!", "追加悬赏赏金不得小于100个麦粒!"); } if ($amount > 5000) { stderr("出错了!", "追加悬赏赏金不得大于5000个麦粒!"); } // $amount += 25; $newseedbonus = $amount + 25; $newamount = $arr["amount"] + $amount; if ($amount > $CURUSER[seedbonus]) { stderr("出错了!", "你没有那么多麦粒!"); } sql_query("UPDATE users SET seedbonus = seedbonus - " . $newseedbonus . " WHERE id = " . $CURUSER[id]); $addbonusname = mysql_fetch_assoc(sql_query("SELECT name from req where id=" . sqlesc($_POST["reqid"]))); writeBonusComment($CURUSER['id'], "使用{$newseedbonus} 麦粒追加了悬赏" . sqlesc($addbonusname['name']) . $_POST["reqid"]); sendshoutbox("[@" . $CURUSER['username'] . "]砸重金追加悬赏,求种[url=viewrequest.php?action=view&id=" . $_POST["reqid"] . "]" . $addbonusname['name'] . "[/url]大家来帮帮他吧"); sql_query("UPDATE req SET amount = " . $newamount . ", resetdate = '" . date("Y-m-d H:i:s") . "' WHERE id = " . sqlesc($_POST["reqid"])); if ($arr["userid"] != $CURUSER["id"]) { $res = sql_query("SELECT * FROM givebonus WHERE bonusfromuserid = '" . $CURUSER["id"] . "' AND bonustotorrentid =" . sqlesc($_POST["reqid"]) . " AND type='3'"); // $amount -= 25; if (mysql_num_rows($res) == 0) { sql_query("INSERT INTO givebonus ( bonusfromuserid , bonustotorrentid, bonus, type ) VALUES ( '" . $CURUSER["id"] . "'," . sqlesc($_POST["reqid"]) . ",'" . $amount . "','3')"); } else { $arr = mysql_fetch_assoc($res); $amount += $arr["bonus"]; sql_query("UPDATE givebonus SET bonus = '" . $amount . "' WHERE bonusfromuserid = '" . $CURUSER["id"] . "' AND bonustotorrentid =" . sqlesc($_POST["reqid"]) . " AND type='3'"); } } stderr("成功", "追加悬赏成功,<a href=viewrequest.php?action=view&id=" . $_POST["reqid"] . ">点击这里返回</a>", false); die; break;