diff --git a/README.md b/README.md
index 7622638..128ed54 100644
--- a/README.md
+++ b/README.md
@@ -44,17 +44,16 @@ This will show you the rest of the instructions as well as the mysql schema.
### This is the developement repository for the Znote AAC project.
# TODO 1.5:
-* TFS 1.0 House system
-* TFS 1.0 Guilds
* TFS 1.0 LUA scripts (Shop system, first items)
# TODO 1.6:
* Recovery key
* Email system
-* Character auction house for shop points
+* Character auction for shop points
* Database shop offers
* Manage shop offers without touching code
* Live TFS 1.0 integration
# Removed from TODO:
-* TFS 1.0 Livestream (Since Hani rejected to release sources for this I have no intention of adding support for it).
\ No newline at end of file
+* TFS 1.0 Livestream
+Reason: Not open source, not legally available on any official free TFS distributions.
\ No newline at end of file
diff --git a/characterprofile.php b/characterprofile.php
index 73e7bb3..2c01f1a 100644
--- a/characterprofile.php
+++ b/characterprofile.php
@@ -4,9 +4,8 @@ if ($config['log_ip']) {
}
if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
$name = $_GET['name'];
-
- if (user_character_exist($name)) {
- $user_id = user_character_id($name);
+ $user_id = user_character_exist($name);
+ if ($user_id !== false) {
if ($config['TFSVersion'] == 'TFS_10') {
$profile_data = user_character_data($user_id, 'name', 'level', 'vocation', 'lastlogin');
$profile_data['online'] = user_is_online_10($user_id);
@@ -22,7 +21,6 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
?>
-
Profile:
- Level:
@@ -92,6 +90,7 @@ if (isset($_GET['name']) === true && empty($_GET['name']) === false) {
}
//Done.
} else if ($config['TFSVersion'] == 'TFS_03') {
+ //mysql_select_single("SELECT * FROM players WHERE name='TEST DEBUG';");
$array = user_fetch_deathlist03($user_id);
if ($array) {
?>
diff --git a/config.php b/config.php
index 3eed81e..dda7d26 100644
--- a/config.php
+++ b/config.php
@@ -14,13 +14,13 @@
// ------------------------ \\
// phpmyadmin username for OT server: (DONT USE "root" if ur hosting to public.).
- $config['sqlUser'] = 'dev';
+ $config['sqlUser'] = 'daler';
// phpmyadmin password for OT server:
- $config['sqlPassword'] = 'dev';
+ $config['sqlPassword'] = 'daler';
// The database name to connect to. (This is usually same as username).
- $config['sqlDatabase'] = 'dev';
+ $config['sqlDatabase'] = 'daler';
// Hostname is usually localhost or 127.0.0.1.
$config['sqlHost'] = 'localhost';
@@ -192,7 +192,7 @@
$config['port'] = 7171; // Port number to connect to your OT.
// How often do you want highscores to update?
- $config['cache_lifespan'] = 1;//60 * 15; // 15 minutes.
+ $config['cache_lifespan'] = 5;//60 * 15; // 15 minutes.
// WARNING! Account names written here will have admin access to web page!
$config['page_admin_access'] = array(
@@ -338,7 +338,7 @@
to configure flush_ip_logs if IPs are logged.
*/
- $config['log_ip'] = true;
+ $config['log_ip'] = false;
// Flush IP logs each configured seconds, 60 * 15 = 15 minutes.
// Set to false to entirely disable ip log flush.
@@ -415,7 +415,7 @@
'enableShopConfirmation' => true, // Verify that user wants to buy with popup
'useDB' => false, // Fetch offers from database, or the below config array
'showImage' => true,
- 'imageServer' => 'items.znote.eu',
+ 'imageServer' => 'items.halfaway.net',
'imageType' => 'gif',
);
diff --git a/credits.php b/credits.php
index c81f334..3bd6dac 100644
--- a/credits.php
+++ b/credits.php
@@ -4,15 +4,17 @@
This website is powered by the Znote AAC engine.
Developers:
-Main developer: Znote.
+Main developer: Znote.
Thanks to: (in no particular order)
-Chris - PHP OOP file samples, testing, bugfixing.
-
Kiwi Dan - Researching TFS 0.2 for me, participation in developement.
-
Amoaz - Pentesting and security tips.
-
Evan - Researching TFS 0.3, constructive feedback, suggestion and participation.
-
Talaturen - Repository for this AAC.
+Chris - PHP OOP file samples, testing, bugfixing.
+
Kiwi Dan - Researching TFS 0.2 for me, participation in developement.
+
Amoaz - Pentesting and security tips.
+
Evan, Gremlee - Researching TFS 0.3, constructive feedback, suggestion and participation.
+
ATT3 - Reporting and fixing bugs, TFS 1.0 research.
+
Mark - Old repository, TFS distributions which this AAC works against.
+
Tedbro, Exura, PrinterLUA - Reporting bugs
\ No newline at end of file
diff --git a/engine/database/connect.php b/engine/database/connect.php
index 24f5775..a243881 100644
--- a/engine/database/connect.php
+++ b/engine/database/connect.php
@@ -206,6 +206,11 @@ function mysql_znote_escape_string($escapestr) {
// Select single row from database
function mysql_select_single($query) {
global $connect;
+ global $aacQueries;
+ $aacQueries++;
+
+ global $accQueriesData;
+ $accQueriesData[] = $query;
$result = mysqli_query($connect,$query) or die(var_dump($query)."
(query - SQL error)
Type: select_single (select single row from database)
".mysqli_error($connect));
$row = mysqli_fetch_assoc($result);
return !empty($row) ? $row : false;
@@ -214,6 +219,10 @@ function mysql_select_single($query) {
// Selecting multiple rows from database.
function mysql_select_multi($query){
global $connect;
+ global $aacQueries;
+ $aacQueries++;
+ global $accQueriesData;
+ $accQueriesData[] = $query;
$array = array();
$results = mysqli_query($connect,$query) or die(var_dump($query)."
(query - SQL error)
Type: select_multi (select multiple rows from database)
".mysqli_error($connect));
while($row = mysqli_fetch_assoc($results)) {
@@ -234,6 +243,10 @@ function mysql_delete($query){ voidQuery($query); }
// Send a void query
function voidQuery($query) {
global $connect;
+ global $aacQueries;
+ $aacQueries++;
+ global $accQueriesData;
+ $accQueriesData[] = $query;
mysqli_query($connect,$query) or die(var_dump($query)."
(query - SQL error)
Type: voidQuery (voidQuery is used for update, insert or delete from database)
".mysqli_error($connect));
}
?>
\ No newline at end of file
diff --git a/engine/function/users.php b/engine/function/users.php
index ddef958..8a964a2 100644
--- a/engine/function/users.php
+++ b/engine/function/users.php
@@ -43,15 +43,7 @@ function fetchLoosers() {
// Fetch latest deaths
function fetchLatestDeaths($from = 0, $to = 30) {
- $array = mysql_select_multi("SELECT * FROM `player_deaths` ORDER BY `time` DESC LIMIT $from, $to;");
- if ($array !== false) {
- for ($i = 0; $i < count($array); $i++) {
- $data = user_character_data($array[$i]['player_id'], 'name');
- $array[$i]['victim'] = $data['name'];
- unset($array[$i]['player_id']);
- }
- }
- return $array;
+ return mysql_select_multi("SELECT `d`.`level`, `p`.`name` AS `victim`, `d`.`time`, `d`.`is_player`, `d`.`killed_by` FROM `player_deaths` AS `d` INNER JOIN `players` AS `p` ON `d`.`player_id` = `p`.`id` ORDER BY `time` DESC LIMIT $from, $to;");
}
// latest deaths .3 (Based on code from Hauni@otland.net).
@@ -149,17 +141,7 @@ function support_list() {
// NEWS
function fetchAllNews() {
- $data = mysql_select_multi("SELECT * FROM `znote_news` ORDER BY `id` DESC;");
- if ($data !== false) {
- for ($i = 0; $i < count($data); $i++) {
- $player = mysql_select_single("SELECT `name` FROM `players` WHERE `id`='".$data[$i]['pid']."' LIMIT 1;");
- if ($player !== false) $data[$i]['name'] = $player['name'];
- else $data[$i]['name'] = "Player not found.";
-
- unset($data[$i]['pid']);
- }
- }
- return $data;
+ return mysql_select_multi("SELECT `n`.`id`, `n`.`title`, `n`.`text`, `n`.`date`, `p`.`name` FROM `znote_news` AS `n` INNER JOIN `players` AS `p` ON `n`.`pid` = `p`.`id` ORDER BY `n`.`id` DESC;");
}
// HOUSES
@@ -1290,8 +1272,8 @@ function user_name($id) { //USERNAME FROM PLAYER ID
// Checks that character name exist
function user_character_exist($username) {
$username = sanitize($username);
- $data = mysql_select_single("SELECT `id` FROM `players` WHERE `name`='$username';");
- return ($data !== false) ? true : false;
+ $player = mysql_select_single("SELECT `id` FROM `players` WHERE `name`='$username';");
+ return ($player !== false) ? $player['id'] : false;
}
// Checks that this email exist.
diff --git a/engine/init.php b/engine/init.php
index e1c3336..891b7c5 100644
--- a/engine/init.php
+++ b/engine/init.php
@@ -5,6 +5,9 @@ if (version_compare(phpversion(), '5.3.3', '<')) die('PHP 5.3.3 is required
<
$time = time();
$version = '1.5_SVN';
+$aacQueries = 0;
+$accQueriesData = array();
+
session_start();
ob_start();
require 'config.php';
diff --git a/layout/footer.php b/layout/footer.php
index aa86dbe..bb4a361 100644
--- a/layout/footer.php
+++ b/layout/footer.php
@@ -3,13 +3,13 @@
\ No newline at end of file
diff --git a/layout/overall/footer.php b/layout/overall/footer.php
index 9256805..fa9e02a 100644
--- a/layout/overall/footer.php
+++ b/layout/overall/footer.php
@@ -1,3 +1,6 @@
+
diff --git a/layout/widgets/serverinfo.php b/layout/widgets/serverinfo.php
index 028ba3b..23332e8 100644
--- a/layout/widgets/serverinfo.php
+++ b/layout/widgets/serverinfo.php
@@ -21,7 +21,8 @@
}
if ($status) {
?>
- - Players online:
+ - Players online:
+
diff --git a/login.php b/login.php
index 226e0ed..1f0c198 100644
--- a/login.php
+++ b/login.php
@@ -9,7 +9,7 @@ if (empty($_POST) === false) {
}
$username = $_POST['username'];
$password = $_POST['password'];
- data_dump($_POST, false, "POST");
+ //data_dump($_POST, false, "POST");
if (empty($username) || empty($password)) {
$errors[] = 'You need to enter a username and password.';
} else if (strlen($username) > 32 || strlen($password) > 64) {