mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-05-08 07:09:20 +02:00
Toggle guild nick feature in config.php
Fix #407 TFS 1.3 has a potential unresolved crash bug related to guild nicks. You can check out the details here: https://github.com/otland/forgottenserver/issues/2561#issuecomment-633101435
This commit is contained in:
parent
31c233d559
commit
5a80034915
73
config.php
73
config.php
@ -23,7 +23,7 @@
|
||||
$config['site_url'] = "http://demo.znote.eu";
|
||||
|
||||
// Path to server folder without "\" (or "/") at the end, ex: C:\Users\Username\Documents\GitHub\forgottenserver
|
||||
$config['server_path'] = '';
|
||||
$config['server_path'] = '';
|
||||
|
||||
// ------------------------ \\
|
||||
// MYSQL CONNECTION DETAILS \\
|
||||
@ -49,7 +49,7 @@
|
||||
- getClock() = returns current time in numbers.
|
||||
- getClock(time(), true) = returns current time in formatted date
|
||||
- getClock(false, true) = same as above
|
||||
- getClock(false, true, false) = get current time, don't adjust timezone
|
||||
- getClock(false, true, false) = get current time, don't adjust timezone
|
||||
- echo getClock($profile_data['lastlogin'], true); = from characterprofile,
|
||||
explains when user was last logged in. */
|
||||
function getClock($time = false, $format = false, $adjust = true) {
|
||||
@ -65,7 +65,7 @@
|
||||
// ------------------- \\
|
||||
// CUSTOM SERVER STUFF \\
|
||||
// ------------------- \\
|
||||
// Enable / disable Questlog function (true / false)
|
||||
// Enable / disable Questlog function (true / false)
|
||||
$config['EnableQuests'] = false;
|
||||
|
||||
// array for filling questlog (Questid, max value, name, end of the quest fill 1 for the last part 0 for all others)
|
||||
@ -145,8 +145,8 @@
|
||||
'secret' => true
|
||||
),
|
||||
30001 => array(
|
||||
'Allow Cookies?',
|
||||
'With a perfectly harmless smile you fooled all of those wicecrackers into eating your exploding cookies. Consider a boy or girl scout outfit next time to make the trick even better.',
|
||||
'Allow Cookies?',
|
||||
'With a perfectly harmless smile you fooled all of those wicecrackers into eating your exploding cookies. Consider a boy or girl scout outfit next time to make the trick even better.',
|
||||
'points' => '10', // 1-3 points (1 star), 4-6 points (2 stars), 7-9 points(3 stars), 10 points => (4 stars)
|
||||
'secret' => true // show "secret" badge
|
||||
),
|
||||
@ -157,7 +157,7 @@
|
||||
),
|
||||
30003 => array(
|
||||
'Bearhugger',
|
||||
'Warm, furry and cuddly - though that same bear you just hugged would probably rip you into pieces if he had been conscious, he reminded you of that old teddy bear which always slept in your bed when you were still small.',
|
||||
'Warm, furry and cuddly - though that same bear you just hugged would probably rip you into pieces if he had been conscious, he reminded you of that old teddy bear which always slept in your bed when you were still small.',
|
||||
'points' => '4'
|
||||
),
|
||||
30004 => array(
|
||||
@ -167,23 +167,23 @@
|
||||
),
|
||||
30005 => array(
|
||||
'Chorister',
|
||||
'Lalalala... you now know the cult\'s hymn sung in Liberty Bay by heart. Not that hard, considering that it mainly consists of two notes and repetitive lyrics.',
|
||||
'Lalalala... you now know the cult\'s hymn sung in Liberty Bay by heart. Not that hard, considering that it mainly consists of two notes and repetitive lyrics.',
|
||||
'points' => '1'
|
||||
),
|
||||
30006 => array(
|
||||
'Fountain of Life',
|
||||
'You found and took a sip from the Fountain of Life. Thought it didn\'t grant you eternal life, you feel changed and somehow at peace.',
|
||||
'You found and took a sip from the Fountain of Life. Thought it didn\'t grant you eternal life, you feel changed and somehow at peace.',
|
||||
'points' => '1',
|
||||
'secret' => true
|
||||
),
|
||||
30007 => array(
|
||||
'Here, Fishy Fishy!',
|
||||
'Ah, the smell of the sea! Standing at the shore and casting a line is one of your favourite activities. For you, fishing is relaxing - and at the same time, providing easy food. Perfect!',
|
||||
'Ah, the smell of the sea! Standing at the shore and casting a line is one of your favourite activities. For you, fishing is relaxing - and at the same time, providing easy food. Perfect!',
|
||||
'points' => '1'
|
||||
),
|
||||
30008 => array(
|
||||
'Honorary Barbarian',
|
||||
'You\'ve hugged bears, pushed mammoths and proved your drinking skills. And even though you have a slight hangover, a partially fractured rib and some greasy hair on your tongue, you\'re quite proud to call yourself a honorary barbarian from now on.',
|
||||
'You\'ve hugged bears, pushed mammoths and proved your drinking skills. And even though you have a slight hangover, a partially fractured rib and some greasy hair on your tongue, you\'re quite proud to call yourself a honorary barbarian from now on.',
|
||||
'points' => '1'
|
||||
),
|
||||
30009 => array(
|
||||
@ -193,12 +193,12 @@
|
||||
),
|
||||
300010 => array(
|
||||
'Just in Time',
|
||||
'You\'re a fast runner and are good at delivering wares which are bound to decay just in the nick of time, even if you can\'t use any means of transportation or if your hands get cold or smelly in the process.',
|
||||
'You\'re a fast runner and are good at delivering wares which are bound to decay just in the nick of time, even if you can\'t use any means of transportation or if your hands get cold or smelly in the process.',
|
||||
'points' => '1'
|
||||
),
|
||||
30011 => array(
|
||||
'Matchmaker',
|
||||
'You don\'t believe in romance to be a coincidence or in love at first sight. In fact - love potions, bouquets of flowers and cheesy poems do the trick much better than ever could. Keep those hormones flowing!',
|
||||
'You don\'t believe in romance to be a coincidence or in love at first sight. In fact - love potions, bouquets of flowers and cheesy poems do the trick much better than ever could. Keep those hormones flowing!',
|
||||
'points' => '1',
|
||||
'secret' => true
|
||||
),
|
||||
@ -216,7 +216,7 @@
|
||||
),
|
||||
30014 => array(
|
||||
'Secret Agent',
|
||||
'Pack your spy gear and get ready for some dangerous missions in service of a secret agency. You\'ve shown you want to - but can you really do it? Time will tell.',
|
||||
'Pack your spy gear and get ready for some dangerous missions in service of a secret agency. You\'ve shown you want to - but can you really do it? Time will tell.',
|
||||
'points' => '1',
|
||||
'secret' => true
|
||||
),
|
||||
@ -232,7 +232,7 @@
|
||||
),
|
||||
30017 => array(
|
||||
'Worm Whacker',
|
||||
'Weehee! Whack those worms! You sure know how to handle a big hammer.',
|
||||
'Weehee! Whack those worms! You sure know how to handle a big hammer.',
|
||||
'points' => '1',
|
||||
'secret' => true
|
||||
),
|
||||
@ -243,7 +243,7 @@
|
||||
),
|
||||
30019 => array(
|
||||
'Amateur Actor',
|
||||
'You helped bringing Princess Buttercup, Doctor Dumbness and Lucky the Wonder Dog to life - and will probably dream of them tonight, since you memorised your lines perfectly. What a .. special piece of.. screenplay.',
|
||||
'You helped bringing Princess Buttercup, Doctor Dumbness and Lucky the Wonder Dog to life - and will probably dream of them tonight, since you memorised your lines perfectly. What a .. special piece of.. screenplay.',
|
||||
'points' => '2'
|
||||
),
|
||||
30020 => array(
|
||||
@ -269,39 +269,39 @@
|
||||
|
||||
// Vocation IDs, names and which vocation ID they got promoted from
|
||||
$config['vocations'] = array(
|
||||
0 => array(
|
||||
0 => array(
|
||||
'name' => 'No vocation',
|
||||
'fromVoc' => false
|
||||
),
|
||||
1 => array(
|
||||
1 => array(
|
||||
'name' => 'Sorcerer',
|
||||
'fromVoc' => false
|
||||
),
|
||||
2 => array(
|
||||
2 => array(
|
||||
'name' => 'Druid',
|
||||
'fromVoc' => false
|
||||
),
|
||||
3 => array(
|
||||
3 => array(
|
||||
'name' => 'Paladin',
|
||||
'fromVoc' => false
|
||||
),
|
||||
4 => array(
|
||||
4 => array(
|
||||
'name' => 'Knight',
|
||||
'fromVoc' => false
|
||||
),
|
||||
5 => array(
|
||||
5 => array(
|
||||
'name' => 'Master Sorcerer',
|
||||
'fromVoc' => 1
|
||||
),
|
||||
6 => array(
|
||||
6 => array(
|
||||
'name' => 'Elder Druid',
|
||||
'fromVoc' => 2
|
||||
),
|
||||
7 => array(
|
||||
7 => array(
|
||||
'name' => 'Royal Paladin',
|
||||
'fromVoc' => 3
|
||||
),
|
||||
8 => array(
|
||||
8 => array(
|
||||
'name' => 'Elite Knight',
|
||||
'fromVoc' => 4
|
||||
)
|
||||
@ -424,7 +424,7 @@
|
||||
5 => 'Ended',
|
||||
);
|
||||
|
||||
/* -- SUB PAGES --
|
||||
/* -- SUB PAGES --
|
||||
Some custom layouts/templates have custom pages, they can use
|
||||
this sub page functionality for that.
|
||||
*/
|
||||
@ -564,7 +564,7 @@
|
||||
'price_sqm' => '50', // price per house sqm
|
||||
);
|
||||
|
||||
$config['delete_character_interval'] = '3 DAY'; // Delay after user character delete request is executed, ex: 1 DAY, 2 HOUR, 3 MONTH etc.
|
||||
$config['delete_character_interval'] = '3 DAY'; // Delay after user character delete request is executed, ex: 1 DAY, 2 HOUR, 3 MONTH etc.
|
||||
|
||||
$config['validate_IP'] = false;
|
||||
$config['salt'] = false;
|
||||
@ -605,7 +605,7 @@
|
||||
'equipment' => true,
|
||||
'skills' => true,
|
||||
'outfits' => true,
|
||||
// Player storage (storage_value + outfitId)
|
||||
// Player storage (storage_value + outfitId)
|
||||
// used to see if player has outfit.
|
||||
// see LUA scripts folder for otserv code
|
||||
'storage_value' => 10000
|
||||
@ -620,6 +620,11 @@
|
||||
// Do you need to have premium account to create a guild?
|
||||
$config['guild_require_premium'] = true;
|
||||
|
||||
// There is a TFS 1.3 bug related to guild nicks
|
||||
// https://github.com/otland/forgottenserver/issues/2561
|
||||
// So if your using TFS 1.x, you might need to disable guild nicks until the crash has been fixed.
|
||||
$config['guild_allow_nicknames'] = true;
|
||||
|
||||
$config['guildwar_enabled'] = false;
|
||||
|
||||
// Use htaccess rewrite? (basically this makes website.com/username work instead of website.com/characterprofile.php?name=username
|
||||
@ -712,13 +717,13 @@
|
||||
'host' => "mailserver.znote.eu", // Outgoing mail server host.
|
||||
'securityType' => 'ssl', // ssl or tls
|
||||
'port' => 465, // SMTP port number - likely to be 465(ssl) or 587(tls)
|
||||
'email' => 'noreply@znote.eu',
|
||||
'email' => 'noreply@znote.eu',
|
||||
'username' => 'noreply@znote.eu', // Likely the same as email
|
||||
'password' => 'emailpassword', // The password.
|
||||
'debug' => false, // Enable debugging if you have problems and are looking for errors.
|
||||
'fromName' => $config['site_title'],
|
||||
);
|
||||
|
||||
|
||||
// Don't touch this unless you know what you are doing. (modifying these (key value) also requires modifications in OT files data/XML/groups.xml).
|
||||
$config['ingame_positions'] = array(
|
||||
1 => 'Player',
|
||||
@ -736,7 +741,7 @@
|
||||
// Available options: LINUX or WINDOWS
|
||||
$config['os'] = ZNOTE_OS; // Use 'ZNOTE_OS' to auto-detect
|
||||
|
||||
// Measure how much players are lagging in-game. (Not completed).
|
||||
// Measure how much players are lagging in-game. (Not completed).
|
||||
$config['ping'] = false;
|
||||
|
||||
// BAN STUFF - Don't touch this unless you know what you are doing.
|
||||
@ -818,7 +823,7 @@
|
||||
$config['session_prefix'] = 'znote_';
|
||||
|
||||
/* Store visitor data
|
||||
Store visitor data in the database, logging every IP visiting site,
|
||||
Store visitor data in the database, logging every IP visiting site,
|
||||
and how many times they have visited the site. And sometimes what
|
||||
they do on the site.
|
||||
|
||||
@ -832,7 +837,7 @@
|
||||
$config['log_ip'] = false;
|
||||
|
||||
// Flush IP logs each configured seconds, 60 * 15 = 15 minutes.
|
||||
// Set to false to entirely disable ip log flush.
|
||||
// Set to false to entirely disable ip log flush.
|
||||
// It is important to flush for optimal performance.
|
||||
$config['flush_ip_logs'] = 59 * 27;
|
||||
|
||||
@ -946,7 +951,7 @@
|
||||
/// Let players sell, buy and bid on characters.
|
||||
/// Creates a deeper shop economy, encourages players to spend more money in shop for points.
|
||||
/// Pay to win/progress mechanic, but also lets people who can barely afford points to gain it
|
||||
/// by leveling characters to sell. It can also discourages illegal/risky third-party account
|
||||
/// by leveling characters to sell. It can also discourages illegal/risky third-party account
|
||||
/// services. Since players can buy officially & support the server, dodgy competitors have to sell for cheaper.
|
||||
/// Without admin interference this is organic to each individual community economy inflation.
|
||||
//////////
|
||||
@ -968,7 +973,7 @@
|
||||
type 2 = Premium days
|
||||
type 3 = Change character gender
|
||||
type 4 = Change character name
|
||||
type 5 = Buy outfit (put outfit id as itemid),
|
||||
type 5 = Buy outfit (put outfit id as itemid),
|
||||
(put addon id as count [0 = nothing, 1 = first addon, 2 = second addon, 3 = both addons])
|
||||
type 6 = Buy mount (put mount id as itemid)
|
||||
type 7 = Buy house (hardcoded in the house system, type used for data log)
|
||||
|
@ -62,23 +62,23 @@ function fetchLatestDeaths_03($rowz = 30, $killers = false) {
|
||||
//while ($showdeaths = mysql_fetch_assoc($getdeaths)) {
|
||||
if ($getdeaths !== false) {
|
||||
for ($i = 0; $i < count($getdeaths); $i++) {
|
||||
$pid = $getdeaths[$i]['player_id'];
|
||||
$level = $getdeaths[$i]['level'];
|
||||
$kid = user_get_kid($getdeaths[$i]['id']);
|
||||
|
||||
$killedby = user_name(user_get_killer_id($kid));
|
||||
|
||||
$pid = $getdeaths[$i]['player_id'];
|
||||
$level = $getdeaths[$i]['level'];
|
||||
$kid = user_get_kid($getdeaths[$i]['id']);
|
||||
|
||||
$killedby = user_name(user_get_killer_id($kid));
|
||||
|
||||
if ($killedby == false) {
|
||||
$killedby = user_get_killer_m_name($kid);
|
||||
$player = 0;
|
||||
$killedby = user_get_killer_m_name($kid);
|
||||
$player = 0;
|
||||
} else {
|
||||
$player = 1;
|
||||
$player = 1;
|
||||
}
|
||||
if ($killedby === false) {
|
||||
$player = 2;
|
||||
$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'];
|
||||
$row = array();
|
||||
$row['level'] = $level;
|
||||
@ -151,7 +151,7 @@ function fetchAllHouses_03() {
|
||||
return mysql_select_multi("SELECT * FROM `houses`;");
|
||||
}
|
||||
|
||||
// TFS Storage value functions (Warning, I think these things are saved in cache,
|
||||
// TFS Storage value functions (Warning, I think these things are saved in cache,
|
||||
// and thus require server to be offline, or affected players to be offline while using)
|
||||
|
||||
// Get player storage list
|
||||
@ -171,7 +171,7 @@ function getGlobalStorage($storage) {
|
||||
function setGlobalStorage($storage, $value) {
|
||||
$storage = (int)$storage;
|
||||
$value = (int)$value;
|
||||
|
||||
|
||||
// If the storage does not exist yet
|
||||
if (getGlobalStorage($storage) === false) {
|
||||
mysql_insert("INSERT INTO `global_storage` (`key`, `world_id`, `value`) VALUES ('$storage', 0, '$value')");
|
||||
@ -196,7 +196,7 @@ function setPlayerStorage($player_id, $storage, $value) {
|
||||
$storage = (int)$storage;
|
||||
$value = (int)$value;
|
||||
$player_id = (int)$player_id;
|
||||
|
||||
|
||||
// If the storage does not exist yet
|
||||
if (getPlayerStorage($storage) === false) {
|
||||
mysql_insert("INSERT INTO `player_storage` (`player_id`, `key`, `value`) VALUES ('$player_id', '$storage', '$value')");
|
||||
@ -254,7 +254,7 @@ function guild_remove_member_10($cid) {
|
||||
function guild_change_rank($rid, $name) {
|
||||
$rid = (int)$rid;
|
||||
$name = sanitize($name);
|
||||
|
||||
|
||||
mysql_update("UPDATE `guild_ranks` SET `name`='$name' WHERE `id`=$rid");
|
||||
}
|
||||
|
||||
@ -266,20 +266,20 @@ function guild_change_leader($nCid, $oCid) {
|
||||
$ranks = get_guild_rank_data($gid);
|
||||
$leader_rid = 0;
|
||||
$vice_rid = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// Get rank id for leader and vice leader.
|
||||
foreach ($ranks as $rank) {
|
||||
if ($rank['level'] == 3) $leader_rid = $rank['id'];
|
||||
if ($rank['level'] == 2) $vice_rid = $rank['id'];
|
||||
}
|
||||
|
||||
|
||||
$status = false;
|
||||
if ($leader_rid > 0 && $vice_rid > 0) $status = true;
|
||||
|
||||
|
||||
// Verify that we found the rank ids for vice leader and leader.
|
||||
if ($status) {
|
||||
|
||||
|
||||
// Update players and set their new rank id
|
||||
if (config('ServerEngine') !== 'TFS_10') {
|
||||
mysql_update("UPDATE `players` SET `rank_id`='$leader_rid' WHERE `id`=$nCid LIMIT 1;");
|
||||
@ -288,11 +288,11 @@ function guild_change_leader($nCid, $oCid) {
|
||||
mysql_update("UPDATE `guild_membership` SET `rank_id`='$leader_rid' WHERE `player_id`=$nCid LIMIT 1;");
|
||||
mysql_update("UPDATE `guild_membership` SET `rank_id`='$vice_rid' WHERE `player_id`=$oCid LIMIT 1;");
|
||||
}
|
||||
|
||||
|
||||
// Update guilds set new ownerid
|
||||
guild_new_leader($nCid, $gid);
|
||||
}
|
||||
|
||||
|
||||
return $status;
|
||||
}
|
||||
|
||||
@ -432,20 +432,20 @@ function update_player_guild_position_10($cid, $rid) {
|
||||
function update_player_guildnick($cid, $nick) {
|
||||
$cid = (int)$cid;
|
||||
$nick = sanitize($nick);
|
||||
if (!empty($nick)) {
|
||||
if (!empty($nick)) {
|
||||
|
||||
mysql_update("UPDATE `players` SET `guildnick`='$nick' WHERE `id`=$cid");
|
||||
} else {
|
||||
mysql_update("UPDATE `players` SET `guildnick`= NULL WHERE `id`=$cid");
|
||||
mysql_update("UPDATE `players` SET `guildnick`='' WHERE `id`=$cid");
|
||||
}
|
||||
}
|
||||
function update_player_guildnick_10($cid, $nick) {
|
||||
$cid = (int)$cid;
|
||||
$nick = sanitize($nick);
|
||||
if (!empty($nick)) {
|
||||
if (!empty($nick)) {
|
||||
mysql_update("UPDATE `guild_membership` SET `nick`='$nick' WHERE `player_id`=$cid");
|
||||
} else {
|
||||
mysql_update("UPDATE `guild_membership` SET `nick`= NULL WHERE `player_id`=$cid");
|
||||
mysql_update("UPDATE `guild_membership` SET `nick`='' WHERE `player_id`=$cid");
|
||||
}
|
||||
}
|
||||
|
||||
@ -460,7 +460,7 @@ function create_guild($cid, $name) {
|
||||
$cid = (int)$cid;
|
||||
$name = sanitize($name);
|
||||
$time = time();
|
||||
|
||||
|
||||
// Create the guild
|
||||
if (config('ServerEngine') !== 'OTHIRE')
|
||||
mysql_insert("INSERT INTO `guilds` (`name`, `ownerid`, `creationdata`, `motd`) VALUES ('$name', '$cid', '$time', '');");
|
||||
@ -469,7 +469,7 @@ function create_guild($cid, $name) {
|
||||
|
||||
// Get guild id
|
||||
$gid = get_guild_id($name);
|
||||
|
||||
|
||||
// Get rank id for guild leader
|
||||
$data = mysql_select_single("SELECT `id` FROM `guild_ranks` WHERE `guild_id`='$gid' AND `level`='3' LIMIT 1;");
|
||||
$rid = ($data !== false) ? $data['id'] : false;
|
||||
@ -510,7 +510,7 @@ function get_player_guild_data($cid) {
|
||||
$cid = (int)$cid;
|
||||
if (config('ServerEngine') !== 'TFS_10') $playerdata = mysql_select_single("SELECT `rank_id` FROM `players` WHERE `id`='$cid' LIMIT 1;");
|
||||
else $playerdata = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$cid' LIMIT 1;");
|
||||
|
||||
|
||||
if ($playerdata !== false) {
|
||||
$rankdata = mysql_select_single("SELECT `guild_id`, `level` AS `rank_level`, `name` AS `rank_name` FROM `guild_ranks` WHERE `id`='". $playerdata['rank_id'] ."' LIMIT 1;");
|
||||
if ($rankdata !== false) {
|
||||
@ -599,7 +599,7 @@ function get_guild_war($warid) {
|
||||
function get_guild_war03($warid) {
|
||||
$warid = (int)$warid; // Sanitizing the parameter id
|
||||
|
||||
$war = mysql_select_single("SELECT `id`, `guild_id`, `enemy_id`, `status`, `begin`, `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'];
|
||||
@ -680,10 +680,10 @@ function set_ingame_position($name, $acctype) {
|
||||
function set_ingame_position03($name, $acctype) {
|
||||
$acctype = (int)$acctype;
|
||||
$name = sanitize($name);
|
||||
|
||||
|
||||
$acc_id = user_character_account_id($name);
|
||||
$char_id = user_character_id($name);
|
||||
|
||||
|
||||
$group_id = 2;
|
||||
if ($acctype == 1) {
|
||||
$group_id = 1;
|
||||
@ -691,7 +691,7 @@ function set_ingame_position03($name, $acctype) {
|
||||
mysql_update("UPDATE `players` SET `group_id` = '$acctype' WHERE `id` =$char_id;");
|
||||
}
|
||||
|
||||
// Set rule violation.
|
||||
// Set rule violation.
|
||||
// Return true if success, query error die if failed, and false if $config['website_char'] is not recognized.
|
||||
function set_rule_violation($charname, $typeid, $actionid, $reasonid, $time, $comment) {
|
||||
$charid = user_character_id($charname);
|
||||
@ -699,19 +699,19 @@ function set_rule_violation($charname, $typeid, $actionid, $reasonid, $time, $co
|
||||
$actionid = (int)$actionid;
|
||||
$reasonid = (int)$reasonid;
|
||||
$time = (int)($time + time());
|
||||
|
||||
|
||||
$data = user_character_data($charid, 'account_id', 'lastip');
|
||||
|
||||
|
||||
$accountid = $data['account_id'];
|
||||
$charip = $data['lastip'];
|
||||
|
||||
|
||||
$comment = sanitize($comment);
|
||||
|
||||
|
||||
// ...
|
||||
$bannedby = config('website_char');
|
||||
if (user_character_exist($bannedby)) {
|
||||
$bannedby = user_character_id($bannedby);
|
||||
|
||||
|
||||
if (Config('ServerEngine') === 'TFS_02')
|
||||
mysql_insert("INSERT INTO `bans` (`type` ,`ip` ,`mask` ,`player` ,`account` ,`time` ,`reason_id` ,`action_id` ,`comment` ,`banned_by`) VALUES ('$typeid', '$charip', '4294967295', '$charid', '$accountid', '$time', '$reasonid', '$actionid', '$comment', '$bannedby');");
|
||||
elseif (Config('ServerEngine') === 'TFS_03') {
|
||||
@ -720,19 +720,19 @@ function set_rule_violation($charname, $typeid, $actionid, $reasonid, $time, $co
|
||||
case 1: // IP ban
|
||||
mysql_insert("INSERT INTO `bans` (`type`, `value`, `param`, `active`, `expires`, `added`, `admin_id`, `comment`) VALUES ('$typeid', '$charip', '4294967295', '1', '$time', '$now', '$bannedby', '$comment');");
|
||||
break;
|
||||
|
||||
|
||||
case 2: // namelock
|
||||
mysql_insert("INSERT INTO `bans` (`type`, `value`, `param`, `active`, `expires`, `added`, `admin_id`, `comment`) VALUES ('$typeid', '$charid', '4294967295', '1', '$time', '$now', '$bannedby', '$comment');");
|
||||
break;
|
||||
|
||||
|
||||
case 3: // acc ban
|
||||
mysql_insert("INSERT INTO `bans` (`type`, `value`, `param`, `active`, `expires`, `added`, `admin_id`, `comment`) VALUES ('$typeid', '$accountid', '4294967295', '1', '$time', '$now', '$bannedby', '$comment');");
|
||||
break;
|
||||
|
||||
|
||||
case 4: // notation
|
||||
mysql_insert("INSERT INTO `bans` (`type`, `value`, `param`, `active`, `expires`, `added`, `admin_id`, `comment`) VALUES ('$typeid', '$charid', '4294967295', '1', '$time', '$now', '$bannedby', '$comment');");
|
||||
break;
|
||||
|
||||
|
||||
case 5: // deletion
|
||||
mysql_insert("INSERT INTO `bans` (`type`, `value`, `param`, `active`, `expires`, `added`, `admin_id`, `comment`) VALUES ('$typeid', '$charid', '4294967295', '1', '$time', '$now', '$bannedby', '$comment');");
|
||||
break;
|
||||
@ -740,32 +740,32 @@ function set_rule_violation($charname, $typeid, $actionid, $reasonid, $time, $co
|
||||
}
|
||||
elseif (Config('ServerEngine') === 'TFS_10') {
|
||||
$now = time();
|
||||
|
||||
|
||||
switch ($typeid) {
|
||||
case 1: // IP ban
|
||||
mysql_insert("INSERT INTO `ip_bans` (`ip`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES ('$charip', '$comment', '$now', '$time', '$bannedby');");
|
||||
break;
|
||||
|
||||
|
||||
case 2: // namelock
|
||||
mysql_insert("INSERT INTO `player_namelocks` (`player_id`, `reason`, `namelocked_at`, `namelocked_by`) VALUES ('$charid', 'comment', '$now', '$bannedby');");
|
||||
break;
|
||||
|
||||
|
||||
case 3: // acc ban
|
||||
mysql_insert("INSERT INTO `account_bans` (`account_id`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES ('$accountid', '$comment', '$now', '$time', '$bannedby');");
|
||||
break;
|
||||
|
||||
|
||||
case 4: // notation
|
||||
data_dump(false, array('status' => false), "Function deprecated. Ban option does not exist in TFS 1.0.");
|
||||
die();
|
||||
break;
|
||||
|
||||
|
||||
case 5: // deletion
|
||||
data_dump(false, array('status' => false), "Function deprecated. Ban option does not exist in TFS 1.0.");
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@ -835,7 +835,7 @@ function user_delete_character($char_id) {
|
||||
// Delete character with supplied id with a delay.
|
||||
function user_delete_character_soft($char_id) {
|
||||
$char_id = (int)$char_id;
|
||||
|
||||
|
||||
$char_name = user_character_name($char_id);
|
||||
$original_acc_id = user_character_account_id($char_name);
|
||||
if(!user_character_pending_delete($char_name))
|
||||
@ -878,18 +878,18 @@ function user_character_list($account_id) {
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
$characters[$i]['vocation'] = vocation_id_to_name($characters[$i]['vocation']); // Change vocation id to vocation name
|
||||
$characters[$i]['town_id'] = town_id_to_name($characters[$i]['town_id']); // Change town id to town name
|
||||
|
||||
// Make lastlogin human read-able.
|
||||
|
||||
// Make lastlogin human read-able.
|
||||
if ($characters[$i]['lastlogin'] != 0) {
|
||||
$characters[$i]['lastlogin'] = getClock($characters[$i]['lastlogin'], true, false);
|
||||
} else {
|
||||
$characters[$i]['lastlogin'] = 'Never.';
|
||||
}
|
||||
|
||||
$characters[$i]['online'] = online_id_to_name($characters[$i]['online']); // 0 to "offline", 1 to "ONLINE".
|
||||
|
||||
$characters[$i]['online'] = online_id_to_name($characters[$i]['online']); // 0 to "offline", 1 to "ONLINE".
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $characters;
|
||||
}
|
||||
|
||||
@ -954,7 +954,7 @@ function fetchAllScores($rows, $tfs, $g, $vlist, $v = -1, $flags = false, $outfi
|
||||
|
||||
// Generate SQL WHERE-clause for vocation if $v is set
|
||||
$v = '';
|
||||
if ($vGrp !== 'all')
|
||||
if ($vGrp !== 'all')
|
||||
$v = (strpos($vGrp, ',') !== false) ? 'AND `p`.`vocation` IN ('. $vGrp . ')' : 'AND `p`.`vocation` = \''.intval($vGrp).'\'';
|
||||
|
||||
if ($tfs == 'TFS_10') {
|
||||
@ -962,7 +962,7 @@ function fetchAllScores($rows, $tfs, $g, $vlist, $v = -1, $flags = false, $outfi
|
||||
if ($flags === false) { // In this case we only need to query players table
|
||||
$v = str_replace('`p`.', '', $v);
|
||||
$outfits = str_replace('`p`.', '', $outfits);
|
||||
|
||||
|
||||
$vocGroups[$vGrp][1] = mysql_select_multi("SELECT `name`, `vocation`, `skill_club` AS `value` $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `skill_club` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][2] = mysql_select_multi("SELECT `name`, `vocation`, `skill_sword` AS `value` $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `skill_sword` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][3] = mysql_select_multi("SELECT `name`, `vocation`, `skill_axe` AS `value` $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `skill_axe` DESC LIMIT 0, $rows;");
|
||||
@ -972,7 +972,7 @@ function fetchAllScores($rows, $tfs, $g, $vlist, $v = -1, $flags = false, $outfi
|
||||
$vocGroups[$vGrp][7] = mysql_select_multi("SELECT `name`, `vocation`, `experience`, `level` AS `value` $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `experience` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][8] = mysql_select_multi("SELECT `name`, `vocation`, `maglevel` AS `value` $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `maglevel` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][9] = mysql_select_multi("SELECT `name`, `vocation`, `skill_fist` AS `value` $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `skill_fist` DESC LIMIT 0, $rows;");
|
||||
|
||||
|
||||
} else { // Inner join znote_accounts table to retrieve the flag
|
||||
$vocGroups[$vGrp][1] = mysql_select_multi("SELECT `p`.`name`, `p`.`vocation`, `p`.`skill_club` AS `value`, `za`.`flag` $outfits FROM `players` AS `p` INNER JOIN `znote_accounts` AS `za` ON `p`.`account_id`=`za`.`account_id` WHERE `p`.`group_id` < $g $v ORDER BY `p`.`skill_club` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][2] = mysql_select_multi("SELECT `p`.`name`, `p`.`vocation`, `p`.`skill_sword` AS `value`, `za`.`flag` $outfits FROM `players` AS `p` INNER JOIN `znote_accounts` AS `za` ON `p`.`account_id`=`za`.`account_id` WHERE `p`.`group_id` < $g $v ORDER BY `p`.`skill_sword` DESC LIMIT 0, $rows;");
|
||||
@ -985,7 +985,7 @@ function fetchAllScores($rows, $tfs, $g, $vlist, $v = -1, $flags = false, $outfi
|
||||
$vocGroups[$vGrp][9] = mysql_select_multi("SELECT `p`.`name`, `p`.`vocation`, `p`.`skill_fist` AS `value`, `za`.`flag` $outfits FROM `players` AS `p` INNER JOIN `znote_accounts` AS `za` ON `p`.`account_id`=`za`.`account_id` WHERE `p`.`group_id` < $g $v ORDER BY `p`.`skill_fist` DESC LIMIT 0, $rows;");
|
||||
}
|
||||
} else { // TFS 0.2, 0.3, 0.4
|
||||
|
||||
|
||||
if ($flags === false) {
|
||||
$vocGroups[$vGrp][9] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` $outfits FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 0 AND `p`.`group_id` < $g $v ORDER BY `s`.`value` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][1] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation` $outfits FROM `player_skills` AS `s` LEFT JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` WHERE `s`.`skillid` = 1 AND `p`.`group_id` < $g $v ORDER BY `s`.`value` DESC LIMIT 0, $rows;");
|
||||
@ -998,7 +998,7 @@ function fetchAllScores($rows, $tfs, $g, $vlist, $v = -1, $flags = false, $outfi
|
||||
$outfits = str_replace('`p`.', '', $outfits);
|
||||
$vocGroups[$vGrp][7] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `experience`, `level` AS `value` $outfits $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `experience` DESC limit 0, $rows;");
|
||||
$vocGroups[$vGrp][8] = mysql_select_multi("SELECT `id`, `name`, `vocation`, `maglevel` AS `value` $outfits $outfits FROM `players` WHERE `group_id` < $g $v ORDER BY `maglevel` DESC limit 0, $rows;");
|
||||
|
||||
|
||||
} else { // Inner join znote_accounts table to retrieve the flag
|
||||
$vocGroups[$vGrp][9] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation`, `za`.`flag` AS `flag` $outfits FROM `player_skills` AS `s` INNER JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` INNER JOIN `znote_accounts` AS `za` ON `p`.`account_id`=`za`.`account_id` WHERE `s`.`skillid` = 0 AND `p`.`group_id` < $g $v ORDER BY `s`.`value` DESC LIMIT 0, $rows;");
|
||||
$vocGroups[$vGrp][1] = mysql_select_multi("SELECT `s`.`player_id` AS `id`, `s`.`value` AS `value`, `p`.`name` AS `name`, `p`.`vocation` AS `vocation`, `za`.`flag` AS `flag` $outfits FROM `player_skills` AS `s` INNER JOIN `players` AS `p` ON `s`.`player_id`=`p`.`id` INNER JOIN `znote_accounts` AS `za` ON `p`.`account_id`=`za`.`account_id` WHERE `s`.`skillid` = 1 AND `p`.`group_id` < $g $v ORDER BY `s`.`value` DESC LIMIT 0, $rows;");
|
||||
@ -1050,11 +1050,11 @@ function user_recover($mode, $edom, $email, $character, $ip) {
|
||||
'id' => $edom,
|
||||
'email' => $email
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Determine if the submitted information is correct and herit from same account
|
||||
if (user_account_fields_verify_value($verify_data)) {
|
||||
|
||||
|
||||
// Structure account id fetch method correctly
|
||||
if ($mode == 'username') {
|
||||
$account_id = user_account_id_from_password($verify_data['password']);
|
||||
@ -1066,7 +1066,7 @@ function user_recover($mode, $edom, $email, $character, $ip) {
|
||||
}
|
||||
// get account id from character name
|
||||
$player_account_id = user_character_account_id($character);
|
||||
|
||||
|
||||
//Verify that players.account_id matches account.id
|
||||
if ($player_account_id == $account_id) {
|
||||
// verify IP match (IP = accounts.email_new) \\
|
||||
@ -1082,7 +1082,7 @@ function user_recover($mode, $edom, $email, $character, $ip) {
|
||||
} else {
|
||||
$name_data = user_data($account_id, 'id');
|
||||
echo '<br><p>Your account number is:</p> <h3>'. $name_data['id'] .'</h3>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$newpass = substr(sha1(rand(1000000, 99999999)), 8);
|
||||
echo '<br><p>Your new password is:</p> <h3>'. $newpass .'</h3><p>Remember to login and change it!</p>';
|
||||
@ -1109,15 +1109,15 @@ function user_account_id_from_name($id) {
|
||||
return $result['name'];
|
||||
} else {
|
||||
$result = mysql_select_single("SELECT `id` FROM `accounts` WHERE `id` = '" . $id . "' LIMIT 1;");
|
||||
return $result['id'];
|
||||
}
|
||||
return $result['id'];
|
||||
}
|
||||
}
|
||||
|
||||
// Add additional premium days to account id
|
||||
function user_account_add_premdays($accid, $days) {
|
||||
$accid = (int)$accid;
|
||||
$days = (int)$days;
|
||||
|
||||
|
||||
if (config('ServerEngine') !== 'OTHIRE') {
|
||||
$data = mysql_select_single("SELECT `premdays` FROM `accounts` WHERE `id`='$accid';");
|
||||
$tmp = $data['premdays'];
|
||||
@ -1127,10 +1127,10 @@ function user_account_add_premdays($accid, $days) {
|
||||
$data = mysql_select_single("SELECT `premend` FROM `accounts` WHERE `id`='$accid';");
|
||||
$tmp = $data['premend'];
|
||||
if($tmp == 0)
|
||||
$tmp = time() + ($days * 24 * 60 * 60);
|
||||
$tmp = time() + ($days * 24 * 60 * 60);
|
||||
else
|
||||
$tmp = $tmp + ($days * 24 * 60 * 60);
|
||||
mysql_update("UPDATE `accounts` SET `premend`='$tmp' WHERE `id`='$accid'");
|
||||
mysql_update("UPDATE `accounts` SET `premend`='$tmp' WHERE `id`='$accid'");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1155,7 +1155,7 @@ function user_character_account_id($character) {
|
||||
function user_account_fields_verify_value($verify_data) {
|
||||
$verify = array();
|
||||
array_walk($verify_data, 'array_sanitize');
|
||||
|
||||
|
||||
foreach ($verify_data as $field=>$data) {
|
||||
$verify[] = '`'. $field .'` = \''. $data .'\'';
|
||||
}
|
||||
@ -1167,13 +1167,13 @@ function user_account_fields_verify_value($verify_data) {
|
||||
function user_update_account($update_data) {
|
||||
$update = array();
|
||||
array_walk($update_data, 'array_sanitize');
|
||||
|
||||
|
||||
foreach ($update_data as $field=>$data) {
|
||||
$update[] = '`'. $field .'` = \''. $data .'\'';
|
||||
}
|
||||
|
||||
|
||||
$user_id = (int)getSession('user_id');
|
||||
|
||||
|
||||
mysql_update("UPDATE `accounts` SET ". implode(', ', $update) ." WHERE `id`=". $user_id .";");
|
||||
}
|
||||
|
||||
@ -1181,13 +1181,13 @@ function user_update_account($update_data) {
|
||||
function user_update_znote_account($update_data) {
|
||||
$update = array();
|
||||
array_walk($update_data, 'array_sanitize');
|
||||
|
||||
|
||||
foreach ($update_data as $field=>$data) {
|
||||
$update[] = '`'. $field .'` = \''. $data .'\'';
|
||||
}
|
||||
|
||||
|
||||
$user_id = (int)getSession('user_id');
|
||||
|
||||
|
||||
mysql_update("UPDATE `znote_accounts` SET ". implode(', ', $update) ." WHERE `account_id`=". $user_id .";");
|
||||
}
|
||||
|
||||
@ -1195,7 +1195,7 @@ function user_update_znote_account($update_data) {
|
||||
function user_change_password($user_id, $password) {
|
||||
$user_id = sanitize($user_id);
|
||||
$password = sha1($password);
|
||||
|
||||
|
||||
mysql_update("UPDATE `accounts` SET `password`='$password' WHERE `id`=$user_id");
|
||||
}
|
||||
// .3 compatibility
|
||||
@ -1204,7 +1204,7 @@ function user_change_password03($user_id, $password) {
|
||||
$user_id = sanitize($user_id);
|
||||
$salt = user_data($user_id, 'salt');
|
||||
$password = sha1($salt['salt'].$password);
|
||||
|
||||
|
||||
mysql_update("UPDATE `accounts` SET `password`='$password' WHERE `id`=$user_id");
|
||||
} else {
|
||||
user_change_password($user_id, $password);
|
||||
@ -1215,39 +1215,39 @@ function user_change_password03($user_id, $password) {
|
||||
function user_character_set_hide($char_id, $value) {
|
||||
$char_id = sanitize($char_id);
|
||||
$value = sanitize($value);
|
||||
|
||||
|
||||
mysql_update("UPDATE `znote_players` SET `hide_char`='$value' WHERE `player_id`=$char_id");
|
||||
}
|
||||
|
||||
// CREATE ACCOUNT
|
||||
function user_create_account($register_data, $maildata) {
|
||||
array_walk($register_data, 'array_sanitize');
|
||||
|
||||
|
||||
if (config('ServerEngine') == 'TFS_03' && config('salt') === true) {
|
||||
$register_data['salt'] = generate_recovery_key(18);
|
||||
$register_data['password'] = sha1($register_data['salt'].$register_data['password']);
|
||||
} else $register_data['password'] = sha1($register_data['password']);
|
||||
|
||||
|
||||
$ip = $register_data['ip'];
|
||||
$created = $register_data['created'];
|
||||
$flag = $register_data['flag'];
|
||||
|
||||
|
||||
unset($register_data['ip']);
|
||||
unset($register_data['created']);
|
||||
unset($register_data['flag']);
|
||||
|
||||
|
||||
if (config('ServerEngine') == 'TFS_10') $register_data['creation'] = $created;
|
||||
|
||||
$fields = '`'. implode('`, `', array_keys($register_data)) .'`';
|
||||
$data = '\''. implode('\', \'', $register_data) .'\'';
|
||||
|
||||
mysql_insert("INSERT INTO `accounts` ($fields) VALUES ($data)");
|
||||
|
||||
|
||||
$account_id = (isset($register_data['name'])) ? user_id($register_data['name']) : user_id($register_data['id']);
|
||||
$activeKey = rand(100000000,999999999);
|
||||
$active = ($maildata['register']) ? 0 : 1;
|
||||
mysql_insert("INSERT INTO `znote_accounts` (`account_id`, `ip`, `created`, `active`, `active_email`, `activekey`, `flag`) VALUES ('$account_id', '$ip', '$created', '$active', '0', '$activeKey', '$flag')");
|
||||
|
||||
|
||||
if ($maildata['register']) {
|
||||
|
||||
$thisurl = config('site_url') . "$_SERVER[REQUEST_URI]";
|
||||
@ -1256,12 +1256,12 @@ function user_create_account($register_data, $maildata) {
|
||||
$mailer = new Mail($maildata);
|
||||
|
||||
$title = "Please authenticate your account at $_SERVER[HTTP_HOST].";
|
||||
|
||||
|
||||
$body = "<h1>Please click on the following link to authenticate your account:</h1>";
|
||||
$body .= "<p><a href='$thisurl'>$thisurl</a></p>";
|
||||
$body .= "<p>Thank you for registering and enjoy your stay at $maildata[fromName].</p>";
|
||||
$body .= "<hr><p>I am an automatic no-reply e-mail. Any emails sent back to me will be ignored.</p>";
|
||||
|
||||
|
||||
$mailer->sendMail($register_data['email'], $title, $body, $register_data['name']);
|
||||
}
|
||||
}
|
||||
@ -1278,15 +1278,15 @@ function user_create_character($character_data) {
|
||||
$skills = $create['skills'][$vocation];
|
||||
|
||||
$outfit = ($character_data['sex'] == 1) ? $create['male_outfit'] : $create['female_outfit'];
|
||||
|
||||
|
||||
$leveldiff = $create['level'] - $base['level'];
|
||||
|
||||
$gains = $cnf['vocations_gain'][$vocation];
|
||||
|
||||
|
||||
$health = $base['health'] + ( $gains['hp'] * $leveldiff );
|
||||
$mana = $base['mana'] + ( $gains['mp'] * $leveldiff );
|
||||
$cap = $base['cap'] + ( $gains['cap'] * $leveldiff );
|
||||
|
||||
|
||||
// This is TFS 0.2 compatible import data with Znote AAC mysql schema
|
||||
if (config('ServerEngine') !== 'OTHIRE') {
|
||||
$import_data = array(
|
||||
@ -1375,14 +1375,14 @@ function user_create_character($character_data) {
|
||||
'loss_items' => 10,
|
||||
'online' => 0,
|
||||
'balance' => 0
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Clients below 7.8 don't have outfit addons
|
||||
if (isset($import_data['lookaddons']) && config('client') < 780) {
|
||||
unset($import_data['lookaddons']);
|
||||
}
|
||||
|
||||
|
||||
// TFS 1.0 variations
|
||||
if ($cnf['ServerEngine'] === 'TFS_10') {
|
||||
unset($import_data['rank_id']);
|
||||
@ -1403,12 +1403,12 @@ function user_create_character($character_data) {
|
||||
$import_data['skill_shielding'] = $skills['shield'];
|
||||
$import_data['skill_fishing'] = $skills['fishing'];
|
||||
}
|
||||
|
||||
|
||||
// If you are no vocation (id 0), use these details instead:
|
||||
if ($vocation === 0) {
|
||||
$import_data['level'] = $create['novocation']['level'];
|
||||
$import_data['experience'] = level_to_experience($create['novocation']['level']);
|
||||
|
||||
|
||||
if ($create['novocation']['forceTown'] === true) {
|
||||
$import_data['town_id'] = $create['novocation']['townId'];
|
||||
}
|
||||
@ -1416,12 +1416,12 @@ function user_create_character($character_data) {
|
||||
|
||||
$fields = array_keys($import_data); // Fetch select fields
|
||||
$data = array_values($import_data); // Fetch insert data
|
||||
|
||||
|
||||
$fields_sql = implode("`, `", $fields); // Convert array into SQL compatible string
|
||||
$data_sql = implode("', '", $data); // Convert array into SQL compatible string
|
||||
|
||||
mysql_insert("INSERT INTO `players`(`$fields_sql`) VALUES ('$data_sql');");
|
||||
|
||||
|
||||
$created = time();
|
||||
$charid = user_character_id($import_data['name']);
|
||||
mysql_insert("INSERT INTO `znote_players`(`player_id`, `created`, `hide_char`, `comment`) VALUES ('$charid', '$created', '0', '');");
|
||||
@ -1472,13 +1472,13 @@ function user_character_data($user_id) {
|
||||
function user_znote_character_data($character_id) {
|
||||
$data = array();
|
||||
$charid = (int)$character_id;
|
||||
|
||||
|
||||
$func_num_args = func_num_args();
|
||||
$func_get_args = func_get_args();
|
||||
|
||||
|
||||
if ($func_num_args > 1) {
|
||||
unset($func_get_args[0]);
|
||||
|
||||
|
||||
$fields = '`'. implode('`, `', $func_get_args) .'`';
|
||||
$data = mysql_select_single("SELECT $fields FROM `znote_players` WHERE `player_id` = $charid;");
|
||||
return $data;
|
||||
@ -1490,12 +1490,12 @@ function user_znote_character_data($character_id) {
|
||||
// echo $znoteAAC['version'];
|
||||
function user_znote_data() {
|
||||
$data = array();
|
||||
|
||||
|
||||
$func_num_args = func_num_args();
|
||||
$func_get_args = func_get_args();
|
||||
|
||||
|
||||
if ($func_num_args > 0) {
|
||||
|
||||
|
||||
$fields = '`'. implode('`, `', $func_get_args) .'`';
|
||||
return mysql_select_single("SELECT $fields FROM `znote`;");
|
||||
} else return false;
|
||||
@ -1506,47 +1506,47 @@ function user_znote_data() {
|
||||
function user_znote_account_data($account_id) {
|
||||
$data = array();
|
||||
$accid = (int)$account_id;
|
||||
|
||||
|
||||
$func_num_args = func_num_args();
|
||||
$func_get_args = func_get_args();
|
||||
|
||||
|
||||
if ($func_num_args > 1) {
|
||||
unset($func_get_args[0]);
|
||||
|
||||
|
||||
$fields = '`'. implode('`, `', $func_get_args) .'`';
|
||||
return mysql_select_single("SELECT $fields FROM `znote_accounts` WHERE `account_id` = $accid LIMIT 1;");
|
||||
} else return false;
|
||||
}
|
||||
|
||||
// return query data from znote_visitors table
|
||||
// See documentation on user_data, but this uses $longip instead.
|
||||
// See documentation on user_data, but this uses $longip instead.
|
||||
function user_znote_visitor_data($longip) {
|
||||
$data = array();
|
||||
$longip = (int)$longip;
|
||||
|
||||
|
||||
$func_num_args = func_num_args();
|
||||
$func_get_args = func_get_args();
|
||||
|
||||
|
||||
if ($func_num_args > 1) {
|
||||
unset($func_get_args[0]);
|
||||
|
||||
|
||||
$fields = '`'. implode('`, `', $func_get_args) .'`';
|
||||
return mysql_select_single("SELECT $fields FROM `znote_visitors` WHERE `ip` = $longip;");
|
||||
} else return false;
|
||||
}
|
||||
|
||||
// return query data from znote_visitors_details table
|
||||
// See documentation on user_data, but this uses $longip instead.
|
||||
// See documentation on user_data, but this uses $longip instead.
|
||||
function user_znote_visitor_details_data($longip) {
|
||||
$data = array();
|
||||
$longip = (int)$longip;
|
||||
|
||||
|
||||
$func_num_args = func_num_args();
|
||||
$func_get_args = func_get_args();
|
||||
|
||||
|
||||
if ($func_num_args > 1) {
|
||||
unset($func_get_args[0]);
|
||||
|
||||
|
||||
$fields = '`'. implode('`, `', $func_get_args) .'`';
|
||||
return mysql_select_single("SELECT $fields FROM `znote_visitors_details` WHERE `ip` = $longip;");
|
||||
} else return false;
|
||||
@ -1560,13 +1560,13 @@ function user_znote_visitor_details_data($longip) {
|
||||
function user_data($user_id) {
|
||||
$data = array();
|
||||
$user_id = sanitize($user_id);
|
||||
|
||||
|
||||
$func_num_args = func_num_args();
|
||||
$func_get_args = func_get_args();
|
||||
|
||||
|
||||
if ($func_num_args > 1) {
|
||||
unset($func_get_args[0]);
|
||||
|
||||
|
||||
$fields = '`'. implode('`, `', $func_get_args) .'`';
|
||||
return mysql_select_single("SELECT $fields FROM `accounts` WHERE `id` = $user_id LIMIT 1;");
|
||||
} else return false;
|
||||
@ -1590,7 +1590,7 @@ function user_exist($username) {
|
||||
}
|
||||
|
||||
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';");
|
||||
if ($name !== false) return $name['name'];
|
||||
else return false;
|
||||
@ -1661,7 +1661,7 @@ function user_login_id_03($username, $password) {
|
||||
if (user_exist($username)) {
|
||||
$user_id = user_id($username);
|
||||
$username = sanitize($username);
|
||||
|
||||
|
||||
$data = mysql_select_single("SELECT `salt`, `id`, `name`, `password` FROM `accounts` WHERE `id`='$user_id';");
|
||||
$salt = $data['salt'];
|
||||
if (!empty($salt)) $password = sha1($salt.$password);
|
||||
|
220
guilds.php
220
guilds.php
@ -10,12 +10,12 @@ function guild_list($TFSVersion) {
|
||||
$guilds = mysql_select_multi("SELECT `t`.`id`, `t`.`name`, `t`.`creationdate`, (SELECT count(p.rank_id) FROM players AS p LEFT JOIN guild_ranks AS gr ON gr.id = p.rank_id WHERE gr.guild_id =`t`.`id`) AS `total` FROM `guilds` as `t` ORDER BY `t`.`name`;");
|
||||
else
|
||||
$guilds = mysql_select_multi("SELECT `t`.`id`, `t`.`name`, `t`.`creationdata`, `motd`, (SELECT count(p.rank_id) FROM players AS p LEFT JOIN guild_ranks AS gr ON gr.id = p.rank_id WHERE gr.guild_id =`t`.`id`) AS `total` FROM `guilds` as `t` ORDER BY `t`.`name`;");
|
||||
else
|
||||
else
|
||||
$guilds = mysql_select_multi("SELECT `id`, `name`, `creationdata`, `motd`, (SELECT COUNT('guild_id') FROM `guild_membership` WHERE `guild_id`=`id`) AS `total` FROM `guilds` ORDER BY `name`;");
|
||||
|
||||
|
||||
// Add level data info to guilds
|
||||
if ($guilds !== false)
|
||||
for ($i = 0; $i < count($guilds); $i++)
|
||||
if ($guilds !== false)
|
||||
for ($i = 0; $i < count($guilds); $i++)
|
||||
$guilds[$i]['level'] = get_guild_level_data($guilds[$i]['id']);
|
||||
|
||||
$cache->setContent($guilds);
|
||||
@ -29,7 +29,7 @@ function guild_list($TFSVersion) {
|
||||
include 'layout/overall/header.php';
|
||||
|
||||
if (user_logged_in() === true) {
|
||||
|
||||
|
||||
// fetch data
|
||||
$char_count = user_character_list_count($session_user_id);
|
||||
$char_array = user_character_list($user_data['id']);
|
||||
@ -92,7 +92,7 @@ if (isset($guilds) && !empty($guilds) && $guilds !== false) {
|
||||
<?php } else echo '<p>Guild list is empty.</p>';?>
|
||||
<!-- user stuff -->
|
||||
<?php
|
||||
if (user_logged_in() === true) {
|
||||
if (user_logged_in() === true) {
|
||||
// post verifications
|
||||
// CREATE GUILD
|
||||
if (!empty($_POST['selected_char']) && !empty($_POST['guild_name'])) {
|
||||
@ -105,25 +105,25 @@ if (user_logged_in() === true) {
|
||||
$char_data = user_character_data($user_id, 'level');
|
||||
$char_data['online'] = (user_is_online_10($user_id)) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
// If character level is high enough
|
||||
if ($char_data['level'] >= $config['create_guild_level']) {
|
||||
|
||||
|
||||
// If character is offline
|
||||
if ($char_data['online'] == 0) {
|
||||
$acc_data = user_data($user_data['id'], 'premdays');
|
||||
|
||||
|
||||
// If character is premium
|
||||
if ($config['guild_require_premium'] == false || $acc_data['premdays'] > 0) {
|
||||
|
||||
|
||||
if (get_character_guild_rank($user_id) < 1) {
|
||||
|
||||
|
||||
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guild_name'])) {
|
||||
// Only allow normal symbols as guild name
|
||||
if (strlen($_POST['guild_name']) < 31) {
|
||||
|
||||
$guildname = sanitize($_POST['guild_name']);
|
||||
|
||||
|
||||
$gid = get_guild_id($guildname);
|
||||
if ($gid === false) {
|
||||
create_guild($user_id, $guildname);
|
||||
@ -140,10 +140,10 @@ if (user_logged_in() === true) {
|
||||
} else echo $name .' is level '. $char_data['level'] .'. But you need level '. $config['create_guild_level'] .'+ to create your own guild!';
|
||||
}
|
||||
}
|
||||
// end
|
||||
// end
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- FORMS TO CREATE GUILD-->
|
||||
<form action="" method="post">
|
||||
<ul>
|
||||
@ -152,17 +152,17 @@ if (user_logged_in() === true) {
|
||||
<select name="selected_char">
|
||||
<?php
|
||||
for ($i = 0; $i < $char_count; $i++) {
|
||||
echo '<option value="'. $characters[$i] .'">'. $characters[$i] .'</option>';
|
||||
echo '<option value="'. $characters[$i] .'">'. $characters[$i] .'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="text" name="guild_name">
|
||||
|
||||
|
||||
<input type="submit" value="Create Guild">
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
} else echo 'You need to be logged in to create guilds.';
|
||||
?>
|
||||
@ -184,23 +184,23 @@ if (user_logged_in() === true) {
|
||||
$inv_data = guild_invite_list($gid);
|
||||
$players = get_guild_players($gid);
|
||||
$inv_count = 0;
|
||||
|
||||
|
||||
// Calculate invite count
|
||||
if ($inv_data !== false) {
|
||||
foreach ($inv_data as $inv) {
|
||||
++$inv_count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// calculate visitor access
|
||||
$highest_access = 0;
|
||||
if (user_logged_in() === true) {
|
||||
// Get visitor access in this guild
|
||||
foreach ($players as $player) {
|
||||
$rid = $player['rank_id'];
|
||||
|
||||
|
||||
for ($i = 0; $i < $char_count; $i++) {
|
||||
|
||||
|
||||
$playerRank = $charactersRank[$i];
|
||||
|
||||
if ($playerRank == $rid) {
|
||||
@ -277,7 +277,7 @@ if (user_logged_in() === true) {
|
||||
<table>
|
||||
<tr class="yellow">
|
||||
<td>Name:</td>
|
||||
<?php
|
||||
<?php
|
||||
if ($highest_access == 2 || $highest_access == 3) {
|
||||
echo '<td>Remove:</td>';
|
||||
}
|
||||
@ -349,7 +349,7 @@ if (user_logged_in() === true) {
|
||||
<?php
|
||||
// Only guild leaders
|
||||
if (user_logged_in() === true) {
|
||||
|
||||
|
||||
// Uninvite and joinguild is also used for visitors who reject their invitation.
|
||||
if (!empty($_POST['uninvite'])) {
|
||||
//
|
||||
@ -380,7 +380,7 @@ if (user_logged_in() === true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['leave_guild'])) {
|
||||
$name = sanitize($_POST['leave_guild']);
|
||||
$cidd = user_character_id($name);
|
||||
@ -394,37 +394,39 @@ if (user_logged_in() === true) {
|
||||
exit();
|
||||
} else echo '<font color="red" size="4">Character must be offline first!</font>';
|
||||
}
|
||||
|
||||
|
||||
if ($highest_access >= 2) {
|
||||
// Guild leader stuff
|
||||
|
||||
|
||||
// Change Guild Nick
|
||||
if (!empty($_POST['player_guildnick'])) {
|
||||
$p_cid = user_character_id($_POST['player_guildnick']);
|
||||
$p_guild = get_player_guild_data($p_cid);
|
||||
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guildnick']) || empty($_POST['guildnick'])) {
|
||||
// Only allow normal symbols as guild nick
|
||||
$p_nick = sanitize($_POST['guildnick']);
|
||||
if ($p_guild['guild_id'] == $gid) {
|
||||
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
|
||||
else $chardata['online'] = (user_is_online_10($p_cid)) ? 1 : 0;
|
||||
if ($chardata['online'] == 0) {
|
||||
if ($config['ServerEngine'] !== 'TFS_10') update_player_guildnick($p_cid, $p_nick);
|
||||
else update_player_guildnick_10($p_cid, $p_nick);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
} else echo '<font color="red" size="4">Character not offline.</font>';
|
||||
}
|
||||
} else echo '<font color="red" size="4">Character guild nick may only contain a-z, A-Z and spaces.</font>';
|
||||
if ($config['guild_allow_nicknames']) {
|
||||
$p_cid = user_character_id($_POST['player_guildnick']);
|
||||
$p_guild = get_player_guild_data($p_cid);
|
||||
if (preg_match("/^[a-zA-Z_ ]+$/", $_POST['guildnick']) || empty($_POST['guildnick'])) {
|
||||
// Only allow normal symbols as guild nick
|
||||
$p_nick = sanitize($_POST['guildnick']);
|
||||
if ($p_guild['guild_id'] == $gid) {
|
||||
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
|
||||
else $chardata['online'] = (user_is_online_10($p_cid)) ? 1 : 0;
|
||||
if ($chardata['online'] == 0) {
|
||||
if ($config['ServerEngine'] !== 'TFS_10') update_player_guildnick($p_cid, $p_nick);
|
||||
else update_player_guildnick_10($p_cid, $p_nick);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
} else echo '<font color="red" size="4">Character not offline.</font>';
|
||||
}
|
||||
} else echo '<font color="red" size="4">Character guild nick may only contain a-z, A-Z and spaces.</font>';
|
||||
} else echo '<font color="red" size="4">Change guild nickname feature has been disabled.</font>';
|
||||
}
|
||||
|
||||
|
||||
// Promote character to guild position
|
||||
if (!empty($_POST['promote_character']) && !empty($_POST['promote_position'])) {
|
||||
// Verify that promoted character is from this guild.
|
||||
$p_rid = $_POST['promote_position'];
|
||||
$p_cid = user_character_id($_POST['promote_character']);
|
||||
$p_guild = get_player_guild_data($p_cid);
|
||||
|
||||
|
||||
if ($p_guild['guild_id'] == $gid) {
|
||||
// Do the magic.
|
||||
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data($p_cid, 'online');
|
||||
@ -435,13 +437,13 @@ if ($highest_access >= 2) {
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
} else echo '<font color="red" size="4">Character not offline.</font>';
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (!empty($_POST['invite'])) {
|
||||
if (user_character_exist($_POST['invite'])) {
|
||||
// Make sure they are not in another guild
|
||||
|
||||
|
||||
if ($config['ServerEngine'] != 'TFS_10') {
|
||||
$charname = sanitize($_POST['invite']);
|
||||
$playerdata = mysql_select_single("SELECT `id`, `rank_id` FROM `players` WHERE `name`='$charname' LIMIT 1;");
|
||||
@ -452,7 +454,7 @@ if ($highest_access >= 2) {
|
||||
$membership = mysql_select_single("SELECT `rank_id` FROM `guild_membership` WHERE `player_id`='$charid' LIMIT 1;");
|
||||
}
|
||||
if (!$membership) {
|
||||
//
|
||||
//
|
||||
$status = false;
|
||||
if ($inv_data !== false) {
|
||||
foreach ($inv_data as $inv) {
|
||||
@ -462,7 +464,7 @@ if ($highest_access >= 2) {
|
||||
foreach ($players as $player) {
|
||||
if ($player['name'] == $_POST['invite']) $status = true;
|
||||
}
|
||||
|
||||
|
||||
if ($status == false) {
|
||||
guild_invite_player($charid, $gid);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
@ -479,13 +481,13 @@ if ($highest_access >= 2) {
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['disband'])) {
|
||||
//
|
||||
//
|
||||
$gidd = (int)$_POST['disband'];
|
||||
$members = get_guild_players($gidd);
|
||||
$online = false;
|
||||
|
||||
|
||||
// First figure out if anyone are online.
|
||||
foreach ($members as $member) {
|
||||
if ($config['ServerEngine'] !== 'TFS_10') $chardata = user_character_data(user_character_id($member['name']), 'online');
|
||||
@ -494,26 +496,26 @@ if ($highest_access >= 2) {
|
||||
$online = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$online) {
|
||||
// Then remove guild rank from every player.
|
||||
if ($config['ServerEngine'] !== 'TFS_10') foreach ($members as $member) guild_player_leave(user_character_id($member['name']));
|
||||
else foreach ($members as $member) guild_player_leave_10(user_character_id($member['name']));
|
||||
|
||||
|
||||
// Remove all guild invitations to this guild
|
||||
if ($inv_count > 0) guild_remove_invites($gidd);
|
||||
|
||||
|
||||
// Then remove the guild itself.
|
||||
guild_delete($gidd);
|
||||
header('Location: success.php');
|
||||
exit();
|
||||
} else echo '<font color="red" size="4">All members must be offline to disband the guild.</font>';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['new_leader'])) {
|
||||
$new_leader = (int)$_POST['new_leader'];
|
||||
$old_leader = guild_leader($gid);
|
||||
|
||||
|
||||
$online = false;
|
||||
if ($config['ServerEngine'] !== 'TFS_10') {
|
||||
$newData = user_character_data($new_leader, 'online');
|
||||
@ -523,7 +525,7 @@ if ($highest_access >= 2) {
|
||||
$oldData['online'] = (user_is_online_10($old_leader)) ? 1 : 0;
|
||||
}
|
||||
if ($newData['online'] == 1 || $oldData['online'] == 1) $online = true;
|
||||
|
||||
|
||||
if ($online == false) {
|
||||
if (guild_change_leader($new_leader, $old_leader)) {
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
@ -531,13 +533,13 @@ if ($highest_access >= 2) {
|
||||
} else echo '<font color="red" size="4">Something went wrong when attempting to change leadership.</font>';
|
||||
} else echo '<font color="red" size="4">The new and old leader must be offline to change leadership.</font>';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['change_ranks'])) {
|
||||
$c_gid = (int)$_POST['change_ranks'];
|
||||
$c_ranks = get_guild_rank_data($c_gid);
|
||||
$rank_data = array();
|
||||
$rank_ids = array();
|
||||
|
||||
|
||||
// Feed new rank data
|
||||
foreach ($c_ranks as $rank) {
|
||||
$tmp = 'rank_name!'. $rank['level'];
|
||||
@ -546,19 +548,19 @@ if ($highest_access >= 2) {
|
||||
$rank_ids[$rank['level']] = $rank['id'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($rank_data as $level => $name) {
|
||||
guild_change_rank($rank_ids[$level], $name);
|
||||
}
|
||||
|
||||
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['remove_member'])) {
|
||||
$name = sanitize($_POST['remove_member']);
|
||||
$cid = user_character_id($name);
|
||||
|
||||
|
||||
if ($config['ServerEngine'] !== 'TFS_10') guild_remove_member($cid);
|
||||
else guild_remove_member_10($cid);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
@ -570,20 +572,20 @@ if ($highest_access >= 2) {
|
||||
$forumExist = mysql_select_single("SELECT `id` FROM `znote_forum` WHERE `guild_id`='$gid' LIMIT 1;");
|
||||
if ($forumExist === false) {
|
||||
// Insert data
|
||||
mysql_insert("INSERT INTO `znote_forum` (`name`, `access`, `closed`, `hidden`, `guild_id`)
|
||||
VALUES ('Guild',
|
||||
'1',
|
||||
'0',
|
||||
'0',
|
||||
mysql_insert("INSERT INTO `znote_forum` (`name`, `access`, `closed`, `hidden`, `guild_id`)
|
||||
VALUES ('Guild',
|
||||
'1',
|
||||
'0',
|
||||
'0',
|
||||
'$gid');");
|
||||
echo '<h1>Guild board has been created.</h1>';
|
||||
} else echo '<h1>Guild board already exist.</h1>';
|
||||
|
||||
|
||||
} else {
|
||||
echo '<h1>Error: Guild board system is disabled.</h1>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($config['ServerEngine'] == 'TFS_02' || $config['ServerEngine'] == 'OTHIRE' || $config['ServerEngine'] == 'TFS_10' && $config['guildwar_enabled'] === true) {
|
||||
if (!empty($_POST['warinvite'])) {
|
||||
$targetGuild = get_guild_id($_POST['warinvite']);
|
||||
@ -595,12 +597,12 @@ if ($highest_access >= 2) {
|
||||
if ($inv['id'] == $targetGuild) $status = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$check_guild = get_guild_name($gid);
|
||||
foreach ($check_guild as $guild) {
|
||||
if ($guild['name'] == $_POST['warinvite']) $status = true;
|
||||
}
|
||||
|
||||
|
||||
if ((int)$gid === (int)$targetGuild) $status = true;
|
||||
|
||||
$wars = mysql_select_multi("SELECT `id`, `guild1`, `guild2`, `status` FROM `guild_wars` WHERE (`guild1` = '$gid' OR `guild1` = '$targetGuild') AND (`guild2` = '$gid' OR `guild2` = '$targetGuild') AND `status` IN (0, 1);");
|
||||
@ -613,26 +615,26 @@ if ($highest_access >= 2) {
|
||||
} else echo '<font color="red" size="4">This guild has already been invited to war(or you\'re trying to invite your own).</FONT>';
|
||||
} else echo '<font color="red" size="4">That guild name does not exist.</font>';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['cancel_war_invite'])) {
|
||||
cancel_war_invitation($_POST['cancel_war_invite'], $gid);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['reject_war_invite'])) {
|
||||
reject_war_invitation($_POST['reject_war_invite'], $gid);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (!empty($_POST['accept_war_invite'])) {
|
||||
accept_war_invitation($_POST['accept_war_invite'], $gid);
|
||||
header('Location: guilds.php?name='. $_GET['name']);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$members = count_guild_members($gid);
|
||||
$ranks = get_guild_rank_data($gid);
|
||||
?>
|
||||
@ -667,7 +669,7 @@ if ($highest_access >= 2) {
|
||||
</ul>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
if (!empty($_FILES['file'])) {
|
||||
|
||||
@ -696,32 +698,34 @@ if ($highest_access >= 2) {
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
<!-- FORMS TO CHANGE GUILD NICK -->
|
||||
<form action="" method="post">
|
||||
<ul>
|
||||
<li>
|
||||
Change Guild Nick:<br>
|
||||
<select name="player_guildnick">
|
||||
<?php
|
||||
//$gid = get_guild_id($_GET['name']);
|
||||
//$players = get_guild_players($gid);
|
||||
<?php if ($config['guild_allow_nicknames']): ?>
|
||||
<!-- FORMS TO CHANGE GUILD NICK -->
|
||||
<form action="" method="post">
|
||||
<ul>
|
||||
<li>
|
||||
Change Guild Nick:<br>
|
||||
<select name="player_guildnick">
|
||||
<?php
|
||||
//$gid = get_guild_id($_GET['name']);
|
||||
//$players = get_guild_players($gid);
|
||||
|
||||
foreach ($players as $player) {
|
||||
if ($player['rank_level'] != 3) {
|
||||
echo '<option value="'. $player['name'] .'">'. $player['name'] .'</option>';
|
||||
} else {
|
||||
if ($highest_access == 3) {
|
||||
echo '<option value="'. $player['name'] .'">'. $player['name'] .'</option>';
|
||||
foreach ($players as $player) {
|
||||
if ($player['rank_level'] != 3) {
|
||||
echo '<option value="'. $player['name'] .'">'. $player['name'] .'</option>';
|
||||
} else {
|
||||
if ($highest_access == 3) {
|
||||
echo '<option value="'. $player['name'] .'">'. $player['name'] .'</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="text" name="guildnick" maxlength="15" placeholder="leave blank to erase">
|
||||
<input type="submit" value="Change Nick">
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
?>
|
||||
</select>
|
||||
<input type="text" name="guildnick" maxlength="15" placeholder="leave blank to erase">
|
||||
<input type="submit" value="Change Nick">
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
<!-- END FORMS TO CHANGE GUILD NICK -->
|
||||
<?php if ($members > 1) { ?>
|
||||
<!-- FORMS TO PROMOTE CHARACTER-->
|
||||
@ -735,8 +739,8 @@ if ($highest_access >= 2) {
|
||||
//$players = get_guild_players($gid);
|
||||
foreach ($players as $player) {
|
||||
if ($player['rank_level'] != 3) {
|
||||
echo '<option value="'. $player['name'] .'">'. $player['name'] .'</option>';
|
||||
}
|
||||
echo '<option value="'. $player['name'] .'">'. $player['name'] .'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@ -745,10 +749,10 @@ if ($highest_access >= 2) {
|
||||
foreach ($ranks as $rank) {
|
||||
if ($rank['level'] != 3) {
|
||||
if ($rank['level'] != 2) {
|
||||
echo '<option value="'. $rank['id'] .'">'. $rank['name'] .'</option>';
|
||||
echo '<option value="'. $rank['id'] .'">'. $rank['name'] .'</option>';
|
||||
} else {
|
||||
if ($highest_access == 3) {
|
||||
echo '<option value="'. $rank['id'] .'">'. $rank['name'] .'</option>';
|
||||
echo '<option value="'. $rank['id'] .'">'. $rank['name'] .'</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -819,7 +823,7 @@ if ($highest_access >= 2) {
|
||||
//$players = get_guild_players($gid);
|
||||
foreach ($players as $player) {
|
||||
if ($player['rank_level'] != 3) {
|
||||
echo '<option value="'. $player['id'] .'">'. $player['name'] .'</option>';
|
||||
echo '<option value="'. $player['id'] .'">'. $player['name'] .'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -862,7 +866,7 @@ if ($highest_access >= 2) {
|
||||
echo '</center></td><td><a href="guilds.php?name='.$war['name2'].'">'.$war['name2'].'</a></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="3"><center>Currently there are no pending invitations.</center></td></tr>';
|
||||
echo '</table>';
|
||||
@ -907,7 +911,7 @@ if ($config['guildwar_enabled'] === true) {
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user