Toribash
Original Post
?
Itry to go on bounty and it says:
db->query_read($SQL); while($variable = $vbulletin->db->fetch_array($query)) $arr[] = $variable; return $arr; } function run_sql_rows($SQL) { global $vbulletin; $query = $vbulletin->db->query_read($SQL); while($variable = $vbulletin->db->fetch_array($query)) $arr[] = $variable; return $arr[0]; } function add($userid, $issuer_userid, $amount, $text) { $SQL = 'INSERT INTO ' . TORIBASHGAME . '.bounty(userid, issuer_userid, amount, text) ' . 'VALUES (' . $userid . ', ' . $issuer_userid . ', ' . $amount . ', "' . $text . '")'; return $this->run_sql_rows($SQL); } function countAll() { $SQL = 'SELECT count(*) as bc FROM ' . TORIBASHGAME .'.bounty'; $x = $this->run_sql_rows($SQL); return $x['bc']; } function getAll($limit) { $SQL = 'SELECT bounty.userid, bounty.issuer_userid, bounty.hunter_userid, bounty.amount, bounty.start, bounty.end, bounty.text, ' . 'TIMEDIFF(bounty.end, bounty.start) AS taken, ' . 'i.username as issuer_username, ' . 'h.username as hunter_username, ' . 'b.username as bounty_username ' . 'FROM ' . TORIBASHGAME . '.bounty ' . 'LEFT JOIN ' . VBDBNAME . '.vbb_user AS b ON (bounty.userid = b.userid) ' . 'LEFT JOIN ' . VBDBNAME . '.vbb_user AS h ON (bounty.hunter_userid = h.userid) ' . 'LEFT JOIN ' . VBDBNAME . '.vbb_user AS i ON (bounty.issuer_userid = i.userid) ' . 'ORDER BY id DESC ' . $limit; return $this->run_sql($SQL); } function top($num = 5) { $SQL = 'SELECT bounty.userid, bounty.issuer_userid, bounty.hunter_userid, bounty.amount, bounty.start, bounty.end, bounty.text, ' . 'TIMEDIFF(bounty.end, bounty.start) AS taken, ' . 'i.username as issuer_username, ' . 'h.username as hunter_username, ' . 'b.username as bounty_username ' . 'FROM ' . TORIBASHGAME . '.bounty ' . 'LEFT JOIN ' . VBDBNAME . '.vbb_user AS b ON (bounty.userid = b.userid) ' . 'LEFT JOIN ' . VBDBNAME . '.vbb_user AS h ON (bounty.hunter_userid = h.userid) ' . 'LEFT JOIN ' . VBDBNAME . '.vbb_user AS i ON (bounty.issuer_userid = i.userid) ' . 'WHERE bounty.hunter_userid = 0 and DATEDIFF(now(), bounty.start) < 7 ' . 'ORDER BY bounty.amount DESC LIMIT ' . $num; return $this->run_sql($SQL); } function topList() { $text = ""; $arr = $this->top(); foreach ($arr as $key => $bounty) { $text .= ''; $text .= '' . $bounty['bounty_username'] . ''; $text .= '' . $bounty['amount'] . ''; $text .= '' . $bounty['text'] . ''; $text .= '' . $bounty['issuer_username'] . ''; $text .= '' . $bounty['start'] . ''; $text .= '' . $bounty['hunter_username'] . ''; $text .= '' . $bounty['end'] . ''; $text .= ''; } return $text; } function getColorData($color_prefix_id) { $color_prefix_id = intval($color_prefix_id); $SQL = 'SELECT CONCAT("#", HEX(r), HEX(g), HEX(b)) as rgb_value ' . 'FROM ' . TORIBASHDBNAME . '.color ' . 'WHERE id = ' . $color_prefix_id . ' LIMIT 1'; return $this->run_sql_rows($SQL); } function colorizeBountytext($str) { if(!preg_match("/^\^[0-9][0-9]/", trim($str))){ $str = "^07" . $str; } $colorized_str = ""; $arr = preg_split("/(\^[0-9][0-9])/", $str, -1, PREG_SPLIT_DELIM_CAPTURE); foreach ($arr as $elem => $e) { if(preg_match("/^\^[0-9][0-9]/", trim($e))){ $arr = $this->getColorData(substr($e, -1, 2)); $colorized_str .= ""; }else{ $colorized_str .= $e . ""; } } return $colorized_str; } function getUser($userid, $hunter_userid) { $userid = intval($userid); $SQL = 'SELECT SUM(amount) as total_amount FROM ' . TORIBASHGAME . '.bounty ' . 'WHERE userid = ' . $userid . ' ' . 'AND hunter_userid = 0 ' . 'AND issuer_userid != userid ' . 'AND issuer_userid != ' . $hunter_userid ; return $this->run_sql_rows($SQL); } function complete($bounty_userid, $hunter_userid) { $SQL = 'UPDATE ' . TORIBASHGAME . '.bounty ' . 'SET hunter_userid = ' . $hunter_userid . ', end = now() ' . 'WHERE userid = ' . $bounty_userid. ' ' . 'AND hunter_userid = 0'; return $this->run_sql_rows($SQL); } function bounty_text($bounty_id, $text) { $SQL = 'UPDATE ' . TORIBASHGAME . '.bounty ' . 'SET text = "' . $text . '" ' . 'WHERE id = ' . $bounty_id; return $this->run_sql_rows($SQL); } function checkMatch($won, $lost) { global $vbulleltin; $won = intval($won); $lost = intval($lost); $arr = $this->getUser($lost, $won); if (!isset($arr)) { echo("unable to find user $lost\n"); return; } $amount = $arr['total_amount']; if ($amount <= 0) { return; } $storeMoney = new storeMoney; $storeMoney->addMoney($won, $amount); $transaction = new transaction; $transaction->sendMoneyForService(1536, $amount, $won, 547710, "127.0.0.1"); /* $users->sendUser($bounty_userid, 'There collected a bounty', $vbulletin->userinfo['username'] . ' have put a ' . $amount . ' ToriCredits bounty on you.' . "\n" . 'Next player who beat you will collect it.' . "\n" . 'View bounties here.' . "\n"); */ $this->complete($lost, $won); } } ?>
[03:39] <idabosswiz> can't you just set up a pass for ddos?
Yes that happens to me as well, must be a side effect from the migration. I'm pretty sure they already know about it, and are going to fix it along with the list of other things they have to do.
<&Erth> fagm <&Erth> duck <&Erth> *fuck
Fagm duck fuck everyone.