function get_num_votes_of_user($dbh, $uID) { $uID = pg_escape_string($uID); // check whether the player exists $exists_player = player_exists($dbh, $uID); if ($exists_player["status"] == 0 || !$exists_player["exists"]) { return array("status" => 0); } // get the number of votes by user $sql = pg_prepare($dbh, "count_user_votes", 'SELECT COUNT(*) AS count FROM vote WHERE username = $1'); $sql = pg_execute($dbh, "count_user_votes", array($uID)); if (!$sql) { return array("status" => 0); } else { $row = pg_fetch_array($sql); return array("status" => 1, "count" => $row["count"]); } }
function boss_loot_fields($low, $high) { global $lootlog; global $raiddata; global $eventlog; $items = 0; $known_items = 0; $thiskill = 0; for ($i = 0; $i <= count($eventlog); $i++) { $ets = $raiddata[eventlog][$i][ts]; $etype = $raiddata[eventlog][$i][type]; if ($etype == 'BOSSKILL') { if ($ets == $low) { $thiskill = 1; } else { if ($thiskill == 1) { $thiskill = 0; } } } if ($etype == 'LOOT') { $ltype = 'bid'; if (isset($raiddata[lootlog][$ets][type])) { $ltype = $raiddata[lootlog][$ets][type]; } if ($thiskill == 1 and $ltype != 'DE' and $ltype != 'bank') { $items++; if ($item_id = item_exists($raiddata[lootlog][$ets][item])) { $known_items++; print "\n\n"; print '<input type="hidden" name="looters[]" value="' . player_exists($raiddata[lootlog][$ets][player]) . '">'; print '<input type="hidden" name="items[]" value="' . $item_id . '">'; print '<input type="hidden" name="fullprice[]" value="1">'; print "\n\n"; } } } } print "<i>{$items} items ({$known_items} known)</i>"; }