mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 10:49:23 +02:00
parent
5a80034915
commit
0fae6d6e5f
@ -57,9 +57,9 @@ function onSay(cid, words, param)
|
|||||||
local outfits = {}
|
local outfits = {}
|
||||||
|
|
||||||
if itemid > 1000 then
|
if itemid > 1000 then
|
||||||
local first = math.floor(itemid/1000)
|
local first = math.floor(itemid/1000)
|
||||||
table.insert(outfits, first)
|
table.insert(outfits, first)
|
||||||
itemid = itemid - (first * 1000)
|
itemid = itemid - (first * 1000)
|
||||||
end
|
end
|
||||||
table.insert(outfits, itemid)
|
table.insert(outfits, itemid)
|
||||||
|
|
||||||
|
@ -59,9 +59,9 @@ function onSay(cid, words, param)
|
|||||||
local outfits = {}
|
local outfits = {}
|
||||||
|
|
||||||
if itemid > 1000 then
|
if itemid > 1000 then
|
||||||
local first = math.floor(itemid/1000)
|
local first = math.floor(itemid/1000)
|
||||||
table.insert(outfits, first)
|
table.insert(outfits, first)
|
||||||
itemid = itemid - (first * 1000)
|
itemid = itemid - (first * 1000)
|
||||||
end
|
end
|
||||||
table.insert(outfits, itemid)
|
table.insert(outfits, itemid)
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ function onSay(cid, words, param)
|
|||||||
local outfits = {}
|
local outfits = {}
|
||||||
|
|
||||||
if itemid > 1000 then
|
if itemid > 1000 then
|
||||||
local first = math.floor(itemid/1000)
|
local first = math.floor(itemid/1000)
|
||||||
table.insert(outfits, first)
|
table.insert(outfits, first)
|
||||||
itemid = itemid - (first * 1000)
|
itemid = itemid - (first * 1000)
|
||||||
end
|
end
|
||||||
table.insert(outfits, itemid)
|
table.insert(outfits, itemid)
|
||||||
|
|
||||||
|
@ -2,24 +2,24 @@
|
|||||||
-- can be added to data/global.lua if you want to use eternal storage for another purpose than this.
|
-- can be added to data/global.lua if you want to use eternal storage for another purpose than this.
|
||||||
-- Regular TFS global storage values get reset every time server reboots. This does not.
|
-- Regular TFS global storage values get reset every time server reboots. This does not.
|
||||||
local function getEternalStorage(key, parser)
|
local function getEternalStorage(key, parser)
|
||||||
local value = result.getString(db.storeQuery("SELECT `value` FROM `znote_global_storage` WHERE `key` = ".. key .. ";"), "value")
|
local value = result.getString(db.storeQuery("SELECT `value` FROM `znote_global_storage` WHERE `key` = ".. key .. ";"), "value")
|
||||||
if not value then
|
if not value then
|
||||||
if parser then
|
if parser then
|
||||||
return false
|
return false
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return tonumber(value) or value
|
return tonumber(value) or value
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setEternalStorage(key, value)
|
local function setEternalStorage(key, value)
|
||||||
if getEternalStorage(key, true) then
|
if getEternalStorage(key, true) then
|
||||||
db.query("UPDATE `znote_global_storage` SET `value` = '".. value .. "' WHERE `key` = ".. key .. ";")
|
db.query("UPDATE `znote_global_storage` SET `value` = '".. value .. "' WHERE `key` = ".. key .. ";")
|
||||||
else
|
else
|
||||||
db.query("INSERT INTO `znote_global_storage` (`key`, `value`) VALUES (".. key ..", ".. value ..");")
|
db.query("INSERT INTO `znote_global_storage` (`key`, `value`) VALUES (".. key ..", ".. value ..");")
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- SQL Query to execute: --
|
-- SQL Query to execute: --
|
||||||
@ -53,11 +53,11 @@ UPDATE `znote_players` AS `z` INNER JOIN `players` AS `p` ON `p`.`id`=`z`.`play
|
|||||||
-- <globalevent name="PowerGamers" interval="60000" script="powergamers.lua"/>
|
-- <globalevent name="PowerGamers" interval="60000" script="powergamers.lua"/>
|
||||||
|
|
||||||
function onThink(interval, lastExecution, thinkInterval)
|
function onThink(interval, lastExecution, thinkInterval)
|
||||||
if tonumber(os.date("%d")) ~= getEternalStorage(23856) then
|
if tonumber(os.date("%d")) ~= getEternalStorage(23856) then
|
||||||
setEternalStorage(23856, (tonumber(os.date("%d"))))
|
setEternalStorage(23856, (tonumber(os.date("%d"))))
|
||||||
db.query("UPDATE `znote_players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
|
db.query("UPDATE `znote_players` SET `onlinetime7`=`onlinetime6`, `onlinetime6`=`onlinetime5`, `onlinetime5`=`onlinetime4`, `onlinetime4`=`onlinetime3`, `onlinetime3`=`onlinetime2`, `onlinetime2`=`onlinetime1`, `onlinetime1`=`onlinetimetoday`, `onlinetimetoday`=0;")
|
||||||
db.query("UPDATE `znote_players` `z` INNER JOIN `players` `p` ON `p`.`id`=`z`.`player_id` SET `z`.`exphist7`=`z`.`exphist6`, `z`.`exphist6`=`z`.`exphist5`, `z`.`exphist5`=`z`.`exphist4`, `z`.`exphist4`=`z`.`exphist3`, `z`.`exphist3`=`z`.`exphist2`, `z`.`exphist2`=`z`.`exphist1`, `z`.`exphist1`=`p`.`experience`-`z`.`exphist_lastexp`, `z`.`exphist_lastexp`=`p`.`experience`;")
|
db.query("UPDATE `znote_players` `z` INNER JOIN `players` `p` ON `p`.`id`=`z`.`player_id` SET `z`.`exphist7`=`z`.`exphist6`, `z`.`exphist6`=`z`.`exphist5`, `z`.`exphist5`=`z`.`exphist4`, `z`.`exphist4`=`z`.`exphist3`, `z`.`exphist3`=`z`.`exphist2`, `z`.`exphist2`=`z`.`exphist1`, `z`.`exphist1`=`p`.`experience`-`z`.`exphist_lastexp`, `z`.`exphist_lastexp`=`p`.`experience`;")
|
||||||
end
|
end
|
||||||
db.query("UPDATE `znote_players` SET `onlinetimetoday` = `onlinetimetoday` + 60, `onlinetimeall` = `onlinetimeall` + 60 WHERE `player_id` IN (SELECT `player_id` FROM `players_online` WHERE `players_online`.`player_id` = `znote_players`.`player_id`)")
|
db.query("UPDATE `znote_players` SET `onlinetimetoday` = `onlinetimetoday` + 60, `onlinetimeall` = `onlinetimeall` + 60 WHERE `player_id` IN (SELECT `player_id` FROM `players_online` WHERE `players_online`.`player_id` = `znote_players`.`player_id`)")
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
|
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
|
||||||
|
|
||||||
if(!isset($_SESSION['csrf_token'])){
|
if(!isset($_SESSION['csrf_token'])){
|
||||||
$_SESSION['csrf_token']=bin2hex(random_bytes_compat(5,$crypto_strong));
|
$_SESSION['csrf_token'] = bin2hex(random_bytes_compat(5, $crypto_strong));
|
||||||
if(!$crypto_strong){
|
if(!$crypto_strong){
|
||||||
// we don't really care, the csrf token doesn't really have to be cryptographically strong.
|
// we don't really care, the csrf token doesn't really have to be cryptographically strong.
|
||||||
}
|
}
|
||||||
@ -48,8 +48,7 @@ if (empty($_POST) === false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete character:
|
||||||
// delete character:
|
|
||||||
if (empty($_POST['del_name']) === false) {
|
if (empty($_POST['del_name']) === false) {
|
||||||
if (user_character_exist($_POST['del_name'])) {
|
if (user_character_exist($_POST['del_name'])) {
|
||||||
user_delete_character(user_character_id($_POST['del_name']));
|
user_delete_character(user_character_id($_POST['del_name']));
|
||||||
|
@ -7,12 +7,12 @@ include 'layout/overall/header.php';
|
|||||||
// Report status types. When a player make new report it will be default to 0.
|
// Report status types. When a player make new report it will be default to 0.
|
||||||
// Feel free to add/remove and change name/color of status types.
|
// Feel free to add/remove and change name/color of status types.
|
||||||
$statusTypes = array(
|
$statusTypes = array(
|
||||||
0 => '<font color="purple">Reported</font>',
|
0 => '<font color="purple">Reported</font>',
|
||||||
1 => '<font color="darkblue">To-Do List</font>',
|
1 => '<font color="darkblue">To-Do List</font>',
|
||||||
2 => '<font color="red">Confirmed bug</font>',
|
2 => '<font color="red">Confirmed bug</font>',
|
||||||
3 => '<font color="grey">Invalid</font>',
|
3 => '<font color="grey">Invalid</font>',
|
||||||
4 => '<font color="grey">Rejected</font>',
|
4 => '<font color="grey">Rejected</font>',
|
||||||
5 => '<font color="green"><b>Fixed</b></font>'
|
5 => '<font color="green"><b>Fixed</b></font>'
|
||||||
);
|
);
|
||||||
// Which status IDs should give option to add to changelog?
|
// Which status IDs should give option to add to changelog?
|
||||||
$statusChangeLog = array(0,5);
|
$statusChangeLog = array(0,5);
|
||||||
@ -22,222 +22,222 @@ $hideStatus = array(3, 4, 5);
|
|||||||
|
|
||||||
// Fetch data from SQL
|
// Fetch data from SQL
|
||||||
$reportsData = mysql_select_multi('SELECT id, name, posx, posy, posz, report_description, date, status FROM znote_player_reports ORDER BY id DESC;');
|
$reportsData = mysql_select_multi('SELECT id, name, posx, posy, posz, report_description, date, status FROM znote_player_reports ORDER BY id DESC;');
|
||||||
// If sql data is not empty
|
// If SQL data is not empty
|
||||||
if ($reportsData !== false) {
|
if ($reportsData !== false) {
|
||||||
// Order reports array by ID for easy reference later on.
|
// Order reports array by ID for easy reference later on.
|
||||||
$reports = array();
|
$reports = array();
|
||||||
for ($i = 0; $i < count($reportsData); $i++)
|
for ($i = 0; $i < count($reportsData); $i++)
|
||||||
foreach ($statusTypes as $key => $value)
|
foreach ($statusTypes as $key => $value)
|
||||||
if ($key == $reportsData[$i]['status'])
|
if ($key == $reportsData[$i]['status'])
|
||||||
$reports[$key][$reportsData[$i]['id']] = $reportsData[$i];
|
$reports[$key][$reportsData[$i]['id']] = $reportsData[$i];
|
||||||
}
|
}
|
||||||
|
|
||||||
// POST logic (Update report and give player points)
|
// POST logic (Update report and give player points)
|
||||||
if (!empty($_POST)) {
|
if (!empty($_POST)) {
|
||||||
// Fetch POST data
|
// Fetch POST data
|
||||||
$playerName = getValue($_POST['playerName']);
|
$playerName = getValue($_POST['playerName']);
|
||||||
$status = getValue($_POST['status']);
|
$status = getValue($_POST['status']);
|
||||||
$price = getValue($_POST['price']);
|
$price = getValue($_POST['price']);
|
||||||
$customPoints = getValue($_POST['customPoints']);
|
$customPoints = getValue($_POST['customPoints']);
|
||||||
$reportId = getValue($_POST['id']);
|
$reportId = getValue($_POST['id']);
|
||||||
|
|
||||||
$changelogReportId = (int)$_POST['changelogReportId'];
|
$changelogReportId = (int)$_POST['changelogReportId'];
|
||||||
$changelogValue = &$_POST['changelogValue'];
|
$changelogValue = &$_POST['changelogValue'];
|
||||||
$changelogText = getValue($_POST['changelogText']);
|
$changelogText = getValue($_POST['changelogText']);
|
||||||
$changelogStatus = ($changelogReportId !== false && $changelogValue === '2' && $changelogText !== false) ? true : false;
|
$changelogStatus = ($changelogReportId !== false && $changelogValue === '2' && $changelogText !== false) ? true : false;
|
||||||
|
|
||||||
if ($customPoints !== false) $price = (int)($price + $customPoints);
|
if ($customPoints !== false) $price = (int)($price + $customPoints);
|
||||||
|
|
||||||
// Update SQL
|
// Update SQL
|
||||||
mysql_update("UPDATE `znote_player_reports` SET `status`='$status' WHERE `id`='$reportId' LIMIT 1;");
|
mysql_update("UPDATE `znote_player_reports` SET `status`='$status' WHERE `id`='$reportId' LIMIT 1;");
|
||||||
echo "<h1>Report status updated to ".$statusTypes[(int)$status] ."!</h1>";
|
echo "<h1>Report status updated to ".$statusTypes[(int)$status] ."!</h1>";
|
||||||
// Update local array representation
|
// Update local array representation
|
||||||
foreach ($reports as $sid => $sa)
|
foreach ($reports as $sid => $sa)
|
||||||
foreach ($sa as $rid => $ra)
|
foreach ($sa as $rid => $ra)
|
||||||
if ($reportId == $rid) {
|
if ($reportId == $rid) {
|
||||||
$reports[$status][$reportId] = $reports[$sid][$rid];
|
$reports[$status][$reportId] = $reports[$sid][$rid];
|
||||||
$reports[$status][$reportId]['status'] = $status;
|
$reports[$status][$reportId]['status'] = $status;
|
||||||
unset($reports[$sid][$rid]);
|
unset($reports[$sid][$rid]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we should do anything with changelog:
|
// If we should do anything with changelog:
|
||||||
if ($changelogStatus) {
|
if ($changelogStatus) {
|
||||||
$time = time();
|
$time = time();
|
||||||
// Check if changelog exist (`id`, `text`, `time`, `report_id`, `status`)
|
// Check if changelog exist (`id`, `text`, `time`, `report_id`, `status`)
|
||||||
$changelog = mysql_select_single("SELECT * FROM `znote_changelog` WHERE `report_id`='$changelogReportId' LIMIT 1;");
|
$changelog = mysql_select_single("SELECT * FROM `znote_changelog` WHERE `report_id`='$changelogReportId' LIMIT 1;");
|
||||||
// If changelog exist
|
// If changelog exist
|
||||||
$updatechangelog = false;
|
$updatechangelog = false;
|
||||||
if ($changelog !== false) {
|
if ($changelog !== false) {
|
||||||
// Update it
|
// Update it
|
||||||
mysql_update("UPDATE `znote_changelog` SET `text`='$changelogText', `time`='$time' WHERE `id`='".$changelog['id']."' LIMIT 1;");
|
mysql_update("UPDATE `znote_changelog` SET `text`='$changelogText', `time`='$time' WHERE `id`='".$changelog['id']."' LIMIT 1;");
|
||||||
echo "<h2>Changelog message updated!</h2>";
|
echo "<h2>Changelog message updated!</h2>";
|
||||||
$updatechangelog = true;
|
$updatechangelog = true;
|
||||||
} else {
|
} else {
|
||||||
// Create it
|
// Create it
|
||||||
mysql_insert("INSERT INTO `znote_changelog` (`text`, `time`, `report_id`, `status`)
|
mysql_insert("INSERT INTO `znote_changelog` (`text`, `time`, `report_id`, `status`)
|
||||||
VALUES ('$changelogText', '$time', '$changelogReportId', '$status');");
|
VALUES ('$changelogText', '$time', '$changelogReportId', '$status');");
|
||||||
echo "<h2>Changelog message created!</h2>";
|
echo "<h2>Changelog message created!</h2>";
|
||||||
$updatechangelog = true;
|
$updatechangelog = true;
|
||||||
}
|
}
|
||||||
if ($updatechangelog) {
|
if ($updatechangelog) {
|
||||||
// Cache changelog
|
// Cache changelog
|
||||||
$cache = new Cache('engine/cache/changelog');
|
$cache = new Cache('engine/cache/changelog');
|
||||||
$cache->setContent(mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;"));
|
$cache->setContent(mysql_select_multi("SELECT `id`, `text`, `time`, `report_id`, `status` FROM `znote_changelog` ORDER BY `id` DESC;"));
|
||||||
$cache->save();
|
$cache->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// If we should give user price
|
// If we should give user price
|
||||||
if ($price > 0) {
|
if ($price > 0) {
|
||||||
$account = mysql_select_single("SELECT `a`.`id`, `a`.`email` FROM `accounts` AS `a`
|
$account = mysql_select_single("SELECT `a`.`id`, `a`.`email` FROM `accounts` AS `a`
|
||||||
INNER JOIN `players` AS `p` ON `p`.`account_id` = `a`.`id`
|
INNER JOIN `players` AS `p` ON `p`.`account_id` = `a`.`id`
|
||||||
WHERE `p`.`name` = '$playerName' LIMIT 1;");
|
WHERE `p`.`name` = '$playerName' LIMIT 1;");
|
||||||
|
|
||||||
if ($account !== false) {
|
if ($account !== false) {
|
||||||
// transaction log
|
// transaction log
|
||||||
mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '$reportId', 'report@admin.".$user_data['name']." to ".$account['email']."', '".$account['id']."', '0', '".$price."')");
|
mysql_insert("INSERT INTO `znote_paypal` VALUES ('', '$reportId', 'report@admin.".$user_data['name']." to ".$account['email']."', '".$account['id']."', '0', '".$price."')");
|
||||||
// Process payment
|
// Process payment
|
||||||
$data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='".$account['id']."';");
|
$data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='".$account['id']."';");
|
||||||
// Give points to user
|
// Give points to user
|
||||||
$new_points = $data['old_points'] + $price;
|
$new_points = $data['old_points'] + $price;
|
||||||
mysql_update("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='".$account['id']."'");
|
mysql_update("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='".$account['id']."'");
|
||||||
|
|
||||||
// Remind GM that he sent points to character
|
// Remind GM that he sent points to character
|
||||||
echo "<font color='green' size='5'>".$playerName." has been granted ".$price." points for his reports.</font>";
|
echo "<font color='green' size='5'>".$playerName." has been granted ".$price." points for his reports.</font>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET logic (Edit report data and specify how many [if any] points to give to user)
|
// GET logic (Edit report data and specify how many [if any] points to give to user)
|
||||||
} elseif (!empty($_GET)) {
|
} elseif (!empty($_GET)) {
|
||||||
// Fetch GET data
|
// Fetch GET data
|
||||||
$action = getValue($_GET['action']);
|
$action = getValue($_GET['action']);
|
||||||
$playerName = getValue($_GET['name']);
|
$playerName = getValue($_GET['name']);
|
||||||
$reportId = getValue($_GET['id']);
|
$reportId = getValue($_GET['id']);
|
||||||
|
|
||||||
// Fetch the report we intend to modify
|
// Fetch the report we intend to modify
|
||||||
foreach ($reports as $sid => $sa)
|
foreach ($reports as $sid => $sa)
|
||||||
foreach ($sa as $rid => $ra)
|
foreach ($sa as $rid => $ra)
|
||||||
if ($rid == $reportId)
|
if ($rid == $reportId)
|
||||||
$report = $reports[$sid][$reportId];
|
$report = $reports[$sid][$reportId];
|
||||||
|
|
||||||
// Create html form
|
// Create HTML form
|
||||||
?>
|
?>
|
||||||
<div style="width: 300px; margin: auto;">
|
<div style="width: 300px; margin: auto;">
|
||||||
<form action="admin_reports.php" method="POST">
|
<form action="admin_reports.php" method="POST">
|
||||||
Player: <a target="_BLANK" href="characterprofile.php?name=<?php echo $report['name']; ?>"><?php echo $report['name']; ?></a>
|
Player: <a target="_BLANK" href="characterprofile.php?name=<?php echo $report['name']; ?>"><?php echo $report['name']; ?></a>
|
||||||
<input type="hidden" name="playerName" value="<?php echo $report['name']; ?>">
|
<input type="hidden" name="playerName" value="<?php echo $report['name']; ?>">
|
||||||
<input type="hidden" name="id" value="<?php echo $report['id']; ?>">
|
<input type="hidden" name="id" value="<?php echo $report['id']; ?>">
|
||||||
<br>Set status:
|
<br>Set status:
|
||||||
<select name="status">
|
<select name="status">
|
||||||
<?php
|
<?php
|
||||||
foreach ($statusTypes as $sid => $sname)
|
foreach ($statusTypes as $sid => $sname)
|
||||||
echo ($sid != $report['status']) ? "<option value='$sid'>$sname</option>" : "<option value='$sid' selected>$sname</option>";
|
echo ($sid != $report['status']) ? "<option value='$sid'>$sname</option>" : "<option value='$sid' selected>$sname</option>";
|
||||||
?>
|
?>
|
||||||
</select><br>
|
</select><br>
|
||||||
Give user points:
|
Give user points:
|
||||||
<select name="price">
|
<select name="price">
|
||||||
<option value='0'>0</option>
|
<option value='0'>0</option>
|
||||||
<?php
|
<?php
|
||||||
foreach ($config['paypal_prices'] as $price)
|
foreach ($config['paypal_prices'] as $price)
|
||||||
echo "<option value='$price'>$price</option>";
|
echo "<option value='$price'>$price</option>";
|
||||||
?>
|
?>
|
||||||
</select> + <input name="customPoints" type="text" style="width: 50px;" placeholder="0"><br>
|
</select> + <input name="customPoints" type="text" style="width: 50px;" placeholder="0"><br>
|
||||||
<?php
|
<?php
|
||||||
if (in_array($report['status'], $statusChangeLog)) {
|
if (in_array($report['status'], $statusChangeLog)) {
|
||||||
?>
|
?>
|
||||||
<br>
|
<br>
|
||||||
<input type="hidden" name="changelogReportId" value="<?php echo $report['id']; ?>">
|
<input type="hidden" name="changelogReportId" value="<?php echo $report['id']; ?>">
|
||||||
Add / update changelog message? <select name="changelogValue">
|
Add / update changelog message? <select name="changelogValue">
|
||||||
<option value="1">No</option>
|
<option value="1">No</option>
|
||||||
<option value="2">Yes</option>
|
<option value="2">Yes</option>
|
||||||
</select><br>
|
</select><br>
|
||||||
<textarea rows="7" cols="40" maxlength="254" name="changelogText"></textarea>
|
<textarea rows="7" cols="40" maxlength="254" name="changelogText"></textarea>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<br>
|
<br>
|
||||||
<input type="submit" value="Update Report" style="width: 100%;">
|
<input type="submit" value="Update Report" style="width: 100%;">
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
// If sql data is not empty
|
// If SQL data is not empty
|
||||||
if ($reportsData !== false) {
|
if ($reportsData !== false) {
|
||||||
// Render HTML
|
// Render HTML
|
||||||
?>
|
?>
|
||||||
<center>
|
<center>
|
||||||
<?php
|
<?php
|
||||||
foreach ($reports as $statusId => $statusArray) {
|
foreach ($reports as $statusId => $statusArray) {
|
||||||
?>
|
?>
|
||||||
<h2 class="statusType"><?php echo $statusTypes[$statusId]; ?> (<span id="status-<?php echo $statusId; ?>">Visible</span>)</h2>
|
<h2 class="statusType"><?php echo $statusTypes[$statusId]; ?> (<span id="status-<?php echo $statusId; ?>">Visible</span>)</h2>
|
||||||
<table class="table tbl" border="0" cellspacing="1" cellpadding="4" width="100%">
|
<table class="table tbl" border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="yellow" onclick="javascript:toggle('<?php echo $statusId; ?>')">
|
<tr class="yellow" onclick="javascript:toggle('<?php echo $statusId; ?>')">
|
||||||
<td width="38%">Info</td>
|
<td width="38%">Info</td>
|
||||||
<td>Description</td>
|
<td>Description</td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<?php
|
<?php
|
||||||
foreach ($statusArray as $reportId => $report) {
|
foreach ($statusArray as $reportId => $report) {
|
||||||
?>
|
?>
|
||||||
<tbody class="row<?php echo $report['status']; ?>">
|
<tbody class="row<?php echo $report['status']; ?>">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<b>Report ID:</b> #<?php echo $report['id']; ?>
|
<b>Report ID:</b> #<?php echo $report['id']; ?>
|
||||||
<br><b>Name:</b> <a href="characterprofile.php?name=<?php echo $report['name']; ?>"><?php echo $report['name']; ?></a>
|
<br><b>Name:</b> <a href="characterprofile.php?name=<?php echo $report['name']; ?>"><?php echo $report['name']; ?></a>
|
||||||
<br><b>Position:</b> <input type="text" disabled value="/pos <?php echo $report['posx'].', '.$report['posy'].', '.$report['posz']; ?>">
|
<br><b>Position:</b> <input type="text" disabled value="/pos <?php echo $report['posx'].', '.$report['posy'].', '.$report['posz']; ?>">
|
||||||
<br><b>Reported:</b> <?php echo getClock($report['date'], true, true); ?>
|
<br><b>Reported:</b> <?php echo getClock($report['date'], true, true); ?>
|
||||||
<br><b>Status:</b> <?php echo $statusTypes[$report['status']]; ?>. <a href="?action=edit&name=<?php echo $report['name'].'&id='.$report['id']; ?>">Edit</a>
|
<br><b>Status:</b> <?php echo $statusTypes[$report['status']]; ?>. <a href="?action=edit&name=<?php echo $report['name'].'&id='.$report['id']; ?>">Edit</a>
|
||||||
</td>
|
</td>
|
||||||
<td><?php echo $report['report_description']; ?></td>
|
<td><?php echo $report['report_description']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?></table><?php
|
?></table><?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</center>
|
</center>
|
||||||
<?php
|
<?php
|
||||||
} else echo "<h2>No reports submitted.</h2>";
|
} else echo "<h2>No reports submitted.</h2>";
|
||||||
?>
|
?>
|
||||||
<style>
|
<style>
|
||||||
tr.yellow[onclick] td {
|
tr.yellow[onclick] td {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
tbody[class^=row] td:last-of-type {
|
tbody[class^=row] td:last-of-type {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
// Hide and show tables
|
// Hide and show tables
|
||||||
// Written in clean javascript to make it cross-layout compatible.
|
// Written in clean javascript to make it cross-layout compatible.
|
||||||
function toggle(statusId) {
|
function toggle(statusId) {
|
||||||
var divStatus = 'row' + statusId,
|
var divStatus = 'row' + statusId,
|
||||||
msgStatus = 'status-' + statusId;
|
msgStatus = 'status-' + statusId;
|
||||||
|
|
||||||
// Change visibility status
|
// Change visibility status
|
||||||
statusElement = document.getElementById(msgStatus);
|
statusElement = document.getElementById(msgStatus);
|
||||||
|
|
||||||
statusElement.innerHTML = (statusElement.innerHTML == 'Visible') ? 'Hidden' : 'Visible';
|
statusElement.innerHTML = (statusElement.innerHTML == 'Visible') ? 'Hidden' : 'Visible';
|
||||||
// Show/hide elements.
|
// Show/hide elements.
|
||||||
var elements = document.getElementsByClassName(divStatus);
|
var elements = document.getElementsByClassName(divStatus);
|
||||||
for (var i = 0; i < elements.length; i++)
|
for (var i = 0; i < elements.length; i++)
|
||||||
elements[i].style.display = (elements[i].style.display == 'none') ? 'table-header-group' : 'none';
|
elements[i].style.display = (elements[i].style.display == 'none') ? 'table-header-group' : 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php // Hide configured tables by default
|
<?php // Hide configured tables by default
|
||||||
foreach ($hideStatus as $statusId)
|
foreach ($hideStatus as $statusId)
|
||||||
echo "toggle($statusId);";
|
echo "toggle($statusId);";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
var st = document.body.querySelectorAll('.statusType');
|
var st = document.body.querySelectorAll('.statusType');
|
||||||
for(i = 0; i < st.length; i++)
|
for(i = 0; i < st.length; i++)
|
||||||
st[i].addEventListener('click', function(e) {
|
st[i].addEventListener('click', function(e) {
|
||||||
toggle(e.currentTarget.querySelector('span').id.match(/(\d)+/)[0]);
|
toggle(e.currentTarget.querySelector('span').id.match(/(\d)+/)[0]);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php include 'layout/overall/footer.php'; ?>
|
<?php include 'layout/overall/footer.php'; ?>
|
@ -49,13 +49,13 @@ if ($auction['characterAuction']) {
|
|||||||
$step = $auction['step'];
|
$step = $auction['step'];
|
||||||
$step_duration = $auction['step_duration'];
|
$step_duration = $auction['step_duration'];
|
||||||
$actions = array(
|
$actions = array(
|
||||||
'list', // list all available players in auction
|
'list', // list all available players in auction
|
||||||
'view', // view a specific player
|
'view', // view a specific player
|
||||||
'create', // select which character to add and initial price
|
'create', // select which character to add and initial price
|
||||||
'add', // add character to list
|
'add', // add character to list
|
||||||
'bid', // Bid or buy a specific player
|
'bid', // Bid or buy a specific player
|
||||||
'refund', // Refund a player you added back to your account
|
'refund', // Refund a player you added back to your account
|
||||||
'claim' // Claim a character you won through purchase or bid
|
'claim' // Claim a character you won through purchase or bid
|
||||||
);
|
);
|
||||||
|
|
||||||
// Default action is list, but $_GET or $_POST will override it.
|
// Default action is list, but $_GET or $_POST will override it.
|
||||||
@ -86,7 +86,7 @@ if ($auction['characterAuction']) {
|
|||||||
if (!empty($soldIds)) {
|
if (!empty($soldIds)) {
|
||||||
mysql_update("
|
mysql_update("
|
||||||
UPDATE `znote_auction_player`
|
UPDATE `znote_auction_player`
|
||||||
SET `sold`=1
|
SET `sold` = 1
|
||||||
WHERE `id` IN(".implode(',', $soldIds).")
|
WHERE `id` IN(".implode(',', $soldIds).")
|
||||||
LIMIT ".COUNT($soldIds).";
|
LIMIT ".COUNT($soldIds).";
|
||||||
");
|
");
|
||||||
@ -279,7 +279,7 @@ if ($auction['characterAuction']) {
|
|||||||
$account = mysql_select_single("
|
$account = mysql_select_single("
|
||||||
SELECT `points`
|
SELECT `points`
|
||||||
FROM `znote_accounts`
|
FROM `znote_accounts`
|
||||||
WHERE `account_id`={$this_account_id}
|
WHERE `account_id` = {$this_account_id}
|
||||||
AND `points` >= {$character['price']}
|
AND `points` >= {$character['price']}
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
");
|
");
|
||||||
@ -565,7 +565,7 @@ if ($auction['characterAuction']) {
|
|||||||
$time = time();
|
$time = time();
|
||||||
// If original account is the one trying to get it back,
|
// If original account is the one trying to get it back,
|
||||||
// and bidding period is over,
|
// and bidding period is over,
|
||||||
// and its not labelled as sold
|
// and its not labeled as sold
|
||||||
// and nobody has bid on it
|
// and nobody has bid on it
|
||||||
$character = mysql_select_single("
|
$character = mysql_select_single("
|
||||||
SELECT `player_id`
|
SELECT `player_id`
|
||||||
@ -650,7 +650,7 @@ if ($auction['characterAuction']) {
|
|||||||
// end name validation
|
// end name validation
|
||||||
if (empty($errors)) {
|
if (empty($errors)) {
|
||||||
// Make sure you have access to claim this zaid character.
|
// Make sure you have access to claim this zaid character.
|
||||||
// And that you havent already claimed it.
|
// And that you haven't already claimed it.
|
||||||
// And that the character isn't online...
|
// And that the character isn't online...
|
||||||
$character = mysql_select_single("
|
$character = mysql_select_single("
|
||||||
SELECT
|
SELECT
|
||||||
@ -715,7 +715,7 @@ if ($auction['characterAuction']) {
|
|||||||
<table class="auction_error">
|
<table class="auction_error">
|
||||||
<tr class="yellow">
|
<tr class="yellow">
|
||||||
<td>#</td>
|
<td>#</td>
|
||||||
<td>Issues occured while claiming your name</td>
|
<td>Issues occurred while claiming your name</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach($errors as $i => $error): ?>
|
<?php foreach($errors as $i => $error): ?>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -323,7 +323,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
<div class="inventory_outfit">
|
<div class="inventory_outfit">
|
||||||
<img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img">
|
<img src="<?php echo $config['show_outfits']['imageServer']; ?>?id=<?php echo $profile_data['looktype']; ?>&addons=<?php echo $profile_data['lookaddons']; ?>&head=<?php echo $profile_data['lookhead']; ?>&body=<?php echo $profile_data['lookbody']; ?>&legs=<?php echo $profile_data['looklegs']; ?>&feet=<?php echo $profile_data['lookfeet']; ?>" alt="img">
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
@ -456,15 +456,15 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
#piv_flex .itm { background-image: url("/engine/img/bg.png"); }
|
#piv_flex .itm { background-image: url("/engine/img/bg.png"); }
|
||||||
#piv_flex .itm-1 { left: 48px; top: 39px; }
|
#piv_flex .itm-1 { left: 48px; top: 39px; }
|
||||||
#piv_flex .itm-2 { left: 11px; top: 53px; }
|
#piv_flex .itm-2 { left: 11px; top: 53px; }
|
||||||
#piv_flex .itm-3 { left: 85px; top: 53px; }
|
#piv_flex .itm-3 { left: 85px; top: 53px; }
|
||||||
#piv_flex .itm-4 { left: 48px; top: 76px; }
|
#piv_flex .itm-4 { left: 48px; top: 76px; }
|
||||||
#piv_flex .itm-5 { left: 85px; top: 90px; }
|
#piv_flex .itm-5 { left: 85px; top: 90px; }
|
||||||
#piv_flex .itm-6 { left: 11px; top: 90px; }
|
#piv_flex .itm-6 { left: 11px; top: 90px; }
|
||||||
#piv_flex .itm-7 { left: 48px; top: 113px; }
|
#piv_flex .itm-7 { left: 48px; top: 113px; }
|
||||||
#piv_flex .itm-8 { left: 48px; top: 150px; }
|
#piv_flex .itm-8 { left: 48px; top: 150px; }
|
||||||
#piv_flex .itm-9 { left: 11px; top: 127px; }
|
#piv_flex .itm-9 { left: 11px; top: 127px; }
|
||||||
#piv_flex .itm-10 { left: 85px; top: 127px; }
|
#piv_flex .itm-10 { left: 85px; top: 127px; }
|
||||||
#piv_cap {
|
#piv_cap {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -589,24 +589,24 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
|
|
||||||
/* Outfit column positions */
|
/* Outfit column positions */
|
||||||
<?php for ($column = 1; $column <= $outfit_columns; $column++): ?>
|
<?php for ($column = 1; $column <= $outfit_columns; $column++): ?>
|
||||||
#piv_o_container .o:nth-child(<?php echo $outfit_columns.'n+'.$column;?>) { right: <?php echo 10 + 40 * ($outfit_columns-$column); ?>px; }
|
#piv_o_container .o:nth-child(<?php echo $outfit_columns.'n+'.$column;?>) { right: <?php echo 10 + 40 * ($outfit_columns-$column); ?>px; }
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
|
|
||||||
/* Outfit row positions */
|
/* Outfit row positions */
|
||||||
<?php for ($row = 1; $row <= $outfit_rows; $row++): ?>
|
<?php for ($row = 1; $row <= $outfit_rows; $row++): ?>
|
||||||
#piv_o_container .o:nth-child(n+<?php echo $outfit_columns * ($row-1)+1; ?>):nth-child(-n+<?php echo $outfit_columns*$row; ?>) { bottom: <?php echo 10 + 33 * ($outfit_rows-$row); ?>px; }
|
#piv_o_container .o:nth-child(n+<?php echo $outfit_columns * ($row-1)+1; ?>):nth-child(-n+<?php echo $outfit_columns*$row; ?>) { bottom: <?php echo 10 + 33 * ($outfit_rows-$row); ?>px; }
|
||||||
<?php endfor; ?>
|
<?php endfor; ?>
|
||||||
|
|
||||||
#piv_o_container .o.grayimg {
|
#piv_o_container .o.grayimg {
|
||||||
filter: none;
|
filter: none;
|
||||||
-webkit-filter: grayscale(100%);
|
-webkit-filter: grayscale(100%);
|
||||||
-moz-filter: grayscale(100%);
|
-moz-filter: grayscale(100%);
|
||||||
-ms-filter: grayscale(100%);
|
-ms-filter: grayscale(100%);
|
||||||
-o-filter: grayscale(100%);
|
-o-filter: grayscale(100%);
|
||||||
opacity: .5;
|
opacity: .5;
|
||||||
filter: alpha(opacity=50);
|
filter: alpha(opacity=50);
|
||||||
margin-left: -25pt;
|
margin-left: -25pt;
|
||||||
margin-top: -25px;
|
margin-top: -25px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</td>
|
</td>
|
||||||
@ -832,7 +832,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
|
|||||||
$firstrun = 1;
|
$firstrun = 1;
|
||||||
|
|
||||||
if ($config['EnableQuests'] == true) {
|
if ($config['EnableQuests'] == true) {
|
||||||
$sqlquests = mysql_select_multi("
|
$sqlquests = mysql_select_multi("
|
||||||
SELECT `player_id`, `key`, `value`
|
SELECT `player_id`, `key`, `value`
|
||||||
FROM player_storage
|
FROM player_storage
|
||||||
WHERE `player_id` = {$user_id}
|
WHERE `player_id` = {$user_id}
|
||||||
|
@ -14,7 +14,7 @@ if(!function_exists('curl_version')):
|
|||||||
// CURL enabled. Lets create an API web request to github.
|
// CURL enabled. Lets create an API web request to github.
|
||||||
$request = curl_init();
|
$request = curl_init();
|
||||||
curl_setopt($request, CURLOPT_URL, 'https://api.github.com/repos/Znote/ZnoteAAC/contributors');
|
curl_setopt($request, CURLOPT_URL, 'https://api.github.com/repos/Znote/ZnoteAAC/contributors');
|
||||||
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
|
||||||
curl_setopt($request, CURLOPT_USERAGENT, 'ZnoteAAC'); // GitHub requires user agent header.
|
curl_setopt($request, CURLOPT_USERAGENT, 'ZnoteAAC'); // GitHub requires user agent header.
|
||||||
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
|
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, false);
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@ $time = time();
|
|||||||
if (!isset($version)) $version = '1.5_SVN';
|
if (!isset($version)) $version = '1.5_SVN';
|
||||||
|
|
||||||
if (!function_exists("elapsedTime")) {
|
if (!function_exists("elapsedTime")) {
|
||||||
function elapsedTime($l_start = false, $l_time = false) {
|
function elapsedTime($l_start = false, $l_time = false) {
|
||||||
if ($l_start === false) global $l_start;
|
if ($l_start === false) global $l_start;
|
||||||
if ($l_time === false) global $l_time;
|
if ($l_time === false) global $l_time;
|
||||||
|
|
||||||
$l_time = explode(' ', microtime());
|
$l_time = explode(' ', microtime());
|
||||||
$l_finish = $l_time[1] + $l_time[0];
|
$l_finish = $l_time[1] + $l_time[0];
|
||||||
return round(($l_finish - $l_start), 4);
|
return round(($l_finish - $l_start), 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ALTER TABLE `znote_accounts` ADD `active_email` TINYINT(4) NOT NULL DEFAULT '0' AFTER `active`;
|
// ALTER TABLE `znote_accounts` ADD `active_email` TINYINT(4) NOT NULL DEFAULT '0' AFTER `active`;
|
||||||
@ -35,39 +35,40 @@ $install = "
|
|||||||
$connect = new mysqli($config['sqlHost'], $config['sqlUser'], $config['sqlPassword'], $config['sqlDatabase']);
|
$connect = new mysqli($config['sqlHost'], $config['sqlUser'], $config['sqlPassword'], $config['sqlDatabase']);
|
||||||
|
|
||||||
if ($connect->connect_errno) {
|
if ($connect->connect_errno) {
|
||||||
die("Failed to connect to MySQL: (" . $connect->connect_errno . ") " . $connect->connect_error . $install);
|
die("Failed to connect to MySQL: (" . $connect->connect_errno . ") " . $connect->connect_error . $install);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mysql_znote_escape_string($escapestr) {
|
function mysql_znote_escape_string($escapestr) {
|
||||||
global $connect;
|
global $connect;
|
||||||
return mysqli_real_escape_string($connect, $escapestr);
|
return mysqli_real_escape_string($connect, $escapestr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Select single row from database
|
// Select single row from database
|
||||||
function mysql_select_single($query) {
|
function mysql_select_single($query) {
|
||||||
global $connect;
|
global $connect;
|
||||||
global $aacQueries;
|
global $aacQueries;
|
||||||
$aacQueries++;
|
$aacQueries++;
|
||||||
|
|
||||||
global $accQueriesData;
|
global $accQueriesData;
|
||||||
$accQueriesData[] = "[" . elapsedTime() . "] " . $query;
|
$accQueriesData[] = "[" . elapsedTime() . "] " . $query;
|
||||||
$result = mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>select_single</b> (select single row from database)<br><br>".mysqli_error($connect));
|
$result = mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>select_single</b> (select single row from database)<br><br>".mysqli_error($connect));
|
||||||
$row = mysqli_fetch_assoc($result);
|
$row = mysqli_fetch_assoc($result);
|
||||||
return !empty($row) ? $row : false;
|
return !empty($row) ? $row : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Selecting multiple rows from database.
|
// Selecting multiple rows from database.
|
||||||
function mysql_select_multi($query){
|
function mysql_select_multi($query){
|
||||||
global $connect;
|
global $connect;
|
||||||
global $aacQueries;
|
global $aacQueries;
|
||||||
$aacQueries++;
|
$aacQueries++;
|
||||||
global $accQueriesData;
|
global $accQueriesData;
|
||||||
$accQueriesData[] = "[" . elapsedTime() . "] " . $query;
|
$accQueriesData[] = "[" . elapsedTime() . "] " . $query;
|
||||||
$array = array();
|
$array = array();
|
||||||
$results = mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>select_multi</b> (select multiple rows from database)<br><br>".mysqli_error($connect));
|
$results = mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>select_multi</b> (select multiple rows from database)<br><br>".mysqli_error($connect));
|
||||||
while($row = mysqli_fetch_assoc($results)) {
|
while($row = mysqli_fetch_assoc($results)) {
|
||||||
$array[] = $row;
|
$array[] = $row;
|
||||||
}
|
}
|
||||||
return !empty($array) ? $array : false;
|
return !empty($array) ? $array : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////
|
//////
|
||||||
@ -81,11 +82,11 @@ function mysql_insert($query){ voidQuery($query); }
|
|||||||
function mysql_delete($query){ voidQuery($query); }
|
function mysql_delete($query){ voidQuery($query); }
|
||||||
// Send a void query
|
// Send a void query
|
||||||
function voidQuery($query) {
|
function voidQuery($query) {
|
||||||
global $connect;
|
global $connect;
|
||||||
global $aacQueries;
|
global $aacQueries;
|
||||||
$aacQueries++;
|
$aacQueries++;
|
||||||
global $accQueriesData;
|
global $accQueriesData;
|
||||||
$accQueriesData[] = "[" . elapsedTime() . "] " . $query;
|
$accQueriesData[] = "[" . elapsedTime() . "] " . $query;
|
||||||
mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>voidQuery</b> (voidQuery is used for update, insert or delete from database)<br><br>".mysqli_error($connect));
|
mysqli_query($connect,$query) or die(var_dump($query)."<br>(query - <font color='red'>SQL error</font>) <br>Type: <b>voidQuery</b> (voidQuery is used for update, insert or delete from database)<br><br>".mysqli_error($connect));
|
||||||
}
|
}
|
||||||
?>
|
?>
|
@ -89,10 +89,10 @@ class Mail {
|
|||||||
//send the message, check for errors
|
//send the message, check for errors
|
||||||
$status = false;
|
$status = false;
|
||||||
if (!$mail->send()) {
|
if (!$mail->send()) {
|
||||||
echo "Mailer Error: " . $mail->ErrorInfo;
|
echo "Mailer Error: " . $mail->ErrorInfo;
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
$status = true;
|
$status = true;
|
||||||
}
|
}
|
||||||
return $status;
|
return $status;
|
||||||
}
|
}
|
||||||
|
@ -58,13 +58,13 @@ function fetchLatestDeaths_03($rowz = 30, $killers = false) {
|
|||||||
$countz = 0;
|
$countz = 0;
|
||||||
if ($rowz === false || $killers === true) $getdeaths = mysql_select_multi("SELECT * FROM player_deaths ORDER BY date DESC;");
|
if ($rowz === false || $killers === true) $getdeaths = mysql_select_multi("SELECT * FROM player_deaths ORDER BY date DESC;");
|
||||||
else $getdeaths = mysql_select_multi("SELECT * FROM `player_deaths` ORDER BY `date` DESC LIMIT 0, $rowz;");
|
else $getdeaths = mysql_select_multi("SELECT * FROM `player_deaths` ORDER BY `date` DESC LIMIT 0, $rowz;");
|
||||||
$data = false;
|
$data = false;
|
||||||
//while ($showdeaths = mysql_fetch_assoc($getdeaths)) {
|
//while ($showdeaths = mysql_fetch_assoc($getdeaths)) {
|
||||||
if ($getdeaths !== false) {
|
if ($getdeaths !== false) {
|
||||||
for ($i = 0; $i < count($getdeaths); $i++) {
|
for ($i = 0; $i < count($getdeaths); $i++) {
|
||||||
$pid = $getdeaths[$i]['player_id'];
|
$pid = $getdeaths[$i]['player_id'];
|
||||||
$level = $getdeaths[$i]['level'];
|
$level = $getdeaths[$i]['level'];
|
||||||
$kid = user_get_kid($getdeaths[$i]['id']);
|
$kid = user_get_kid($getdeaths[$i]['id']);
|
||||||
|
|
||||||
$killedby = user_name(user_get_killer_id($kid));
|
$killedby = user_name(user_get_killer_id($kid));
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ function fetchLatestDeaths_03($rowz = 30, $killers = false) {
|
|||||||
$player = 2;
|
$player = 2;
|
||||||
$killedby = "Deleted player.";
|
$killedby = "Deleted player.";
|
||||||
}
|
}
|
||||||
$getname = mysql_select_single("SELECT `name` FROM `players` WHERE `id` = '$pid' LIMIT 1;");
|
$getname = mysql_select_single("SELECT `name` FROM `players` WHERE `id` = '$pid' LIMIT 1;");
|
||||||
$name = $getname['name'];
|
$name = $getname['name'];
|
||||||
$row = array();
|
$row = array();
|
||||||
$row['level'] = $level;
|
$row['level'] = $level;
|
||||||
@ -98,47 +98,47 @@ function fetchLatestDeaths_03($rowz = 30, $killers = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else $data[] = $row;
|
} else $data[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support list
|
// Support list
|
||||||
function support_list() {
|
function support_list() {
|
||||||
$TFS = Config('ServerEngine');
|
$TFS = Config('ServerEngine');
|
||||||
|
|
||||||
if ($TFS == 'TFS_10') $staffs = mysql_select_multi("SELECT `p`.`id`, `a`.`type` as `group_id`, `p`.`name`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `p`.`account_id` = `a`.`id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
if ($TFS == 'TFS_10') $staffs = mysql_select_multi("SELECT `p`.`id`, `a`.`type` as `group_id`, `p`.`name`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `p`.`account_id` = `a`.`id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
||||||
else $staffs = mysql_select_multi("SELECT `a`.`type` as `group_id`, `p`.`name`, `p`.`online`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `a`.`id` = `p`.`account_id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
else $staffs = mysql_select_multi("SELECT `a`.`type` as `group_id`, `p`.`name`, `p`.`online`, `p`.`account_id` FROM `players` AS `p` INNER JOIN `accounts` AS `a` ON `a`.`id` = `p`.`account_id` WHERE `a`.`type` > 1 ORDER BY `p`.`account_id` DESC, `p`.`group_id` ASC, `p`.`level` ASC;");
|
||||||
|
|
||||||
foreach($staffs as $k => $v) {
|
foreach($staffs as $k => $v) {
|
||||||
foreach($staffs as $key => $value) {
|
foreach($staffs as $key => $value) {
|
||||||
if($k != $key && $v['account_id'] == $value['account_id']) {
|
if($k != $key && $v['account_id'] == $value['account_id']) {
|
||||||
unset($staffs[$k]);
|
unset($staffs[$k]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$staffs = array_values($staffs);
|
$staffs = array_values($staffs);
|
||||||
|
|
||||||
if ($staffs !== false && $TFS == 'TFS_10') {
|
if ($staffs !== false && $TFS == 'TFS_10') {
|
||||||
for ($i = 0; $i < count($staffs); $i++) {
|
for ($i = 0; $i < count($staffs); $i++) {
|
||||||
// Fix online status on TFS 1.0
|
// Fix online status on TFS 1.0
|
||||||
$staffs[$i]['online'] = (isset($staffs[$i]['id']) && user_is_online_10($staffs[$i]['id'])) ? 1 : 0;
|
$staffs[$i]['online'] = (isset($staffs[$i]['id']) && user_is_online_10($staffs[$i]['id'])) ? 1 : 0;
|
||||||
unset($staffs[$i]['id']);
|
unset($staffs[$i]['id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $staffs;
|
return $staffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function support_list03() {
|
function support_list03() {
|
||||||
$staffs = mysql_select_multi("SELECT `group_id`, `name`, `online`, `account_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` ASC;");
|
$staffs = mysql_select_multi("SELECT `group_id`, `name`, `online`, `account_id` FROM `players` WHERE `group_id` > 1 ORDER BY `group_id` ASC;");
|
||||||
|
|
||||||
if ($staffs !== false) {
|
if ($staffs !== false) {
|
||||||
for ($i = 0; $i < count($staffs); $i++) {
|
for ($i = 0; $i < count($staffs); $i++) {
|
||||||
// $staffs[$i]['']
|
// $staffs[$i]['']
|
||||||
unset($staffs[$i]['account_id']);
|
unset($staffs[$i]['account_id']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $staffs;
|
return $staffs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NEWS
|
// NEWS
|
||||||
@ -430,23 +430,22 @@ function update_player_guild_position_10($cid, $rid) {
|
|||||||
|
|
||||||
// Update player's guild nick
|
// Update player's guild nick
|
||||||
function update_player_guildnick($cid, $nick) {
|
function update_player_guildnick($cid, $nick) {
|
||||||
$cid = (int)$cid;
|
$cid = (int)$cid;
|
||||||
$nick = sanitize($nick);
|
$nick = sanitize($nick);
|
||||||
if (!empty($nick)) {
|
if (!empty($nick)) {
|
||||||
|
mysql_update("UPDATE `players` SET `guildnick`='$nick' WHERE `id`=$cid");
|
||||||
mysql_update("UPDATE `players` SET `guildnick`='$nick' WHERE `id`=$cid");
|
} else {
|
||||||
} else {
|
mysql_update("UPDATE `players` SET `guildnick`='' WHERE `id`=$cid");
|
||||||
mysql_update("UPDATE `players` SET `guildnick`='' WHERE `id`=$cid");
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function update_player_guildnick_10($cid, $nick) {
|
function update_player_guildnick_10($cid, $nick) {
|
||||||
$cid = (int)$cid;
|
$cid = (int)$cid;
|
||||||
$nick = sanitize($nick);
|
$nick = sanitize($nick);
|
||||||
if (!empty($nick)) {
|
if (!empty($nick)) {
|
||||||
mysql_update("UPDATE `guild_membership` SET `nick`='$nick' WHERE `player_id`=$cid");
|
mysql_update("UPDATE `guild_membership` SET `nick`='$nick' WHERE `player_id`=$cid");
|
||||||
} else {
|
} else {
|
||||||
mysql_update("UPDATE `guild_membership` SET `nick`='' WHERE `player_id`=$cid");
|
mysql_update("UPDATE `guild_membership` SET `nick`='' WHERE `player_id`=$cid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get guild data, using guild id.
|
// Get guild data, using guild id.
|
||||||
@ -554,9 +553,9 @@ function get_guilds_list() {
|
|||||||
|
|
||||||
// Get array of player data related to a guild.
|
// Get array of player data related to a guild.
|
||||||
function get_guild_players($gid) {
|
function get_guild_players($gid) {
|
||||||
$gid = (int)$gid; // Sanitizing the parameter id
|
$gid = (int)$gid; // Sanitizing the parameter id
|
||||||
if (config('ServerEngine') !== 'TFS_10') return mysql_select_multi("SELECT `p`.`id`, `p`.`rank_id`, `p`.`name`, `p`.`level`, `p`.`guildnick`, `p`.`vocation`, `p`.`online`, `gr`.`name` AS `rank_name`, `gr`.`level` AS `rank_level` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` ='$gid' ORDER BY `gr`.`id`, `p`.`name`;");
|
if (config('ServerEngine') !== 'TFS_10') return mysql_select_multi("SELECT `p`.`id`, `p`.`rank_id`, `p`.`name`, `p`.`level`, `p`.`guildnick`, `p`.`vocation`, `p`.`online`, `gr`.`name` AS `rank_name`, `gr`.`level` AS `rank_level` FROM `players` AS `p` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `p`.`rank_id` WHERE `gr`.`guild_id` ='$gid' ORDER BY `gr`.`id`, `p`.`name`;");
|
||||||
else return mysql_select_multi("SELECT `p`.`id`, `p`.`name`, `p`.`level`, `p`.`vocation`, `gm`.`rank_id`, `gm`.`nick` AS `guildnick`, `gr`.`name` AS `rank_name`, `gr`.`level` AS `rank_level` FROM `players` AS `p` LEFT JOIN `guild_membership` AS `gm` ON `gm`.`player_id` = `p`.`id` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `gm`.`rank_id` WHERE `gm`.`guild_id` = '$gid' ORDER BY `gm`.`rank_id`, `p`.`name`");
|
else return mysql_select_multi("SELECT `p`.`id`, `p`.`name`, `p`.`level`, `p`.`vocation`, `gm`.`rank_id`, `gm`.`nick` AS `guildnick`, `gr`.`name` AS `rank_name`, `gr`.`level` AS `rank_level` FROM `players` AS `p` LEFT JOIN `guild_membership` AS `gm` ON `gm`.`player_id` = `p`.`id` LEFT JOIN `guild_ranks` AS `gr` ON `gr`.`id` = `gm`.`rank_id` WHERE `gm`.`guild_id` = '$gid' ORDER BY `gm`.`rank_id`, `p`.`name`");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get guild level data (avg level, total level, count of players)
|
// Get guild level data (avg level, total level, count of players)
|
||||||
@ -660,20 +659,20 @@ function gesior_sql_killer($did) {
|
|||||||
|
|
||||||
// ADMIN FUNCTIONS
|
// ADMIN FUNCTIONS
|
||||||
function set_ingame_position($name, $acctype) {
|
function set_ingame_position($name, $acctype) {
|
||||||
$acctype = (int)$acctype;
|
$acctype = (int)$acctype;
|
||||||
$name = sanitize($name);
|
$name = sanitize($name);
|
||||||
|
|
||||||
$acc_id = user_character_account_id($name);
|
$acc_id = user_character_account_id($name);
|
||||||
$char_id = user_character_id($name);
|
$char_id = user_character_id($name);
|
||||||
|
|
||||||
$group_id = 1;
|
$group_id = 1;
|
||||||
if ($acctype == 4) {
|
if ($acctype == 4) {
|
||||||
$group_id = 2;
|
$group_id = 2;
|
||||||
} elseif ($acctype >= 5) {
|
} elseif ($acctype >= 5) {
|
||||||
$group_id = 3;
|
$group_id = 3;
|
||||||
}
|
}
|
||||||
mysql_update("UPDATE `accounts` SET `type` = '$acctype' WHERE `id` =$acc_id;");
|
mysql_update("UPDATE `accounts` SET `type` = '$acctype' WHERE `id` =$acc_id;");
|
||||||
mysql_update("UPDATE `players` SET `group_id` = '$group_id' WHERE `id` =$char_id;");
|
mysql_update("UPDATE `players` SET `group_id` = '$group_id' WHERE `id` =$char_id;");
|
||||||
}
|
}
|
||||||
|
|
||||||
// .3
|
// .3
|
||||||
@ -1290,11 +1289,11 @@ function user_create_character($character_data) {
|
|||||||
// This is TFS 0.2 compatible import data with Znote AAC mysql schema
|
// This is TFS 0.2 compatible import data with Znote AAC mysql schema
|
||||||
if (config('ServerEngine') !== 'OTHIRE') {
|
if (config('ServerEngine') !== 'OTHIRE') {
|
||||||
$import_data = array(
|
$import_data = array(
|
||||||
'name' => $character_data['name'],
|
'name' => $character_data['name'],
|
||||||
'group_id' => 1,
|
'group_id' => 1,
|
||||||
'account_id' => $character_data['account_id'],
|
'account_id' => $character_data['account_id'],
|
||||||
'level' => $create['level'],
|
'level' => $create['level'],
|
||||||
'vocation' => $vocation,
|
'vocation' => $vocation,
|
||||||
'health' => $health,
|
'health' => $health,
|
||||||
'healthmax' => $health,
|
'healthmax' => $health,
|
||||||
'experience' => level_to_experience($create['level']),
|
'experience' => level_to_experience($create['level']),
|
||||||
@ -1335,11 +1334,11 @@ function user_create_character($character_data) {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$import_data = array(
|
$import_data = array(
|
||||||
'name' => $character_data['name'],
|
'name' => $character_data['name'],
|
||||||
'group_id' => 1,
|
'group_id' => 1,
|
||||||
'account_id' => $character_data['account_id'],
|
'account_id' => $character_data['account_id'],
|
||||||
'level' => $create['level'],
|
'level' => $create['level'],
|
||||||
'vocation' => $vocation,
|
'vocation' => $vocation,
|
||||||
'health' => $health,
|
'health' => $health,
|
||||||
'healthmax' => $health,
|
'healthmax' => $health,
|
||||||
'experience' => level_to_experience($create['level']),
|
'experience' => level_to_experience($create['level']),
|
||||||
@ -1590,10 +1589,10 @@ function user_exist($username) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function user_name($id) { //USERNAME FROM PLAYER ID
|
function user_name($id) { //USERNAME FROM PLAYER ID
|
||||||
$id = (int)$id;
|
$id = (int)$id;
|
||||||
$name = mysql_select_single("SELECT `name` FROM `players` WHERE `id`='$id';");
|
$name = mysql_select_single("SELECT `name` FROM `players` WHERE `id`='$id';");
|
||||||
if ($name !== false) return $name['name'];
|
if ($name !== false) return $name['name'];
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks that character name exist
|
// Checks that character name exist
|
||||||
|
@ -699,7 +699,7 @@ if ($highest_access >= 2) {
|
|||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
<?php if ($config['guild_allow_nicknames']): ?>
|
<?php if ($config['guild_allow_nicknames']): ?>
|
||||||
<!-- FORMS TO CHANGE GUILD NICK -->
|
<!-- FORMS TO CHANGE GUILD NICK -->
|
||||||
<form action="" method="post">
|
<form action="" method="post">
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
$start = $time;
|
$start = $time;
|
||||||
include 'layout/head.php'; ?>
|
include 'layout/head.php'; ?>
|
||||||
<body<?php if (isset($page_filename) && strlen($page_filename) > 0) echo " class='page_{$page_filename}'"; ?>>
|
<body<?php if (isset($page_filename) && strlen($page_filename) > 0) echo " class='page_{$page_filename}'"; ?>>
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<?php include 'layout/header.php'; ?>
|
<?php include 'layout/header.php'; ?>
|
||||||
<div id="site_content">
|
<div id="site_content">
|
||||||
<?php include 'layout/aside.php'; ?>
|
<?php include 'layout/aside.php'; ?>
|
||||||
<div class="content">
|
<div class="content">
|
@ -8,35 +8,35 @@ $otdir = 'misc/';
|
|||||||
|
|
||||||
// In percent (highest first).
|
// In percent (highest first).
|
||||||
$rarity = array(
|
$rarity = array(
|
||||||
'Not Rare' => 7,
|
'Not Rare' => 7,
|
||||||
'Semi Rare' => 2,
|
'Semi Rare' => 2,
|
||||||
'Rare' => 0.5,
|
'Rare' => 0.5,
|
||||||
'Very Rare' => 0
|
'Very Rare' => 0
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
function toggleVisibility(obj) {
|
function toggleVisibility(obj) {
|
||||||
var el = document.getElementById('d' + obj.id);
|
var el = document.getElementById('d' + obj.id);
|
||||||
var name = obj.innerHTML.substring(4);
|
var name = obj.innerHTML.substring(4);
|
||||||
|
|
||||||
if(el.style.display == 'none') {
|
if(el.style.display == 'none') {
|
||||||
obj.innerHTML = '[ -]';
|
obj.innerHTML = '[ -]';
|
||||||
el.style.display = 'block';
|
el.style.display = 'block';
|
||||||
} else {
|
} else {
|
||||||
obj.innerHTML = '[+]';
|
obj.innerHTML = '[+]';
|
||||||
el.style.display = 'none';
|
el.style.display = 'none';
|
||||||
}
|
}
|
||||||
obj.innerHTML += ' ' + name;
|
obj.innerHTML += ' ' + name;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if(isset($_GET['lootrate']))
|
if(isset($_GET['lootrate']))
|
||||||
$add = '&lootrate';
|
$add = '&lootrate';
|
||||||
echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . ($add ? '?lootrate' : '')) . '">Hide None</a> | ';
|
echo '<a href="' . htmlspecialchars($_SERVER['PHP_SELF'] . ($add ? '?lootrate' : '')) . '">Hide None</a> | ';
|
||||||
echo '<a href="?hidefail' . $add . '">Hide Not Found</a> | ';
|
echo '<a href="?hidefail' . $add . '">Hide Not Found</a> | ';
|
||||||
echo '<a href="?hideempty' . $add . '">Hide Monsters Without Loot</a> | ';
|
echo '<a href="?hideempty' . $add . '">Hide Monsters Without Loot</a> | ';
|
||||||
echo '<a href="?hideempty&hidefail' . $add . '">Hide All</a> | ';
|
echo '<a href="?hideempty&hidefail' . $add . '">Hide All</a> | ';
|
||||||
echo '<a href="monsters_loot.php">Use Normal Loot Rate</a> | ';
|
echo '<a href="monsters_loot.php">Use Normal Loot Rate</a> | ';
|
||||||
echo '<a href="?lootrate">Use Server Loot Rate</a>';
|
echo '<a href="?lootrate">Use Server Loot Rate</a>';
|
||||||
?>
|
?>
|
||||||
@ -69,32 +69,32 @@ $rarity = array(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addLoot($loot, $level=1) {
|
function addLoot($loot, $level=1) {
|
||||||
foreach($loot as $test) {
|
foreach($loot as $test) {
|
||||||
$chance = $test['chance'];
|
$chance = $test['chance'];
|
||||||
if(!$chance)
|
if(!$chance)
|
||||||
$chance = $test['chance1'];
|
$chance = $test['chance1'];
|
||||||
|
|
||||||
printLoot($level, $test['id'], $test['countmax'], $chance);
|
printLoot($level, $test['id'], $test['countmax'], $chance);
|
||||||
foreach($test as $k => $v)
|
foreach($test as $k => $v)
|
||||||
addLoot($v->item, $level + 1);
|
addLoot($v->item, $level + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function printLoot($level, $itemid, $count, $chance) {
|
function printLoot($level, $itemid, $count, $chance) {
|
||||||
global $itemList, $rarity;
|
global $itemList, $rarity;
|
||||||
|
|
||||||
$chance /= 1000;
|
$chance /= 1000;
|
||||||
if(isset($_GET['lootrate'])) {
|
if(isset($_GET['lootrate'])) {
|
||||||
global $lootRate;
|
global $lootRate;
|
||||||
$chance *= $lootRate;
|
$chance *= $lootRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($rarity as $lootRarity => $percent){
|
foreach($rarity as $lootRarity => $percent){
|
||||||
if($chance >= $percent) {
|
if($chance >= $percent) {
|
||||||
echo str_repeat("... ", $level) . '<u>' . ($count ? $count : 1) . '</u> <span style="color: #7878FF; font-weight: bold;">' . $itemList[(int)$itemid] . '</span> - <span style="color: #C45; font-weight: bold;">' . $lootRarity . '</span> (<span style="color: #FF9A9A;">' . $chance . '%</span>)<br>';
|
echo str_repeat("... ", $level) . '<u>' . ($count ? $count : 1) . '</u> <span style="color: #7878FF; font-weight: bold;">' . $itemList[(int)$itemid] . '</span> - <span style="color: #C45; font-weight: bold;">' . $lootRarity . '</span> (<span style="color: #FF9A9A;">' . $chance . '%</span>)<br>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php include 'layout/overall/footer.php'; ?>
|
<?php include 'layout/overall/footer.php'; ?>
|
||||||
|
24
register.php
24
register.php
@ -37,16 +37,16 @@ if (empty($_POST) === false) {
|
|||||||
$errors[] = 'This account name is blocked for registration.';
|
$errors[] = 'This account name is blocked for registration.';
|
||||||
}
|
}
|
||||||
if ($config['ServerEngine'] !== 'OTHIRE' && $config['client'] >= 830) {
|
if ($config['ServerEngine'] !== 'OTHIRE' && $config['client'] >= 830) {
|
||||||
if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']) == false) {
|
if (preg_match("/^[a-zA-Z0-9]+$/", $_POST['username']) == false) {
|
||||||
$errors[] = 'Your account name can only contain characters a-z, A-Z and 0-9.';
|
$errors[] = 'Your account name can only contain characters a-z, A-Z and 0-9.';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (preg_match("/^[0-9]+$/", $_POST['username']) == false) {
|
if (preg_match("/^[0-9]+$/", $_POST['username']) == false) {
|
||||||
$errors[] = 'Your account can only contain numbers 0-9.';
|
$errors[] = 'Your account can only contain numbers 0-9.';
|
||||||
}
|
}
|
||||||
if ((int)$_POST['username'] < 100000 || (int)$_POST['username'] > 999999999) {
|
if ((int)$_POST['username'] < 100000 || (int)$_POST['username'] > 999999999) {
|
||||||
$errors[] = 'Your account number must be a value between 6-8 numbers long.';
|
$errors[] = 'Your account number must be a value between 6-8 numbers long.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// name restriction
|
// name restriction
|
||||||
$resname = explode(" ", $_POST['username']);
|
$resname = explode(" ", $_POST['username']);
|
||||||
@ -83,9 +83,9 @@ if (empty($_POST) === false) {
|
|||||||
if (validate_ip(getIP()) === false && $config['validate_IP'] === true) {
|
if (validate_ip(getIP()) === false && $config['validate_IP'] === true) {
|
||||||
$errors[] = 'Failed to recognize your IP address. (Not a valid IPv4 address).';
|
$errors[] = 'Failed to recognize your IP address. (Not a valid IPv4 address).';
|
||||||
}
|
}
|
||||||
if (strlen($_POST['flag']) < 1) {
|
if (strlen($_POST['flag']) < 1) {
|
||||||
$errors[] = 'Please choose country.';
|
$errors[] = 'Please choose country.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
shop.php
16
shop.php
@ -376,18 +376,18 @@ foreach ($shop_list as $key => $offer) {
|
|||||||
<?php if ($shop['enableShopConfirmation']) { ?>
|
<?php if ($shop['enableShopConfirmation']) { ?>
|
||||||
<script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
|
<script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$(".needconfirmation").each(function(e){
|
$(".needconfirmation").each(function(e){
|
||||||
$(this).click(function(e){
|
$(this).click(function(e){
|
||||||
var itemname = $(this).attr("data-item-name");
|
var itemname = $(this).attr("data-item-name");
|
||||||
var itemcost = $(this).attr("data-item-cost");
|
var itemcost = $(this).attr("data-item-cost");
|
||||||
var r = confirm("Do you really want to purchase "+itemname+" for "+itemcost+" points?")
|
var r = confirm("Do you really want to purchase "+itemname+" for "+itemcost+" points?")
|
||||||
if(r == false){
|
if(r == false){
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ $cache = new Cache('engine/cache/support');
|
|||||||
if ($cache->hasExpired()) {
|
if ($cache->hasExpired()) {
|
||||||
// Fetch all staffs in-game.
|
// Fetch all staffs in-game.
|
||||||
if ($config['ServerEngine'] == 'TFS_03') {
|
if ($config['ServerEngine'] == 'TFS_03') {
|
||||||
$staffs = support_list03();
|
$staffs = support_list03();
|
||||||
} else $staffs = support_list();
|
} else $staffs = support_list();
|
||||||
// Fetch group ids and names from config.php
|
// Fetch group ids and names from config.php
|
||||||
$groups = $config['ingame_positions'];
|
$groups = $config['ingame_positions'];
|
||||||
|
246
topguilds.php
246
topguilds.php
@ -1,151 +1,151 @@
|
|||||||
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
|
<?php require_once 'engine/init.php'; include 'layout/overall/header.php';
|
||||||
|
|
||||||
// Cache the results
|
// Cache the results
|
||||||
$cache = new Cache('engine/cache/topGuilds');
|
$cache = new Cache('engine/cache/topGuilds');
|
||||||
if ($cache->hasExpired()) {
|
if ($cache->hasExpired()) {
|
||||||
$guilds = mysql_select_multi("SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 10;");
|
$guilds = mysql_select_multi("SELECT `g`.`id` AS `id`, `g`.`name` AS `name`, COUNT(`g`.`name`) as `frags` FROM `players` p LEFT JOIN `player_deaths` pd ON `pd`.`killed_by` = `p`.`name` LEFT JOIN `guild_membership` gm ON `p`.`id` = `gm`.`player_id` LEFT JOIN `guilds` g ON `gm`.`guild_id` = `g`.`id` WHERE `pd`.`unjustified` = 1 GROUP BY `name` ORDER BY `frags` DESC, `name` ASC LIMIT 0, 10;");
|
||||||
|
|
||||||
$cache->setContent($guilds);
|
$cache->setContent($guilds);
|
||||||
$cache->save();
|
$cache->save();
|
||||||
} else {
|
} else {
|
||||||
$guilds = $cache->load();
|
$guilds = $cache->load();
|
||||||
}
|
}
|
||||||
$count = 1;
|
$count = 1;
|
||||||
|
|
||||||
function convert_number_to_words($number) {
|
function convert_number_to_words($number) {
|
||||||
|
|
||||||
$hyphen = '-';
|
$hyphen = '-';
|
||||||
$conjunction = ' and ';
|
$conjunction = ' and ';
|
||||||
$separator = ', ';
|
$separator = ', ';
|
||||||
$negative = 'negative ';
|
$negative= 'negative ';
|
||||||
$decimal = ' point ';
|
$decimal = ' point ';
|
||||||
$dictionary = array(
|
$dictionary = array(
|
||||||
0 => 'zero',
|
0 => 'zero',
|
||||||
1 => 'First',
|
1 => 'first',
|
||||||
2 => 'Second',
|
2 => 'second',
|
||||||
3 => 'Third',
|
3 => 'third',
|
||||||
4 => 'Fourth',
|
4 => 'fourth',
|
||||||
5 => 'Fifth',
|
5 => 'fifth',
|
||||||
6 => 'Sixth',
|
6 => 'sixth',
|
||||||
7 => 'Seventh',
|
7 => 'seventh',
|
||||||
8 => 'Eighth',
|
8 => 'eighth',
|
||||||
9 => 'Ninth',
|
9 => 'ninth',
|
||||||
10 => 'Tenth',
|
10 => 'tenth',
|
||||||
11 => 'eleventh',
|
11 => 'eleventh',
|
||||||
12 => 'twelve',
|
12 => 'twelve',
|
||||||
13 => 'thirteen',
|
13 => 'thirteen',
|
||||||
14 => 'fourteen',
|
14 => 'fourteen',
|
||||||
15 => 'fifteen',
|
15 => 'fifteen',
|
||||||
16 => 'sixteen',
|
16 => 'sixteen',
|
||||||
17 => 'seventeen',
|
17 => 'seventeen',
|
||||||
18 => 'eighteen',
|
18 => 'eighteen',
|
||||||
19 => 'nineteen',
|
19 => 'nineteen',
|
||||||
20 => 'twenty',
|
20 => 'twenty',
|
||||||
30 => 'thirty',
|
30 => 'thirty',
|
||||||
40 => 'fourty',
|
40 => 'fourty',
|
||||||
50 => 'fifty',
|
50 => 'fifty',
|
||||||
60 => 'sixty',
|
60 => 'sixty',
|
||||||
70 => 'seventy',
|
70 => 'seventy',
|
||||||
80 => 'eighty',
|
80 => 'eighty',
|
||||||
90 => 'ninety',
|
90 => 'ninety',
|
||||||
100 => 'hundred',
|
100 => 'hundred',
|
||||||
1000 => 'thousand',
|
1000 => 'thousand',
|
||||||
1000000 => 'million',
|
1000000 => 'million',
|
||||||
1000000000 => 'billion',
|
1000000000 => 'billion',
|
||||||
1000000000000 => 'trillion',
|
1000000000000 => 'trillion',
|
||||||
1000000000000000 => 'quadrillion',
|
1000000000000000 => 'quadrillion',
|
||||||
1000000000000000000 => 'quintillion'
|
1000000000000000000 => 'quintillion'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!is_numeric($number)) {
|
if (!is_numeric($number)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {
|
if (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {
|
||||||
// overflow
|
// overflow
|
||||||
trigger_error(
|
trigger_error(
|
||||||
'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,
|
'convert_number_to_words only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,
|
||||||
E_USER_WARNING
|
E_USER_WARNING
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($number < 0) {
|
if ($number < 0) {
|
||||||
return $negative . convert_number_to_words(abs($number));
|
return $negative . convert_number_to_words(abs($number));
|
||||||
}
|
}
|
||||||
|
|
||||||
$string = $fraction = null;
|
$string = $fraction = null;
|
||||||
|
|
||||||
if (strpos($number, '.') !== false) {
|
if (strpos($number, '.') !== false) {
|
||||||
list($number, $fraction) = explode('.', $number);
|
list($number, $fraction) = explode('.', $number);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case $number < 21:
|
case $number < 21:
|
||||||
$string = $dictionary[$number];
|
$string = $dictionary[$number];
|
||||||
break;
|
break;
|
||||||
case $number < 100:
|
case $number < 100:
|
||||||
$tens = ((int) ($number / 10)) * 10;
|
$tens = ((int) ($number / 10)) * 10;
|
||||||
$units = $number % 10;
|
$units = $number % 10;
|
||||||
$string = $dictionary[$tens];
|
$string = $dictionary[$tens];
|
||||||
if ($units) {
|
if ($units) {
|
||||||
$string .= $hyphen . $dictionary[$units];
|
$string .= $hyphen . $dictionary[$units];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case $number < 1000:
|
case $number < 1000:
|
||||||
$hundreds = $number / 100;
|
$hundreds = $number / 100;
|
||||||
$remainder = $number % 100;
|
$remainder = $number % 100;
|
||||||
$string = $dictionary[$hundreds] . ' ' . $dictionary[100];
|
$string = $dictionary[$hundreds] . ' ' . $dictionary[100];
|
||||||
if ($remainder) {
|
if ($remainder) {
|
||||||
$string .= $conjunction . convert_number_to_words($remainder);
|
$string .= $conjunction . convert_number_to_words($remainder);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$baseUnit = pow(1000, floor(log($number, 1000)));
|
$baseUnit = pow(1000, floor(log($number, 1000)));
|
||||||
$numBaseUnits = (int) ($number / $baseUnit);
|
$numBaseUnits = (int) ($number / $baseUnit);
|
||||||
$remainder = $number % $baseUnit;
|
$remainder = $number % $baseUnit;
|
||||||
$string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];
|
$string = convert_number_to_words($numBaseUnits) . ' ' . $dictionary[$baseUnit];
|
||||||
if ($remainder) {
|
if ($remainder) {
|
||||||
$string .= $remainder < 100 ? $conjunction : $separator;
|
$string .= $remainder < 100 ? $conjunction : $separator;
|
||||||
$string .= convert_number_to_words($remainder);
|
$string .= convert_number_to_words($remainder);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $fraction && is_numeric($fraction)) {
|
if (null !== $fraction && is_numeric($fraction)) {
|
||||||
$string .= $decimal;
|
$string .= $decimal;
|
||||||
$words = array();
|
$words = array();
|
||||||
foreach (str_split((string) $fraction) as $number) {
|
foreach (str_split((string) $fraction) as $number) {
|
||||||
$words[] = $dictionary[$number];
|
$words[] = $dictionary[$number];
|
||||||
}
|
}
|
||||||
$string .= implode(' ', $words);
|
$string .= implode(' ', $words);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $string;
|
return $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($guilds) || $guilds !== false) {
|
if (!empty($guilds) || $guilds !== false) {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<table id="onlinelistTable" class="table table-striped table-hover">
|
<table id="onlinelistTable" class="table table-striped table-hover">
|
||||||
<tr class="yellow">
|
<tr class="yellow">
|
||||||
<b><tr><h3><center>Top 10 guilds with most frags</center></h3></tr></b>
|
<b><tr><h3><center>Top 10 guilds with most frags</center></h3></tr></b>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th>Name:</th>
|
<th>Name:</th>
|
||||||
<th>Frags:</th>
|
<th>Frags:</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($guilds as $guild) {
|
<?php foreach ($guilds as $guild) {
|
||||||
|
|
||||||
$url = url("guilds.php?name=". $guild['name']);
|
$url = url("guilds.php?name=". $guild['name']);
|
||||||
echo '<tr class="special" onclick="javascript:window.location.href=\'' . $url . '\'">'; ?>
|
echo '<tr class="special" onclick="javascript:window.location.href=\'' . $url . '\'">'; ?>
|
||||||
<td><?php echo convert_number_to_words($count);
|
<td><?php echo convert_number_to_words($count);
|
||||||
$count++; ?></td>
|
$count++; ?></td>
|
||||||
<td><a href="" onclick="return false"><?php echo $guild['name']; ?></a></td>
|
<td><a href="" onclick="return false"><?php echo $guild['name']; ?></a></td>
|
||||||
<td><?php echo $guild['frags']; ?></td>
|
<td><?php echo $guild['frags']; ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
} else echo '<h1>No frags yet.</h1>';
|
} else echo '<h1>No frags yet.</h1>';
|
||||||
include 'layout/overall/footer.php'; ?>
|
include 'layout/overall/footer.php'; ?>
|
||||||
|
14
twtrNews.php
14
twtrNews.php
@ -1,10 +1,10 @@
|
|||||||
<a class="twitter-timeline" href="https://twitter.com/ZnoteAAC" data-widget-id="353297614114021376">Tweets from @ZnoteAAC</a>
|
<a class="twitter-timeline" href="https://twitter.com/ZnoteAAC" data-widget-id="353297614114021376">Tweets from @ZnoteAAC</a>
|
||||||
<script>
|
<script>
|
||||||
!function(d,s,id){
|
!function(d,s,id){
|
||||||
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
|
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
|
||||||
if(!d.getElementById(id)){
|
if(!d.getElementById(id)){
|
||||||
js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";
|
js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";
|
||||||
fjs.parentNode.insertBefore(js,fjs);
|
fjs.parentNode.insertBefore(js,fjs);
|
||||||
}
|
}
|
||||||
}(document,"script","twitter-wjs");
|
}(document,"script","twitter-wjs");
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user