mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-03 20:59:20 +02:00
TFS 0.3 OTX guild and guildwar support. Fix #134
This commit is contained in:
parent
fb061f7510
commit
5349c96018
14
config.php
14
config.php
@ -4,7 +4,9 @@
|
||||
// TFS 0.3 = TFS_03 (If ur using 0.3.6, set $config['salt'] to false)!
|
||||
// TFS 0.4 = TFS_03
|
||||
// TFS 1.0 = TFS_10 (Under developement)
|
||||
$config['TFSVersion'] = 'TFS_10';
|
||||
$config['TFSVersion'] = 'TFS_03';
|
||||
// As far as I know, OTX is based on TFS_03, so make sure TFS version is configured TFS_03
|
||||
$config['CustomVersion'] = 'OTX'; // Not using OTX? Replace 'OTX' with: false
|
||||
|
||||
$config['site_title'] = 'Znote AAC';
|
||||
$config['site_title_context'] = 'Because open communities are good communities. :3';
|
||||
@ -18,13 +20,13 @@
|
||||
// ------------------------ \\
|
||||
|
||||
// phpmyadmin username for OT server: (DONT USE "root" if ur hosting to public.).
|
||||
$config['sqlUser'] = 'tfs10';
|
||||
$config['sqlUser'] = 'otx03';
|
||||
|
||||
// phpmyadmin password for OT server:
|
||||
$config['sqlPassword'] = 'tfs10';
|
||||
$config['sqlPassword'] = 'otx03';
|
||||
|
||||
// The database name to connect to. (This is usually same as username).
|
||||
$config['sqlDatabase'] = 'tfs10';
|
||||
$config['sqlDatabase'] = 'otx03';
|
||||
|
||||
// Hostname is usually localhost or 127.0.0.1.
|
||||
$config['sqlHost'] = 'localhost';
|
||||
@ -333,7 +335,7 @@
|
||||
$config['page_admin_access'] = array(
|
||||
//'otland0',
|
||||
//'otland1',
|
||||
'znote'
|
||||
//'znote'
|
||||
);
|
||||
|
||||
// Built-in FORUM
|
||||
@ -376,7 +378,7 @@
|
||||
// You can use the official server: http://zeotss.znote.eu/
|
||||
// Or host your own private one, here is the code: https://github.com/Znote/ZEOTSS
|
||||
$config['zeotss'] = array(
|
||||
'enabled' => true,
|
||||
'enabled' => false,
|
||||
'visitors' => true,
|
||||
'server' => "http://zeotss.znote.eu/"
|
||||
);
|
||||
|
@ -527,18 +527,17 @@ function get_guild_war($warid) {
|
||||
function get_guild_war03($warid) {
|
||||
$warid = (int)$warid; // Sanitizing the parameter id
|
||||
|
||||
$wars = mysql_select_multi("SELECT `id`, `guild_id`, `enemy_id`, `status`, `begin`, `end` FROM `guild_wars` ORDER BY `begin` DESC LIMIT 0, 30");
|
||||
if ($wars !== false) {
|
||||
for ($i = 0; $i < count($wars); $i++) {
|
||||
$wars[$i]['guild1'] = $wars[$i]['guild_id'];
|
||||
$wars[$i]['guild2'] = $wars[$i]['enemy_id'];
|
||||
$wars[$i]['name1'] = get_guild_name($wars[$i]['guild_id']);
|
||||
$wars[$i]['name2'] = get_guild_name($wars[$i]['enemy_id']);
|
||||
$wars[$i]['started'] = $wars[$i]['begin'];
|
||||
$wars[$i]['ended'] = $wars[$i]['end'];
|
||||
}
|
||||
$war = mysql_select_single("SELECT `id`, `guild_id`, `enemy_id`, `status`, `begin`, `end`
|
||||
FROM `guild_wars` WHERE `id`=$warid ORDER BY `begin` DESC LIMIT 0, 30");
|
||||
if ($war !== false) {
|
||||
$war['guild1'] = $war['guild_id'];
|
||||
$war['guild2'] = $war['enemy_id'];
|
||||
$war['name1'] = get_guild_name($war['guild_id']);
|
||||
$war['name2'] = get_guild_name($war['enemy_id']);
|
||||
$war['started'] = $war['begin'];
|
||||
$war['ended'] = $war['end'];
|
||||
}
|
||||
return $wars;
|
||||
return $war;
|
||||
}
|
||||
|
||||
// List all war entries
|
||||
|
12
guilds.php
12
guilds.php
@ -1,5 +1,6 @@
|
||||
<?php require_once 'engine/init.php';
|
||||
if ($config['require_login']['guilds']) protect_page();
|
||||
$isOtx = ($config['CustomVersion'] == 'OTX') ? true : false;
|
||||
include 'layout/overall/header.php';
|
||||
|
||||
if (user_logged_in() === true) {
|
||||
@ -192,9 +193,16 @@ if (user_logged_in() === true) {
|
||||
}
|
||||
|
||||
foreach ($players as $player) {
|
||||
if ($config['TFSVersion'] !== 'TFS_10') $chardata = user_character_data($player['id'], 'online');
|
||||
else $chardata['online'] = (in_array($player['id'], $onlinelist)) ? 1 : 0;
|
||||
if ($config['TFSVersion'] !== 'TFS_10') {
|
||||
if ($isOtx) {
|
||||
$chardata = mysql_select_single("SELECT `online` FROM `players` WHERE `name`='".$player['name']."' LIMIT 1;");
|
||||
} else $chardata = user_character_data($player['id'], 'online');
|
||||
} else $chardata['online'] = (in_array($player['id'], $onlinelist)) ? 1 : 0;
|
||||
echo '<tr>';
|
||||
if ($isOtx) {
|
||||
$rankdata = mysql_select_single("SELECT `name` FROM `guild_ranks` WHERE `id`='".$player['rank_id']."' LIMIT 1;");
|
||||
$player['rank_name'] = $rankdata['name'];
|
||||
}
|
||||
echo '<td>'. $player['rank_name'] .'</td>';
|
||||
echo '<td><a href="characterprofile.php?name='. $player['name'] .'">'. $player['name'] .'</a></td>';
|
||||
echo '<td>'. $player['level'] .'</td>';
|
||||
|
@ -5,6 +5,7 @@ if ($config['guildwar_enabled'] === false) {
|
||||
header('Location: guilds.php');
|
||||
exit();
|
||||
}
|
||||
$isOtx = ($config['CustomVersion'] == 'OTX') ? true : false;
|
||||
include 'layout/overall/header.php';
|
||||
|
||||
if (!empty($_GET['warid'])) {
|
||||
@ -18,8 +19,6 @@ if (!empty($_GET['warid'])) {
|
||||
// Kills data for this specific war entry
|
||||
if ($config['TFSVersion'] == 'TFS_02' || $config['TFSVersion'] == 'TFS_10') $kills = get_war_kills($warid);
|
||||
else if ($config['TFSVersion'] == 'TFS_03') $kills = get_war_kills03($warid);
|
||||
// XDXD
|
||||
|
||||
?>
|
||||
<h1><?php echo $war['name1']; ?> - VERSUS - <?php echo $war['name2']; ?></h1>
|
||||
|
||||
@ -153,7 +152,6 @@ if (!empty($_GET['warid'])) {
|
||||
//echo $wardata[0]['name1'];
|
||||
//die(var_dump($wardata));
|
||||
if ($wardata != false) {
|
||||
|
||||
// kills data
|
||||
$killsdata = array(); // killsdata[guildid] => array(warid) => array info about the selected war entry
|
||||
foreach ($wardata as $wars) {
|
||||
@ -173,7 +171,8 @@ if (!empty($_GET['warid'])) {
|
||||
$guild_1_kills = 0;
|
||||
$guild_2_kills = 0;
|
||||
foreach (($killsdata[$wars['id']] ? $killsdata[$wars['id']] : array()) as $kill) {
|
||||
if ($kill['killerguild'] == $wars['guild1'])
|
||||
|
||||
if ($isOtx && $kill['guild_id'] == $wars['guild1'] || !$isOtx && $kill['killerguild'] == $wars['guild1'])
|
||||
$guild_1_kills++;
|
||||
else
|
||||
$guild_2_kills++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user