mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-25 12:37:13 +00:00
more changes
This commit is contained in:
+12
-1
@@ -180,17 +180,28 @@
|
|||||||
Function to accept an invitation
|
Function to accept an invitation
|
||||||
*****************************************/
|
*****************************************/
|
||||||
private function acceptInvite($get) {
|
private function acceptInvite($get) {
|
||||||
global $database, $session;
|
global $form, $database, $session;
|
||||||
foreach($this->inviteArray as $invite) {
|
foreach($this->inviteArray as $invite) {
|
||||||
if($invite['id'] == $get['d']) {
|
if($invite['id'] == $get['d']) {
|
||||||
|
$memberlist = $database->getAllMember($invite['alliance']);
|
||||||
|
$alliance_info = $database->getAlliance($invite['alliance']);
|
||||||
|
if(count($memberlist) < $alliance_info['max']){
|
||||||
$database->removeInvitation($database->RemoveXSS($get['d']));
|
$database->removeInvitation($database->RemoveXSS($get['d']));
|
||||||
$database->updateUserField($database->RemoveXSS($invite['uid']), "alliance", $database->RemoveXSS($invite['alliance']), 1);
|
$database->updateUserField($database->RemoveXSS($invite['uid']), "alliance", $database->RemoveXSS($invite['alliance']), 1);
|
||||||
$database->createAlliPermissions($database->RemoveXSS($invite['uid']), $database->RemoveXSS($invite['alliance']), '', '0', '0', '0', '0', '0', '0', '0', '0');
|
$database->createAlliPermissions($database->RemoveXSS($invite['uid']), $database->RemoveXSS($invite['alliance']), '', '0', '0', '0', '0', '0', '0', '0', '0');
|
||||||
// Log the notice
|
// Log the notice
|
||||||
$database->insertAlliNotice($invite['alliance'], '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> has joined the alliance.');
|
$database->insertAlliNotice($invite['alliance'], '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> has joined the alliance.');
|
||||||
|
}else{
|
||||||
|
$accept_error = 1;
|
||||||
|
$max = $alliance_info['max'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($accept_error == 1){
|
||||||
|
$form->addError("ally_accept", "The alliance can contain only ".$max." peoples right now.");
|
||||||
|
}else{
|
||||||
header("Location: build.php?id=" . $get['id']);
|
header("Location: build.php?id=" . $get['id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************
|
/*****************************************
|
||||||
|
|||||||
@@ -211,6 +211,8 @@ if(isset($_POST['ft'])=='check'){
|
|||||||
|
|
||||||
if(!$checkexist){
|
if(!$checkexist){
|
||||||
$error = '<span class="error"><b>No Coordinates selected</b></span>';
|
$error = '<span class="error"><b>No Coordinates selected</b></span>';
|
||||||
|
}elseif($getwref == $village->wid){
|
||||||
|
$error = '<span class="error"><b>You cannot send resources to the same village</b></span>';
|
||||||
}elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
|
}elseif($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
|
||||||
$error = '<span class="error"><b>Player is Banned. You cannot send resources to him.</b></span>';
|
$error = '<span class="error"><b>Player is Banned. You cannot send resources to him.</b></span>';
|
||||||
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
|
}elseif($_POST['r1']==0 && $_POST['r2']==0 && $_POST['r3']==0 && $_POST['r4']==0){
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ echo "
|
|||||||
</tr></tbody></table>
|
</tr></tbody></table>
|
||||||
<?php
|
<?php
|
||||||
if($alliance->gotInvite) {
|
if($alliance->gotInvite) {
|
||||||
echo "<p class=\"error2\"></p>";
|
echo "<p class=\"error2\" style=\"color: #DD0000\">".$form->getError("ally_accept")."</p>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
include("upgrade.tpl");
|
include("upgrade.tpl");
|
||||||
|
|||||||
Reference in New Issue
Block a user