Kommunauty
Connexion
Inscription

Bug alliance


combatspace Messages : 125

Voilà ce que je vois quand je clik sur alliance:

Parse error: syntax error, unexpected $end in /home/a7395465/public_html/alliance.php on line 1268

Et je n'ai pas touché a l'alliance.php

samedi 23 mai 2009

Alexou Messages : 2506

Tu es héberger chez qui?

samedi 23 mai 2009

combatspace Messages : 125

000webhost

samedi 23 mai 2009

Alexou Messages : 2506

Tu as modifier d'autre fichiers récemment?

Même qui n'ont aucun rapport avec Alliance

samedi 23 mai 2009

combatspace Messages : 125

j'ai modifié les officiers mais l'alliance bug depuis le l'installatio du jeu, est ce que tu as les codes et les nom de fichiers et je vais regardé si il manque rien.

dimanche 24 mai 2009

Alexou Messages : 2506

Depuis le début du jeu, ça bugg?

Tu as quel version? Quand tu dis ça bugg, c'est un message d'erreur Xnova (erreur, merci de contacter l'admin...) ou une erreur hébergeur, ou fichier?

Je te mets pas es fichiers, car 31 fichiers, je crois pas que ça passe, et je pense que ça ferait bien ramer le site.

dimanche 24 mai 2009

combatspace Messages : 125

depuis que je l'ai installé 0.9b et j'ai regardé aussitot après installation du jeu et quand j'ai cliké sur alliance j'ai sa

Parse error: syntax error, unexpected $end in /home/a7395465/public_html/alliance.php on line 1269

mais il me faudrait les codes de tous les fichiers pour voir si j'en ai pas oublié 1 ou autre truc, qui on un raport avec l'alliance.

dimanche 24 mai 2009

Alexou Messages : 2506

Alliances.php, après, les autres, on verra du message que tu reçoit après, moi, j'ai 0.8, donc ptet que les codes ont changés, et il pourrait y voir confusion entre fichiers.

Enfin, essaie avec ça:

<?php

/**
 * alliance&#46;php
 *
 * @version 1&#46;0
 * @copyright 2008 by ??????? for XNova
 */

define('INSTALL' , false);

$mode = $_GET&#91;'mode'&#93;;
if (empty($mode))   { unset($mode); }
$a     = intval($_GET&#91;'a'&#93;);
if (empty($a))      { unset($a); }
$sort1 = intval($_GET&#91;'sort1'&#93;);
if (empty($sort1))  { unset($sort1); }
$sort2 = intval($_GET&#91;'sort2'&#93;);
if (empty($sort2))  { unset($sort2); }
$d = $_GET&#91;'d'&#93;;
if ((!is_numeric($d)) || (empty($d) && $d != 0))
unset($d);

$edit = $_GET&#91;'edit'&#93;;

if (empty($edit))
unset($edit);

$rank = intval($_GET&#91;'rank'&#93;);
if (empty($rank))
unset($rank);

$kick = intval($_GET&#91;'kick'&#93;);
if (empty($kick))
unset($kick);

$id = intval($_GET&#91;'id'&#93;);
if (empty($id))
unset($id);

define('INSIDE', true);
$ugamela_root_path = '&#46;/';
include($ugamela_root_path &#46; 'extension&#46;inc');
include($ugamela_root_path &#46; 'common&#46;' &#46; $phpEx);

$mode     = $_GET&#91;'mode'&#93;;
$yes      = $_GET&#91;'yes'&#93;;
$edit     = $_GET&#91;'edit'&#93;;
$allyid   = intval($_GET&#91;'allyid'&#93;);
$show     = intval($_GET&#91;'show'&#93;);
$sort     = intval($_GET&#91;'sort'&#93;);
$sendmail = intval($_GET&#91;'sendmail'&#93;);
$t        = $_GET&#91;'t'&#93;;
$a        = intval($_GET&#91;'a'&#93;);
$tag      = mysql_escape_string($_GET&#91;'tag'&#93;);

includeLang('alliance');


/*
  Alianza consiste en tres partes&#46;
  La primera es la comun&#46; Es decir, no se necesita comprobar si se esta en una alianza o no&#46;
  La segunda, es sin alianza&#46; Eso implica las solicitudes&#46;
  La ultima, seria cuando ya se esta dentro de una&#46;
*/
// Parte inicial&#46;

if ($_GET&#91;'mode'&#93; == 'ainfo') {
$a = intval($_GET&#91;'a'&#93;);
$tag = mysql_escape_string($_GET&#91;'tag'&#93;);
// Evitamos errores casuales xD
// query
$lang&#91;'Alliance_information'&#93; = "Allianz Information";

if (isset($_GET&#91;'tag'&#93;)) {
$allyrow = doquery("SELECT * FROM {{table}} WHERE ally_tag='{$tag}'", "alliance", true);
} elseif (is_numeric($a) && $a != 0) {
$allyrow = doquery("SELECT * FROM {{table}} WHERE id='{$a}'", "alliance", true);
} else {
message("Diese Allianz existiert leider nicht!", "Allianz Information (1)");
}
// Si no existe
if (!$allyrow) {
message("Diese Allianz existiert leider nicht!", "Allianz Information (1)");
}
extract($allyrow);

if ($ally_image != "") {
$ally_image = "<tr><th colspan=2><img src="{$ally_image}"></td></tr>";
}

if ($ally_description != "") {
$ally_description = "<tr><th colspan=2 height=100>{$ally_description}</th></tr>";
} else
$ally_description = "<tr><th colspan=2 height=100>Bei dieser Allianz hat noch niemand eine Beschreibung eingegeben&#46;</th></tr>";

if ($ally_web != "") {
$ally_web = "<tr>
<th>{$lang&#91;'Initial_page'&#93;}</th>
<th><a href="{$ally_web}">{$ally_web}</a></th>
</tr>";
}

$lang&#91;'ally_member_scount'&#93; = $ally_members;
$lang&#91;'ally_name'&#93; = $ally_name;
$lang&#91;'ally_tag'&#93; = $ally_tag;
// codigo raro
$patterns&#91;&#93; = "#&#91;fc&#93;(&#91;a-z0-9#&#93;+)&#91;/fc&#93;(&#46;*?)&#91;/f&#93;#Ssi";
$replacements&#91;&#93; = '<font color="1">2</font>';
$patterns&#91;&#93; = '#&#91;img&#93;(&#46;*?)&#91;/img&#93;#Smi';
$replacements&#91;&#93; = '<img src="1" alt="1" style="border&#58;0px;" />';
$patterns&#91;&#93; = "#&#91;fc&#93;(&#91;a-z0-9# &#91;&#93;&#93;+)&#91;/fc&#93;#Ssi";
$replacements&#91;&#93; = '<font color="1">';
$patterns&#91;&#93; = "#&#91;/f&#93;#Ssi";
$replacements&#91;&#93; = '</font>';
$ally_description = preg_replace($patterns, $replacements, $ally_description);

$lang&#91;'ally_description'&#93; = nl2br($ally_description);
$lang&#91;'ally_image'&#93; = $ally_image;
$lang&#91;'ally_web'&#93; = $ally_web;

if ($user&#91;'ally_id'&#93; == 0) {
$lang&#91;'bewerbung'&#93; = "<tr>
  <th>Bewerben</th>
  <th><a href="alliance&#46;php?mode=apply&amp;allyid=" &#46; $id &#46; "">Klicke hier um eine Bewerbung zu schreiben</a></th>

</tr>";
} else
$lang&#91;'bewerbung'&#93; = "";

$page &#46;= parsetemplate(gettemplate('alliance_ainfo'), $lang);
display($page, str_replace('%s', $ally_name, $lang&#91;'Info_of_Alliance'&#93;));
}
// --&#91;Comprobaciones de alianza&#93;-------------------------
if ($user&#91;'ally_id'&#93; == 0) { // Sin alianza
if ($mode == 'make' && $user&#91;'ally_request'&#93; == 0) { // Make alliance
/*
  Aca se crean las alianzas&#46;&#46;&#46;
*/
if ($yes == 1 && $_POST) {
/*
  Por el momento solo estoy improvisando, luego se perfeccionara el sistema &#58;)
  Creo que aqui se realiza una query para comprovar el nombre, y luego le pregunta si es el tag correcto&#46;&#46;&#46;
*/
if (!$_POST&#91;'atag'&#93;) {
message($lang&#91;'have_not_tag'&#93;, $lang&#91;'make_alliance'&#93;);
}
if (!$_POST&#91;'aname'&#93;) {
message($lang&#91;'have_not_name'&#93;, $lang&#91;'make_alliance'&#93;);
}

$tagquery = doquery("SELECT * FROM {{table}} WHERE ally_tag='{$_POST&#91;'atag'&#93;}'", 'alliance', true);

if ($tagquery) {
message(str_replace('%s', $_POST&#91;'atag'&#93;, $lang&#91;'always_exist'&#93;), $lang&#91;'make_alliance'&#93;);
}

doquery("INSERT INTO {{table}} SET
`ally_name`='{$_POST&#91;'aname'&#93;}',
`ally_tag`='{$_POST&#91;'atag'&#93;}' ,
`ally_owner`='{$user&#91;'id'&#93;}',
`ally_owner_range`='Leader',
`ally_members`='1',
`ally_register_time`=" &#46; time() , "alliance");

$allyquery = doquery("SELECT * FROM {{table}} WHERE ally_tag='{$_POST&#91;'atag'&#93;}'", 'alliance', true);

doquery("UPDATE {{table}} SET
`ally_id`='{$allyquery&#91;'id'&#93;}',
`ally_name`='{$allyquery&#91;'ally_name'&#93;}',
`ally_register_time`='" &#46; time() &#46; "'
WHERE `id`='{$user&#91;'id'&#93;}'", "users");

$page = MessageForm(str_replace('%s', $_POST&#91;'atag'&#93;, $lang&#91;'ally_maked'&#93;),

str_replace('%s', $_POST&#91;'atag'&#93;, $lang&#91;'alliance_has_been_maked'&#93;) &#46; "<br><br>", "", $lang&#91;'Ok'&#93;);
} else {
$page &#46;= parsetemplate(gettemplate('alliance_make'), $lang);
}

display($page, $lang&#91;'make_alliance'&#93;);
}

if ($mode == 'search' && $user&#91;'ally_request'&#93; == 0) { // search one
/*
  Buscador de alianzas
*/
$parse = $lang;
$lang&#91;'searchtext'&#93; = $_POST&#91;'searchtext'&#93;;
$page = parsetemplate(gettemplate('alliance_searchform'), $lang);

if ($_POST) { // esta parte es igual que el buscador de search&#46;php&#46;&#46;&#46;
// searchtext
$search = doquery("SELECT * FROM {{table}} WHERE ally_name LIKE '%{$_POST&#91;'searchtext'&#93;}%' or ally_tag LIKE '%{$_POST&#91;'searchtext'&#93;}%' LIMIT 30", "alliance");

if (mysql_num_rows($search) != 0) {
$template = gettemplate('alliance_searchresult_row');

while ($s = mysql_fetch_array($search)) {
$entry = array();
$entry&#91;'ally_tag'&#93; = "&#91;<a href="alliance&#46;php?mode=apply&allyid={$s&#91;'id'&#93;}">{$s&#91;'ally_tag'&#93;}</a>&#93;";
$entry&#91;'ally_name'&#93; = $s&#91;'ally_name'&#93;;
$entry&#91;'ally_members'&#93; = $s&#91;'ally_members'&#93;;

$parse&#91;'result'&#93; &#46;= parsetemplate($template, $entry);
}

$page &#46;= parsetemplate(gettemplate('alliance_searchresult_table'), $parse);
}
}

display($page, $lang&#91;'search_alliance'&#93;);
}

if ($mode == 'apply' && $user&#91;'ally_request'&#93; == 0) { // solicitudes
if (!is_numeric($_GET&#91;'allyid'&#93;) || !$_GET&#91;'allyid'&#93; || $user&#91;'ally_request'&#93; != 0 || $user&#91;'ally_id'&#93; != 0) {
message($lang&#91;'it_is_not_posible_to_apply'&#93;, $lang&#91;'it_is_not_posible_to_apply'&#93;);
}
// pedimos la info de la alianza
$allyrow = doquery("SELECT ally_tag,ally_request FROM {{table}} WHERE id='" &#46; intval($_GET&#91;'allyid'&#93;) &#46; "'", "alliance", true);

if (!$allyrow) {
message($lang&#91;'it_is_not_posible_to_apply'&#93;, $lang&#91;'it_is_not_posible_to_apply'&#93;);
}

extract($allyrow);

if ($_POST&#91;'further'&#93; == $lang&#91;'Send'&#93;) { // esta parte es igual que el buscador de search&#46;php&#46;&#46;&#46;
doquery("UPDATE {{table}} SET `ally_request`='" &#46; intval($allyid) &#46; "', ally_request_text='" &#46; mysql_escape_string(strip_tags($_POST&#91;'text'&#93;)) &#46; "', ally_register_time='" &#46; time() &#46; "' WHERE `id`='" &#46; $user&#91;'id'&#93; &#46; "'", "users");
// mensaje de cuando se envia correctamente el mensaje
message($lang&#91;'apply_registered'&#93;, $lang&#91;'your_apply'&#93;);
// mensaje de cuando falla el envio
// message($lang&#91;'apply_cantbeadded'&#93;, $lang&#91;'your_apply'&#93;);
} else {
$text_apply = ($ally_request) ? $ally_request &#58; $lang&#91;'There_is_no_a_text_apply'&#93;;
}

$parse = $lang;
$parse&#91;'allyid'&#93; = intval($_GET&#91;'allyid'&#93;);
$parse&#91;'chars_count'&#93; = strlen($text_apply);
$parse&#91;'text_apply'&#93; = $text_apply;
$parse&#91;'Write_to_alliance'&#93; = str_replace('%s', $ally_tag, $lang&#91;'Write_to_alliance'&#93;);

$page = parsetemplate(gettemplate('alliance_applyform'), $parse);

display($page, $lang&#91;'Write_to_alliance'&#93;);
}

if ($user&#91;'ally_request'&#93; != 0) { // Esperando una respuesta
// preguntamos por el ally_tag
$allyquery = doquery("SELECT ally_tag FROM {{table}} WHERE id='" &#46; intval($user&#91;'ally_request'&#93;) &#46; "' ORDER BY `id`", "alliance", true);

extract($allyquery);
if ($_POST&#91;'bcancel'&#93;) {
doquery("UPDATE {{table}} SET `ally_request`=0 WHERE `id`=" &#46; $user&#91;'id'&#93;, "users");

$lang&#91;'request_text'&#93; = str_replace('%s', $ally_tag, $lang&#91;'Canceled_a_request_text'&#93;);
$lang&#91;'button_text'&#93; = $lang&#91;'Ok'&#93;;
$page = parsetemplate(gettemplate('alliance_apply_waitform'), $lang);
} else {
$lang&#91;'request_text'&#93; = str_replace('%s', $ally_tag, $lang&#91;'Waiting_a_request_text'&#93;);
$lang&#91;'button_text'&#93; = $lang&#91;'Delete_apply'&#93;;
$page = parsetemplate(gettemplate('alliance_apply_waitform'), $lang);
}
// mysql_escape_string(strip_tags());
display($page, "Deine Anfrage");
} else { // Vista sin allianza
/*
  Vista normal de cuando no se tiene ni solicitud ni alianza
*/
$page &#46;= parsetemplate(gettemplate('alliance_defaultmenu'), $lang);
display($page, $lang&#91;'alliance'&#93;);
}
}

//---------------------------------------------------------------------------------------------------------------------------------------------------
// Parte de adentro de la alianza
elseif ($user&#91;'ally_id'&#93; != 0 && $user&#91;'ally_request'&#93; == 0) { // Con alianza
// query para la allyrow
/*
array(1 =>
'name' => 'Co&#46; Leader',
'mails' => '1',
'delete' => '0',
'kick' => '1',
'bewerbungen' => '1',
'administrieren' => '1',
'memberlist' => '1',
'bewerbungenbearbeiten' => '1',
'onlinestatus' => '1',
'rechtehand' => '1'
);

*/
$ally = doquery("SELECT * FROM {{table}} WHERE id='{$user&#91;'ally_id'&#93;}'", "alliance", true);

$ally_ranks = unserialize($ally&#91;'ally_ranks'&#93;);

$allianz_raenge = unserialize($ally&#91;'ally_ranks'&#93;);

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'onlinestatus'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$user_can_watch_memberlist_status = true;
} else
$user_can_watch_memberlist_status = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'memberlist'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$user_can_watch_memberlist = true;
} else
$user_can_watch_memberlist = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'mails'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$user_can_send_mails = true;
} else
$user_can_send_mails = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'kick'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$user_can_kick = true;
} else
$user_can_kick = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'rechtehand'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;)
$user_can_edit_rights = true;
else
$user_can_edit_rights = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'delete'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;)
$user_can_exit_alliance = true;
else
$user_can_exit_alliance = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'bewerbungen'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;)
$user_bewerbungen_einsehen = true;
else
$user_bewerbungen_einsehen = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'bewerbungenbearbeiten'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;)
$user_bewerbungen_bearbeiten = true;
else
$user_bewerbungen_bearbeiten = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'administrieren'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;)
$user_admin = true;
else
$user_admin = false;

if ($allianz_raenge&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'onlinestatus'&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;)
$user_onlinestatus = true;
else
$user_onlinestatus = false;

if (!$ally) {
doquery("UPDATE {{table}} SET `ally_id`=0 WHERE `id`='{$user&#91;'id'&#93;}'", "users");
message($lang&#91;'ally_notexist'&#93;, $lang&#91;'your_alliance'&#93;, 'alliance&#46;php');
}

if ($mode == 'exit') {
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
message($lang&#91;'Owner_cant_go_out'&#93;, $lang&#91;'Alliance'&#93;);
}
// se sale de la alianza
if ($_GET&#91;'yes'&#93; == 1) {
doquery("UPDATE {{table}} SET `ally_id`=0, `ally_name` = '' WHERE `id`='{$user&#91;'id'&#93;}'", "users");
$lang&#91;'Go_out_welldone'&#93; = str_replace("%s", $ally_name, $lang&#91;'Go_out_welldone'&#93;);
$page = MessageForm($lang&#91;'Go_out_welldone'&#93;, "<br>", $PHP_SELF, $lang&#91;'Ok'&#93;);
// Se quitan los puntos del user en la alianza
} else {
// se pregunta si se quiere salir
$lang&#91;'Want_go_out'&#93; = str_replace("%s", $ally_name, $lang&#91;'Want_go_out'&#93;);
$page = MessageForm($lang&#91;'Want_go_out'&#93;, "<br>", "?mode=exit&yes=1", "Ja");
}
display($page);
}

if ($mode == 'memberslist') { // Lista de miembros&#46;
/*
  Lista de miembros&#46;
  Por lo que parece solo se hace una query fijandose los usuarios con el mismo ally_id&#46;
  seguido del query del planeta principal de cada uno para sacarle la posicion, pero
  voy a ver si tambien agrego las cordenadas en el id user&#46;&#46;&#46;
*/
// obtenemos el array de los rangos
// $ally_ranks = unserialize($ally&#91;'ally_ranks'&#93;);
$allianz_raenge = unserialize($ally&#91;'ally_ranks'&#93;);
// $user_can_watch_memberlist
// comprobamos el permiso
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_can_watch_memberlist) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
}
// El orden de aparicion
if ($sort2) {
$sort1 = intval($_GET&#91;'sort1'&#93;);
$sort2 = intval($_GET&#91;'sort2'&#93;);

if ($sort1 == 1) {
$sort = " ORDER BY `username`";
} elseif ($sort1 == 2) {
$sort = " ORDER BY `username`";
} elseif ($sort1 == 3) {
$sort = " ORDER BY `points`";
} elseif ($sort1 == 4) {
$sort = " ORDER BY `ally_register_time`";
} elseif ($sort1 == 5) {
$sort = " ORDER BY `onlinetime`";
} else {
$sort = " ORDER BY `id`";
}

if ($sort2 == 1) {
$sort &#46;= " DESC;";
} elseif ($sort2 == 2) {
$sort &#46;= " ASC;";
}
$listuser = doquery("SELECT * FROM {{table}} WHERE ally_id='{$user&#91;'ally_id'&#93;}'{$sort}", 'users');
} else {
$listuser = doquery("SELECT * FROM {{table}} WHERE ally_id='{$user&#91;'ally_id'&#93;}'", 'users');
}
// contamos la cantidad de usuarios&#46;
$i = 0;
// Como es costumbre&#46; un row template
$template = gettemplate('alliance_memberslist_row');
$page_list = '';
while ($u = mysql_fetch_array($listuser)) {
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" &#46; $u&#91;'id'&#93; &#46; "';", 'statpoints', true);

$i++;
$u&#91;'i'&#93; = $i;

if ($u&#91;"onlinetime"&#93; + 60 * 10 >= time() && $user_can_watch_memberlist_status) {
$u&#91;"onlinetime"&#93; = "lime>{$lang&#91;'On'&#93;}<";
} elseif ($u&#91;"onlinetime"&#93; + 60 * 20 >= time() && $user_can_watch_memberlist_status) {
$u&#91;"onlinetime"&#93; = "yellow>{$lang&#91;'15_min'&#93;}<";
} elseif ($user_can_watch_memberlist_status) {
$u&#91;"onlinetime"&#93; = "red>{$lang&#91;'Off'&#93;}<";
} else $u&#91;"onlinetime"&#93; = "orange>-<";
// Nombre de rango
if ($ally&#91;'ally_owner'&#93; == $u&#91;'id'&#93;) {
$u&#91;"ally_range"&#93; = ($ally&#91;'ally_owner_range'&#93; == '')?"Leader"&#58;$ally&#91;'ally_owner_range'&#93;;
} elseif (isset($allianz_raenge&#91;$u&#91;'ally_rank_id'&#93;&#93;&#91;'name'&#93;)) {
$u&#91;"ally_range"&#93; = $allianz_raenge&#91;$u&#91;'ally_rank_id'&#93;&#93;&#91;'name'&#93;;
} else {
$u&#91;"ally_range"&#93; = $lang&#91;'Novate'&#93;;
}

$u&#91;"dpath"&#93; = $dpath;
$u&#91;'points'&#93; = "" &#46; pretty_number($UserPoints&#91;'total_points'&#93;) &#46; "";

if ($u&#91;'ally_register_time'&#93; > 0)
$u&#91;'ally_register_time'&#93; = date("Y-m-d h&#58;i&#58;s", $u&#91;'ally_register_time'&#93;);
else
$u&#91;'ally_register_time'&#93; = "-";

$page_list &#46;= parsetemplate($template, $u);
}
// para cambiar el link de ordenar&#46;
if ($sort2 == 1) {
$s = 2;
} elseif ($sort2 == 2) {
$s = 1;
} else {
$s = 1;
}

if ($i != $ally&#91;'ally_members'&#93;) {
doquery("UPDATE {{table}} SET `ally_members`='{$i}' WHERE `id`='{$ally&#91;'id'&#93;}'", 'alliance');
}

$parse = $lang;
$parse&#91;'i'&#93; = $i;
$parse&#91;'s'&#93; = $s;
$parse&#91;'list'&#93; = $page_list;

$page &#46;= parsetemplate(gettemplate('alliance_memberslist_table'), $parse);

display($page, $lang&#91;'Members_list'&#93;);
}

if ($mode == 'circular') { // Correo circular
/*
  Mandar un correo circular&#46;
  creo que aqui tendria que ver yo como crear el sistema de mensajes&#46;&#46;&#46;
*/
// un loop para mostrar losrangos
$allianz_raenge = unserialize($ally&#91;'ally_ranks'&#93;);
// comprobamos el permiso
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_can_send_mails) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Send_circular_mail'&#93;);
}

if ($sendmail == 1) {
$_POST&#91;'r'&#93; = intval($_POST&#91;'r'&#93;);
$_POST&#91;'text'&#93; = mysql_escape_string(strip_tags($_POST&#91;'text'&#93;));

if ($_POST&#91;'r'&#93; == 0) {
$sq = doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user&#91;'ally_id'&#93;}'", "users");
} else {
$sq = doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user&#91;'ally_id'&#93;}' AND ally_rank_id='{$_POST&#91;'r'&#93;}'", "users");
}
// looooooop
$list = '';
while ($u = mysql_fetch_array($sq)) {
doquery("INSERT INTO {{table}} SET
`message_owner`='{$u&#91;'id'&#93;}',
`message_sender`='{$user&#91;'id'&#93;}' ,
`message_time`='" &#46; time() &#46; "',
`message_type`='2',
`message_from`='{$ally&#91;'ally_tag'&#93;}',
`message_subject`='{$user&#91;'username'&#93;}',
`message_text`='{$_POST&#91;'text'&#93;}'
", "messages");
$list &#46;= "<br>{$u&#91;'username'&#93;} ";
}
// doquery("SELECT id,username FROM {{table}} WHERE ally_id='{$user&#91;'ally_id'&#93;}' ORDER BY `id`","users");
doquery("UPDATE {{table}} SET `new_message`=new_message+1 WHERE ally_id='{$user&#91;'ally_id'&#93;}' AND ally_rank_id='{$_POST&#91;'r'&#93;}'", "users");
doquery("UPDATE {{table}} SET `mnl_alliance`=mnl_alliance+1 WHERE ally_id='{$user&#91;'ally_id'&#93;}' AND ally_rank_id='{$_POST&#91;'r'&#93;}'", "users");
/*
  Aca un mensajito diciendo que a quien se mando&#46;
*/
$page = MessageForm($lang&#91;'Circular_sended'&#93;, "Folgende Mitglieder erhielten eine Nachricht&#58;" &#46; $list, "alliance&#46;php", $lang&#91;'Ok'&#93;, true);
display($page, $lang&#91;'Send_circular_mail'&#93;);
}

$lang&#91;'r_list'&#93; = "<option value="0">{$lang&#91;'All_players'&#93;}</option>";
if ($allianz_raenge) {
foreach($allianz_raenge as $id => $array) {
$lang&#91;'r_list'&#93; &#46;= "<option value="" &#46; ($id + 1) &#46; "">" &#46; $array&#91;'name'&#93; &#46; "</option>";
}
}

$page &#46;= parsetemplate(gettemplate('alliance_circular'), $lang);

display($page, $lang&#91;'Send_circular_mail'&#93;);
}

if ($mode == 'admin' && $edit == 'rights') { // Administrar leyes
$allianz_raenge = unserialize($ally&#91;'ally_ranks'&#93;);

if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_can_edit_rights) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
} elseif (!empty($_POST&#91;'newrangname'&#93;)) {
$name = mysql_escape_string(strip_tags($_POST&#91;'newrangname'&#93;));

$allianz_raenge&#91;&#93; = array('name' => $name,
'mails' => 0,
'delete' => 0,
'kick' => 0,
'bewerbungen' => 0,
'administrieren' => 0,
'bewerbungenbearbeiten' => 0,
'memberlist' => 0,
'onlinestatus' => 0,
'rechtehand' => 0
);

$ranks = serialize($allianz_raenge);

doquery("UPDATE {{table}} SET `ally_ranks`='" &#46; $ranks &#46; "' WHERE `id`=" &#46; $ally&#91;'id'&#93;, "alliance");

$goto = $_SERVER&#91;'PHP_SELF'&#93; &#46; "?" &#46; $_SERVER&#91;'QUERY_STRING'&#93;;

header("Location&#58; " &#46; $goto);
exit();
} elseif ($_POST&#91;'id'&#93; != '' && is_array($_POST&#91;'id'&#93;)) {
$ally_ranks_new = array();

foreach ($_POST&#91;'id'&#93; as $id) {
$name = $allianz_raenge&#91;$id&#93;&#91;'name'&#93;;

$ally_ranks_new&#91;$id&#93;&#91;'name'&#93; = $name;

if (isset($_POST&#91;'u' &#46; $id &#46; 'r0'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'delete'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'delete'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r1'&#93;) && $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$ally_ranks_new&#91;$id&#93;&#91;'kick'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'kick'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r2'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'bewerbungen'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'bewerbungen'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r3'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'memberlist'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'memberlist'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r4'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'bewerbungenbearbeiten'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'bewerbungenbearbeiten'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r5'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'administrieren'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'administrieren'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r6'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'onlinestatus'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'onlinestatus'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r7'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'mails'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'mails'&#93; = 0;
}

if (isset($_POST&#91;'u' &#46; $id &#46; 'r8'&#93;)) {
$ally_ranks_new&#91;$id&#93;&#91;'rechtehand'&#93; = 1;
} else {
$ally_ranks_new&#91;$id&#93;&#91;'rechtehand'&#93; = 0;
}
}

$ranks = serialize($ally_ranks_new);

doquery("UPDATE {{table}} SET `ally_ranks`='" &#46; $ranks &#46; "' WHERE `id`=" &#46; $ally&#91;'id'&#93;, "alliance");

$goto = $_SERVER&#91;'PHP_SELF'&#93; &#46; "?" &#46; $_SERVER&#91;'QUERY_STRING'&#93;;

header("Location&#58; " &#46; $goto);
exit();
}
// borrar una entrada
elseif (isset($d) && isset($ally_ranks&#91;$d&#93;)) {
unset($ally_ranks&#91;$d&#93;);
$ally&#91;'ally_rank'&#93; = serialize($ally_ranks);

doquery("UPDATE {{table}} SET `ally_ranks`='{$ally&#91;'ally_rank'&#93;}' WHERE `id`={$ally&#91;'id'&#93;}", "alliance");
}

if (count($ally_ranks) == 0 || $ally_ranks == '') { // si no hay rangos
$list = "<th>{$lang&#91;'There_is_not_range'&#93;}</th>";
} else { // Si hay rangos
// cargamos la template de tabla
$list = parsetemplate(gettemplate('alliance_admin_laws_head'), $lang);
$template = gettemplate('alliance_admin_laws_row');
// Creamos la lista de rangos
$i = 0;

foreach($ally_ranks as $a => $b) {
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
// $i++;u2r5
$lang&#91;'id'&#93; = $a;
$lang&#91;'delete'&#93; = "<a href="alliance&#46;php?mode=admin&edit=rights&d={$a}"><img src="{$dpath}pic/abort&#46;gif" alt="{$lang&#91;'Delete_range'&#93;}" border=0></a>";
$lang&#91;'r0'&#93; = $b&#91;'name'&#93;;
$lang&#91;'a'&#93; = $a;
$lang&#91;'r1'&#93; = "<input type=checkbox name="u{$a}r0"" &#46; (($b&#91;'delete'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">"; //{$b&#91;1&#93;}
$lang&#91;'r2'&#93; = "<input type=checkbox name="u{$a}r1"" &#46; (($b&#91;'kick'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r3'&#93; = "<input type=checkbox name="u{$a}r2"" &#46; (($b&#91;'bewerbungen'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r4'&#93; = "<input type=checkbox name="u{$a}r3"" &#46; (($b&#91;'memberlist'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r5'&#93; = "<input type=checkbox name="u{$a}r4"" &#46; (($b&#91;'bewerbungenbearbeiten'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r6'&#93; = "<input type=checkbox name="u{$a}r5"" &#46; (($b&#91;'administrieren'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r7'&#93; = "<input type=checkbox name="u{$a}r6"" &#46; (($b&#91;'onlinestatus'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r8'&#93; = "<input type=checkbox name="u{$a}r7"" &#46; (($b&#91;'mails'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r9'&#93; = "<input type=checkbox name="u{$a}r8"" &#46; (($b&#91;'rechtehand'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";

$list &#46;= parsetemplate($template, $lang);
} else {
$lang&#91;'id'&#93; = $a;
$lang&#91;'r0'&#93; = $b&#91;'name'&#93;;
$lang&#91;'delete'&#93; = "<a href="alliance&#46;php?mode=admin&edit=rights&d={$a}"><img src="{$dpath}pic/abort&#46;gif" alt="{$lang&#91;'Delete_range'&#93;}" border=0></a>";
$lang&#91;'a'&#93; = $a;
$lang&#91;'r1'&#93; = "<b>-</b>";
$lang&#91;'r2'&#93; = "<input type=checkbox name="u{$a}r1"" &#46; (($b&#91;'kick'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r3'&#93; = "<input type=checkbox name="u{$a}r2"" &#46; (($b&#91;'bewerbungen'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r4'&#93; = "<input type=checkbox name="u{$a}r3"" &#46; (($b&#91;'memberlist'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r5'&#93; = "<input type=checkbox name="u{$a}r4"" &#46; (($b&#91;'bewerbungenbearbeiten'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r6'&#93; = "<input type=checkbox name="u{$a}r5"" &#46; (($b&#91;'administrieren'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r7'&#93; = "<input type=checkbox name="u{$a}r6"" &#46; (($b&#91;'onlinestatus'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r8'&#93; = "<input type=checkbox name="u{$a}r7"" &#46; (($b&#91;'mails'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";
$lang&#91;'r9'&#93; = "<input type=checkbox name="u{$a}r8"" &#46; (($b&#91;'rechtehand'&#93; == 1)?' checked="checked"'&#58;'') &#46; ">";

$list &#46;= parsetemplate($template, $lang);
}
}

if (count($ally_ranks) != 0) {
$list &#46;= parsetemplate(gettemplate('alliance_admin_laws_feet'), $lang);
}
}

$lang&#91;'list'&#93; = $list;
$lang&#91;'dpath'&#93; = $dpath;
$page &#46;= parsetemplate(gettemplate('alliance_admin_laws'), $lang);

display($page, $lang&#91;'Law_settings'&#93;);
}

if ($mode == 'admin' && $edit == 'ally') { // Administrar la alianza *pendiente urgente*
if ($t != 1 && $t != 2 && $t != 3) {
$t = 1;
}
// post!
if ($_POST) {
if (!get_magic_quotes_gpc()) {
$_POST&#91;'owner_range'&#93; = stripslashes($_POST&#91;'owner_range'&#93;);
$_POST&#91;'web'&#93; = stripslashes($_POST&#91;'web'&#93;);
$_POST&#91;'image'&#93; = stripslashes($_POST&#91;'image'&#93;);
$_POST&#91;'text'&#93; = stripslashes($_POST&#91;'text'&#93;);
}
}

if ($_POST&#91;'options'&#93;) {
$ally&#91;'ally_owner_range'&#93; = mysql_escape_string(htmlspecialchars(strip_tags($_POST&#91;'owner_range'&#93;)));

$ally&#91;'ally_web'&#93; = mysql_escape_string(htmlspecialchars(strip_tags($_POST&#91;'web'&#93;)));

$ally&#91;'ally_image'&#93; = mysql_escape_string(htmlspecialchars(strip_tags($_POST&#91;'image'&#93;)));

$ally&#91;'ally_request_notallow'&#93; = intval($_POST&#91;'request_notallow'&#93;);

if ($ally&#91;'ally_request_notallow'&#93; != 0 && $ally&#91;'ally_request_notallow'&#93; != 1) {
message("W&auml;hle bei "Bewerbungen" eine Option aus dem Formular!", "Fehler");
exit;
}

doquery("UPDATE {{table}} SET
`ally_owner_range`='{$ally&#91;'ally_owner_range'&#93;}',
`ally_image`='{$ally&#91;'ally_image'&#93;}',
`ally_web`='{$ally&#91;'ally_web'&#93;}',
`ally_request_notallow`='{$ally&#91;'ally_request_notallow'&#93;}'
WHERE `id`='{$ally&#91;'id'&#93;}'", "alliance");
} elseif ($_POST&#91;'t'&#93;) {
if ($t == 3) {
$ally&#91;'ally_request'&#93; = mysql_escape_string(strip_tags($_POST&#91;'text'&#93;));

doquery("UPDATE {{table}} SET
`ally_request`='{$ally&#91;'ally_request'&#93;}'
WHERE `id`='{$ally&#91;'id'&#93;}'", "alliance");
} elseif ($t == 2) {
$ally&#91;'ally_text'&#93; = mysql_escape_string(strip_tags($_POST&#91;'text'&#93;));
doquery("UPDATE {{table}} SET
`ally_text`='{$ally&#91;'ally_text'&#93;}'
WHERE `id`='{$ally&#91;'id'&#93;}'", "alliance");
} else {
$ally&#91;'ally_description'&#93; = mysql_escape_string(strip_tags($_POST&#91;'text'&#93;));

doquery("UPDATE {{table}} SET
`ally_description`='" &#46; $ally&#91;'ally_description'&#93; &#46; "'
WHERE `id`='{$ally&#91;'id'&#93;}'", "alliance");
}
}
$lang&#91;'dpath'&#93; = $dpath;
/*
  Depende del $t, muestra el formulario para cada tipo de texto&#46;
*/
if ($t == 3) {
$lang&#91;'request_type'&#93; = $lang&#91;'Show_of_request_text'&#93;;
} elseif ($t == 2) {
$lang&#91;'request_type'&#93; = $lang&#91;'Internal_text_of_alliance'&#93;;
} else {
$lang&#91;'request_type'&#93; = $lang&#91;'Public_text_of_alliance'&#93;;
}

if ($t == 2) {
$lang&#91;'text'&#93; = $ally&#91;'ally_text'&#93;;
$lang&#91;'Texts'&#93; = "Interner Text";
$lang&#91;'Show_of_request_text'&#93; = "Internet Allianz Text";
} else {
$lang&#91;'text'&#93; = $ally&#91;'ally_description'&#93;;
}

if ($t == 3) {
}
$lang&#91;'t'&#93; = $t;

$lang&#91;'ally_web'&#93; = $ally&#91;'ally_web'&#93;;
$lang&#91;'ally_image'&#93; = $ally&#91;'ally_image'&#93;;
$lang&#91;'ally_request_notallow_0'&#93; = (($ally&#91;'ally_request_notallow'&#93; == 1) ? ' SELECTED' &#58; '');
$lang&#91;'ally_request_notallow_1'&#93; = (($ally&#91;'ally_request_notallow'&#93; == 0) ? ' SELECTED' &#58; '');
$lang&#91;'ally_owner_range'&#93; = $ally&#91;'ally_owner_range'&#93;;
$lang&#91;'Transfer_alliance'&#93; = MessageForm("Abandonner / Transf&eacute;rer L'alliance", "", "?mode=admin&edit=give", $lang&#91;'Continue'&#93;);
$lang&#91;'Disolve_alliance'&#93; = MessageForm("Dissoudre L'alliance", "", "?mode=admin&edit=exit", $lang&#91;'Continue'&#93;);

$page &#46;= parsetemplate(gettemplate('alliance_admin'), $lang);
display($page, $lang&#91;'Alliance_admin'&#93;);
}

if ($mode == 'admin' && $edit == 'members') { // Administrar a los miembros
/*
  En la administrar a los miembros se pueden establecer los rangos
  para dar los diferentes derechos "Leyes"
*/
// comprobamos el permiso
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_can_kick) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
}

/*
  Kickear usuarios requiere el permiso numero 1
*/
if (isset($kick)) {
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_can_kick) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
}

$u = doquery("SELECT * FROM {{table}} WHERE id='{$kick}' LIMIT 1", 'users', true);
// kickeamos!
if ($u&#91;'ally_id'&#93; == $ally&#91;'id'&#93; && $u&#91;'id'&#93; != $ally&#91;'ally_owner'&#93;) {
doquery("UPDATE {{table}} SET `ally_id`='0' WHERE `id`='{$u&#91;'id'&#93;}'", 'users');
}
} elseif (isset($_POST&#91;'newrang'&#93;)) {
$q = doquery("SELECT * FROM {{table}} WHERE id='{$u}' LIMIT 1", 'users', true);

if ((isset($ally_ranks&#91;$_POST&#91;'newrang'&#93;-1&#93;) || $_POST&#91;'newrang'&#93; == 0) && $q&#91;'id'&#93; != $ally&#91;'ally_owner'&#93;) {
doquery("UPDATE {{table}} SET `ally_rank_id`='" &#46; mysql_escape_string(strip_tags($_POST&#91;'newrang'&#93;)) &#46; "' WHERE `id`='" &#46; intval($id) &#46; "'", 'users');
}
}
// obtenemos las template row
$template = gettemplate('alliance_admin_members_row');
$f_template = gettemplate('alliance_admin_members_function');
// El orden de aparicion
if ($sort2) {
// agregar el =0 para las coordenadas&#46;&#46;&#46;
if ($sort1 == 1) {
$sort = " ORDER BY `username`";
} elseif ($sort1 == 2) {
$sort = " ORDER BY `username`";
} elseif ($sort1 == 3) {
$sort = " ORDER BY `points_planets`";
} elseif ($sort1 == 4) {
$sort = " ORDER BY `ally_register_time`";
} elseif ($sort1 == 5) {
$sort = " ORDER BY `onlinetime`";
} else {
$sort = " ORDER BY `id`";
}

if ($sort2 == 1) {
$sort &#46;= " DESC;";
} elseif ($sort2 == 2) {
$sort &#46;= " ASC;";
}
$listuser = doquery("SELECT * FROM {{table}} WHERE ally_id='{$user&#91;'ally_id'&#93;}'{$sort}", 'users');
} else {
$listuser = doquery("SELECT * FROM {{table}} WHERE ally_id={$user&#91;'ally_id'&#93;}", 'users');
}
// contamos la cantidad de usuarios&#46;
$i = 0;
// Como es costumbre&#46; un row template
$page_list = '';
$lang&#91;'memberzahl'&#93; = mysql_num_rows($listuser);

while ($u = mysql_fetch_array($listuser)) {
$UserPoints = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" &#46; $u&#91;'id'&#93; &#46; "';", 'statpoints', true);
$i++;
$u&#91;'i'&#93; = $i;
// Dias de inactivos
$u&#91;'points'&#93; = "" &#46; pretty_number($UserPoints&#91;'total_points'&#93;) &#46; "";
$days = floor(round(time() - $u&#91;"onlinetime"&#93;) / 3600 % 24);
$u&#91;"onlinetime"&#93; = str_replace("%s", $days, "%s d");
// Nombre de rango
if ($ally&#91;'ally_owner'&#93; == $u&#91;'id'&#93;) {
$ally_range = ($ally&#91;'ally_owner_range'&#93; == '')?$lang&#91;'Founder'&#93;&#58;$ally&#91;'ally_owner_range'&#93;;
} elseif ($u&#91;'ally_rank_id'&#93; == 0 || !isset($ally_ranks&#91;$u&#91;'ally_rank_id'&#93;-1&#93;&#91;'name'&#93;)) {
$ally_range = $lang&#91;'Novate'&#93;;
} else {
$ally_range = $ally_ranks&#91;$u&#91;'ally_rank_id'&#93;-1&#93;&#91;'name'&#93;;
}

/*
  Aca viene la parte jodida&#46;&#46;&#46;
*/
if ($ally&#91;'ally_owner'&#93; == $u&#91;'id'&#93; || $rank == $u&#91;'id'&#93;) {
$u&#91;"functions"&#93; = '';
} elseif ($ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;5&#93; == 1 || $ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$f&#91;'dpath'&#93; = $dpath;
$f&#91;'Expel_user'&#93; = $lang&#91;'Expel_user'&#93;;
$f&#91;'Set_range'&#93; = $lang&#91;'Set_range'&#93;;
$f&#91;'You_are_sure_want_kick_to'&#93; = str_replace("%s", $u&#91;'username'&#93;, $lang&#91;'You_are_sure_want_kick_to'&#93;);
$f&#91;'id'&#93; = $u&#91;'id'&#93;;
$u&#91;"functions"&#93; = parsetemplate($f_template, $f);
} else {
$u&#91;"functions"&#93; = '';
}
$u&#91;"dpath"&#93; = $dpath;
// por el formulario&#46;&#46;&#46;
if ($rank != $u&#91;'id'&#93;) {
$u&#91;'ally_range'&#93; = $ally_range;
} else {
$u&#91;'ally_range'&#93; = '';
}
$u&#91;'ally_register_time'&#93; = date("Y-m-d h&#58;i&#58;s", $u&#91;'ally_register_time'&#93;);
$page_list &#46;= parsetemplate($template, $u);
if ($rank == $u&#91;'id'&#93;) {
$r&#91;'Rank_for'&#93; = str_replace("%s", $u&#91;'username'&#93;, $lang&#91;'Rank_for'&#93;);
$r&#91;'options'&#93; &#46;= "<option value="0">{$lang&#91;'Novate'&#93;}</option>";

foreach($ally_ranks as $a => $b) {
$r&#91;'options'&#93; &#46;= "<option value="" &#46; ($a + 1) &#46; """;
if ($u&#91;'ally_rank_id'&#93;-1 == $a) {
$r&#91;'options'&#93; &#46;= ' selected=selected';
}
$r&#91;'options'&#93; &#46;= ">{$b&#91;'name'&#93;}</option>";
}
$r&#91;'id'&#93; = $u&#91;'id'&#93;;
$r&#91;'Save'&#93; = $lang&#91;'Save'&#93;;
$page_list &#46;= parsetemplate(gettemplate('alliance_admin_members_row_edit'), $r);
}
}
// para cambiar el link de ordenar&#46;
if ($sort2 == 1) {
$s = 2;
} elseif ($sort2 == 2) {
$s = 1;
} else {
$s = 1;
}

if ($i != $ally&#91;'ally_members'&#93;) {
doquery("UPDATE {{table}} SET `ally_members`='{$i}' WHERE `id`='{$ally&#91;'id'&#93;}'", 'alliance');
}

$lang&#91;'memberslist'&#93; = $page_list;
$lang&#91;'s'&#93; = $s;
$page &#46;= parsetemplate(gettemplate('alliance_admin_members_table'), $lang);

display($page, $lang&#91;'Members_administrate'&#93;);
// a=9 es para cambiar la etiqueta de la etiqueta&#46;
// a=10 es para cambiarle el nombre de la alianza
}


if ($mode == 'admin' && $edit == 'requests') { // Administrar solicitudes
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_bewerbungen_bearbeiten) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Check_the_requests'&#93;);
}

if ($_POST&#91;'action'&#93; == "Akzeptieren") {
$_POST&#91;'text'&#93; = mysql_escape_string(strip_tags($_POST&#91;'text'&#93;));

$u = doquery("SELECT * FROM {{table}} WHERE id=$show", 'users', true);
// agrega los puntos al unirse el user a la alianza
doquery("UPDATE {{table}} SET
ally_members=ally_members+1
WHERE id='{$ally&#91;'id'&#93;}'", 'alliance');

doquery("UPDATE {{table}} SET
ally_name='{$ally&#91;'ally_name'&#93;}',
ally_request_text='',
ally_request='0',
ally_id='{$ally&#91;'id'&#93;}',
new_message=new_message+1,
mnl_alliance=mnl_alliance+1
WHERE id='{$show}'", 'users');
// Se envia un mensaje avizando&#46;&#46;&#46;

doquery("INSERT INTO {{table}} SET
`message_owner`='{$show}',
`message_sender`='{$user&#91;'id'&#93;}' ,
`message_time`='" &#46; time() &#46; "',
`message_type`='2',
`message_from`='{$ally&#91;'ally_tag'&#93;}',
`message_subject`='&#91;" &#46; $ally&#91;'ally_name'&#93; &#46; "&#93; vous a acceptee!',
`message_text`='Hi!<br>L'Alliance <b>" &#46; $ally&#91;'ally_name'&#93; &#46; "</b> a acceptee votre candidature!<br>Charte&#58;<br>" &#46; $_POST&#91;'text'&#93; &#46; "'", "messages");

header('Location&#58;alliance&#46;php?mode=admin&edit=requests');
die();

} elseif ($_POST&#91;'action'&#93; == "Ablehnen" && $_POST&#91;'action'&#93; != '') {
$_POST&#91;'text'&#93; = mysql_escape_string(strip_tags($_POST&#91;'text'&#93;));

doquery("UPDATE {{table}} SET ally_request_text='',ally_request='0',ally_id='0',new_message=new_message+1, mnl_alliance=mnl_alliance+1 WHERE id='{$show}'", 'users');
// Se envia un mensaje avizando&#46;&#46;&#46;
doquery("INSERT INTO {{table}} SET
`message_owner`='{$show}',
`message_sender`='{$user&#91;'id'&#93;}' ,
`message_time`='" &#46; time() &#46; "',
`message_type`='2',
`message_from`='{$ally&#91;'ally_tag'&#93;}',
`message_subject`='&#91;" &#46; $ally&#91;'ally_name'&#93; &#46; "&#93; vous as refuse!',
`message_text`='Hi!<br>L'Alliance <b>" &#46; $ally&#91;'ally_name'&#93; &#46; "</b> a refusee votre candidature!<br>Begr&uuml;ndung/Text&#58;<br>" &#46; $_POST&#91;'text'&#93; &#46; "'", "messages");

header('Location&#58;alliance&#46;php?mode=admin&edit=requests');
die();
}

$row = gettemplate('alliance_admin_request_row');
$i = 0;
$parse = $lang;
$query = doquery("SELECT id,username,ally_request_text,ally_register_time FROM {{table}} WHERE ally_request='{$ally&#91;'id'&#93;}'", 'users');
while ($r = mysql_fetch_array($query)) {
// recolectamos los datos del que se eligio&#46;
if (isset($show) && $r&#91;'id'&#93; == $show) {
$s&#91;'username'&#93; = $r&#91;'username'&#93;;
$s&#91;'ally_request_text'&#93; = nl2br($r&#91;'ally_request_text'&#93;);
$s&#91;'id'&#93; = $r&#91;'id'&#93;;
}
// la fecha de cuando se envio la solicitud
$r&#91;'time'&#93; = date("Y-m-d h&#58;i&#58;s", $r&#91;'ally_register_time'&#93;);
$parse&#91;'list'&#93; &#46;= parsetemplate($row, $r);
$i++;
}
if ($parse&#91;'list'&#93; == '') {
$parse&#91;'list'&#93; = '<tr><th colspan=2>Es liegen keine Bewerbungen vor</th></tr>';
}
// Con $show
if (isset($show) && $show != 0 && $parse&#91;'list'&#93; != '') {
// Los datos de la solicitud
$s&#91;'Request_from'&#93; = str_replace('%s', $s&#91;'username'&#93;, $lang&#91;'Request_from'&#93;);
// el formulario
$parse&#91;'request'&#93; = parsetemplate(gettemplate('alliance_admin_request_form'), $s);
$parse&#91;'request'&#93; = parsetemplate($parse&#91;'request'&#93;, $lang);
} else {
$parse&#91;'request'&#93; = '';
}

$parse&#91;'ally_tag'&#93; = $ally&#91;'ally_tag'&#93;;
$parse&#91;'Back'&#93; = $lang&#91;'Back'&#93;;

$parse&#91;'There_is_hanging_request'&#93; = str_replace('%n', $i, $lang&#91;'There_is_hanging_request'&#93;);
// $parse&#91;'list'&#93; = $lang&#91;'Return_to_overview'&#93;;
$page = parsetemplate(gettemplate('alliance_admin_request_table'), $parse);
display($page, $lang&#91;'Check_the_requests'&#93;);
}

if ($mode == 'admin' && $edit == 'name') {
// Changer le nom de l'alliance

$ally_ranks = unserialize($ally&#91;'ally_ranks'&#93;);
// comprobamos el permiso
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_admin) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
}

if ($_POST&#91;'newname'&#93;) {
// Y a le nouveau Nom
$ally&#91;'ally_name'&#93; = mysql_escape_string(strip_tags($_POST&#91;'newname'&#93;));
doquery("UPDATE {{table}} SET `ally_name` = '"&#46; $ally&#91;'ally_name'&#93; &#46;"' WHERE `id` = '"&#46; $user&#91;'ally_id'&#93; &#46;"';", 'alliance');
doquery("UPDATE {{table}} SET `ally_name` = '"&#46; $ally&#91;'ally_name'&#93; &#46;"' WHERE `ally_id` = '"&#46; $ally&#91;'id'&#93; &#46;"';", 'users');
}

$parse&#91;'question'&#93;           = str_replace('%s', $ally&#91;'ally_name'&#93;, $lang&#91;'How_you_will_call_the_alliance_in_the_future'&#93;);
$parse&#91;'New_name'&#93;           = $lang&#91;'New_name'&#93;;
$parse&#91;'Change'&#93;             = $lang&#91;'Change'&#93;;
$parse&#91;'name'&#93;               = 'newname';
$parse&#91;'Return_to_overview'&#93; = $lang&#91;'Return_to_overview'&#93;;
$page &#46;= parsetemplate(gettemplate('alliance_admin_rename'), $parse);
display($page, $lang&#91;'Alliance_admin'&#93;);

}

if ($mode == 'admin' && $edit == 'tag') {
// Changer le TAG l'alliance
$ally_ranks = unserialize($ally&#91;'ally_ranks'&#93;);

// Bon si on verifiait les autorisation ?
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_admin) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
}

if ($_POST&#91;'newtag'&#93;) {
// Y a le nouveau TAG
$ally&#91;'ally_tag'&#93; = mysql_escape_string(strip_tags($_POST&#91;'newtag'&#93;));
doquery("UPDATE {{table}} SET `ally_tag` = '"&#46; $ally&#91;'ally_tag'&#93; &#46;"' WHERE `id` = '"&#46; $user&#91;'ally_id'&#93; &#46;"';", 'alliance');
}

$parse&#91;'question'&#93;           = str_replace('%s', $ally&#91;'ally_tag'&#93;, $lang&#91;'How_you_will_call_the_alliance_in_the_future'&#93;);
$parse&#91;'New_name'&#93;           = $lang&#91;'New_name'&#93;;
$parse&#91;'Change'&#93;             = $lang&#91;'Change'&#93;;
$parse&#91;'name'&#93;               = 'newtag';
$parse&#91;'Return_to_overview'&#93; = $lang&#91;'Return_to_overview'&#93;;
$page &#46;= parsetemplate(gettemplate('alliance_admin_rename'), $parse);
display($page, $lang&#91;'Alliance_admin'&#93;);
}

if ($mode == 'admin' && $edit == 'exit') { // disolver una alianza
// obtenemos el array de los rangos
$ally_ranks = unserialize($ally&#91;'ally_ranks'&#93;);
// comprobamos el permiso
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93; && !$user_can_exit_alliance) {
message($lang&#91;'Denied_access'&#93;, $lang&#91;'Members_list'&#93;);
}
/*
  Si bien, se tendria que confirmar, no tengo animos para hacerlo mas detallado&#46;&#46;&#46;
  sorry &#58;(
*/
doquery("DELETE FROM {{table}} WHERE id='{$ally&#91;'id'&#93;}'", "alliance");
header('Location&#58; alliance&#46;php');
exit;
}
{
// Default *falta revisar&#46;&#46;&#46;*
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93;) {
$ally_ranks = unserialize($ally&#91;'ally_ranks'&#93;);
}
// Imagen de la alianza
if ($ally&#91;'ally_ranks'&#93; != '') {
$ally&#91;'ally_ranks'&#93; = "<tr><td colspan=2><img src="{$ally&#91;'ally_image'&#93;}"></td></tr>";
}
// temporalmente&#46;&#46;&#46;
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93;) {
$range = ($ally&#91;'ally_owner_range'&#93; != '')?$lang&#91;'Founder'&#93;&#58;$ally&#91;'ally_owner_range'&#93;;
} elseif ($user&#91;'ally_rank_id'&#93; != 0 && isset($ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'name'&#93;)) {
$range = $ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'name'&#93;;
} else {
$range = $lang&#91;'member'&#93;;
}
// Link de la lista de miembros
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93; || $ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'memberlist'&#93; != 0) {
$lang&#91;'members_list'&#93; = " (<a href="?mode=memberslist">{$lang&#91;'Members_list'&#93;}</a>)";
} else {
$lang&#91;'members_list'&#93; = '';
}
// El link de adminstrar la allianza
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93; || $ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'administrieren'&#93; != 0) {
$lang&#91;'alliance_admin'&#93; = " (<a href="?mode=admin&edit=ally">{$lang&#91;'Alliance_admin'&#93;}</a>)";
} else {
$lang&#91;'alliance_admin'&#93; = '';
}
// El link de enviar correo circular
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93; || $ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'mails'&#93; != 0) {
$lang&#91;'send_circular_mail'&#93; = "<tr><th>{$lang&#91;'Circular_message'&#93;}</th><th><a href="?mode=circular">{$lang&#91;'Send_circular_mail'&#93;}</a></th></tr>";
} else {
$lang&#91;'send_circular_mail'&#93; = '';
}
// El link para ver las solicitudes
$lang&#91;'requests'&#93; = '';
$request = doquery("SELECT id FROM {{table}} WHERE ally_request='{$ally&#91;'id'&#93;}'", 'users');
$request_count = mysql_num_rows($request);
if ($request_count != 0) {
if ($ally&#91;'ally_owner'&#93; == $user&#91;'id'&#93; || $ally_ranks&#91;$user&#91;'ally_rank_id'&#93;-1&#93;&#91;'bewerbungen'&#93; != 0)
$lang&#91;'requests'&#93; = "<tr><th>{$lang&#91;'Requests'&#93;}</th><th><a href="alliance&#46;php?mode=admin&edit=requests">{$request_count} {$lang&#91;'XRequests'&#93;}</a></th></tr>";
}
if ($ally&#91;'ally_owner'&#93; != $user&#91;'id'&#93;) {
$lang&#91;'ally_owner'&#93; &#46;= MessageForm($lang&#91;'Exit_of_this_alliance'&#93;, "", "?mode=exit", $lang&#91;'Continue'&#93;);
} else {
$lang&#91;'ally_owner'&#93; &#46;= '';
}
// La imagen de logotipo
$lang&#91;'ally_image'&#93; = ($ally&#91;'ally_image'&#93; != '')?
"<tr><th colspan=2><img src="{$ally&#91;'ally_image'&#93;}"></td></tr>"&#58;'';
// $ally_image =
$lang&#91;'range'&#93; = $range;
// codigo raro
$patterns&#91;&#93; = "#&#91;fc&#93;(&#91;a-z0-9#&#93;+)&#91;/fc&#93;(&#46;*?)&#91;/f&#93;#Ssi";
$replacements&#91;&#93; = '<font color="1">2</font>';
$patterns&#91;&#93; = '#&#91;img&#93;(&#46;*?)&#91;/img&#93;#Smi';
$replacements&#91;&#93; = '<img src="1" alt="1" style="border&#58;0px;" />';
$patterns&#91;&#93; = "#&#91;fc&#93;(&#91;a-z0-9# &#91;&#93;&#93;+)&#91;/fc&#93;#Ssi";
$replacements&#91;&#93; = '<font color="1">';
$patterns&#91;&#93; = "#&#91;/f&#93;#Ssi";
$replacements&#91;&#93; = '</font>';
$ally&#91;'ally_description'&#93; = preg_replace($patterns, $replacements, $ally&#91;'ally_description'&#93;);
$lang&#91;'ally_description'&#93; = nl2br($ally&#91;'ally_description'&#93;);

$ally&#91;'ally_text'&#93; = preg_replace($patterns, $replacements, $ally&#91;'ally_text'&#93;);
$lang&#91;'ally_text'&#93; = nl2br($ally&#91;'ally_text'&#93;);

$lang&#91;'ally_web'&#93; = $ally&#91;'ally_web'&#93;;
$lang&#91;'ally_tag'&#93; = $ally&#91;'ally_tag'&#93;;
$lang&#91;'ally_members'&#93; = $ally&#91;'ally_members'&#93;;
$lang&#91;'ally_name'&#93; = $ally&#91;'ally_name'&#93;;

$page &#46;= parsetemplate(gettemplate('alliance_frontpage'), $lang);
display($page, $lang&#91;'your_alliance'&#93;);
}
}

?>

Dis moi si ça marche, si tu as un autre message d'erreur.

dimanche 24 mai 2009

combatspace Messages : 125

merci impécable sa marche enfin lol il devait y avoir un bug dans la 0.9b ou j'ia oublié un truc mais vu que je n'ai ps touché.

dimanche 24 mai 2009

Dulac55 Messages : 70

Perso j'ai la 0.9b Et j'ai aucun soucis ....

dimanche 24 mai 2009

Répondre Pour répondre, tu dois d'abord t'inscrire rapidement sur Kommunauty. Rejoins-nous vite !