Votre question

Aide pour modif de page de mon site web

Tags :
  • web
  • Programmation
Dernière réponse : dans Programmation
10 Novembre 2008 02:06:54

Bonjour

Sur mon site jai installer un module permétant la gestion d'un tournoi.

Mais mon problème c'est que sur la page ci-dessous quand on click sur "votre team ici" il envoie vers une autre page alors que moi je ne souhaite pas que les visiteur puise y accéder je voulais savoir si quelqu'un pouvait m'aider pour que le visiteur ne puisse pas cliker decu ??

http://naked-killers.verygames.net/index.php?file=Tourn...

Merci de votre aide :??: 

voila l'index.php de la page:

Citation :
<?php
// -------------------------------------------------------------------------//
// Tournament Module written by L@pinViolent from ArSeNaL (2006) - V1.4 //
// http://www.team-arsenal.com //
// Contact me at lapinviolent@hotmail.fr //
// //
// Edit by Grillon69 from V1.4 to V1.4.1 //
// http://la-team-69.verygames.net //
// -------------------------------------------------------------------------//
// Nuked-KlaN - PHP Portal //
// http://www.nuked-klan.org //
// -------------------------------------------------------------------------//
// This program is free software. you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License. //
// -------------------------------------------------------------------------//
if (!defined("INDEX_CHECK")) {
die ("<center>You cannot open this page directly</center>");
}

global $language, $user;
include("modules/Tournament/lang/".$language.".lang.php");

if(!$user){$visiteur="0";}
else{$visiteur=$user[1];}
$ModName = basename( dirname( __FILE__ ) );

if ($visiteur>=nivo_mod($ModName)){

define("TOURNAMENT_TEAM_TABLE", $nuked['prefix'] . "_tournament_team");
define("TOURNAMENT_INTRO_TABLE", $nuked['prefix'] . "_tournament_intro");
define("TOURNAMENT_MATCH_TABLE", $nuked['prefix'] . "_tournament_match");

compteur(Team);


// -------------------------------------------------------------------------//
// Array of the Tournament's matches //
// -------------------------------------------------------------------------//
function index()
{
global $bgcolor1, $bgcolor2, $bgcolor3, $theme, $nuked, $user;

opentable();

$req = "SELECT intro FROM " . TOURNAMENT_INTRO_TABLE ;
$sql = mysql_query($req);
list($texte) = mysql_fetch_array($sql);
$texte = stripslashes($texte);
$texte = htmlentities($texte);
$texte = BBcode($texte);

if ($smileyoff == 0)
{
$texte = icon($texte);
}

echo" <div style=\"text-align: center;\"><h3>" . _TITLETOURNAMENT . "</h3></div>
<div><br>". $texte . "</div><br><br><br>";

echo" <table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"1\" bordercolor=\"".$bgcolor1."\">
<tr>
<td bgcolor=\"$bgcolor3\" colspan=\"10\" align=\"center\"><big><b>"._TITRETEAMS."</b></big></td></tr>";

$sql = mysql_query("SELECT id, name, picture FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id");

for($i=0;$i<16;$i++)
{
if (list($teamid, $teamname, $teampict) = mysql_fetch_array($sql))
{
if(($teampict == "http://")||($teampict == "")){ $teampict = "images/no_image.gif"; }
echo" <tr><td width=50><img src=\"".$teampict."\" border=\"1\" width=\"50\" height=\"50\"></td>
<td bgcolor=".$bgcolor2." align=center><a href=\"index.php?file=Tournament&op=infoteam&teamid=".$teamid."\"><b>".$teamname."</b></a></td>";
}
else
{
echo" <tr><td width=50><img src=\"images/no_image.gif\" border=\"1\" width=\"50\" height=\"50\"></td>
<td bgcolor=".$bgcolor2." align=center width=20%><a href=\"index.php?file=Tournament&op=addteam\"><b>"._DEFAULTTEAM."</b></a></td>";
}

if($i%2==0)
{
$matchtitle = "_TOURNAMENTEIGHTER".($i+2)/2;
$req = "SELECT id, winner, date FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '".$matchtitle."'";
$sql2 = mysql_query($req);
list($matchid, $matchwinner, $date) = mysql_fetch_array($sql2);

if($matchwinner == 0)
{
$name = _NORESULT;
$picture = "images/no_image.gif";
$title = constant($matchtitle);
}
else
{
$sql2 = mysql_query("SELECT name, picture FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = '".$matchwinner."'");
list($name, $picture) = mysql_fetch_array($sql2);
if(($picture == "http://")||($picture == "")){ $picture = "images/no_image.gif"; }
$title = _MATCHRESULT . constant($matchtitle);
}

echo" <td rowspan=2 width=50><img src=\"".$picture."\" border=\"1\" width=\"50\" height=\"50\" bgcolor=".$bgcolor2."></td>
<td bgcolor=".$bgcolor2." lign=\"center\" rowspan=2 align=center width=20%>
<a href=\"index.php?file=Tournament&op=infomatch&matchid=".$matchid."\">".$title."</a>
<br><br>".$date."<br><br><b>".$name."</b></td>";
}

if($i%4==0)
{
$matchtitle = "_TOURNAMENTQUARTER".($i+4)/4;
$req = "SELECT id, winner, date FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '".$matchtitle."'";
$sql2 = mysql_query($req);
list($matchid, $matchwinner, $date) = mysql_fetch_array($sql2);

if($matchwinner == 0)
{
$name = _NORESULT;
$picture = "images/no_image.gif";
$title = constant($matchtitle);
}
else
{
$sql2 = mysql_query("SELECT name, picture FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = '".$matchwinner."'");
list($name, $picture) = mysql_fetch_array($sql2);
if(($picture == "http://")||($picture == "")){ $picture = "images/no_image.gif"; }
$title = _MATCHRESULT . constant($matchtitle);
}

echo" <td rowspan=4 width=50><img src=\"".$picture."\" border=\"1\" width=\"50\" height=\"50\"></td>
<td bgcolor=".$bgcolor2." lign=\"center\" rowspan=4 align=center width=20%>
<a href=\"index.php?file=Tournament&op=infomatch&matchid=".$matchid."\">".$title."</a>
<br><br>".$date."<br><br><b>".$name."</b></td>";
}

if($i%8==0)
{
$matchtitle = "_TOURNAMENTHALFWIN".($i+8)/8;
$req = "SELECT id, date, winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '".$matchtitle."'";
$sql2 = mysql_query($req);
list($matchid, $date, $matchwinner) = mysql_fetch_array($sql2);

if($matchwinner == 0)
{
$name = _NORESULT;
$picture = "images/no_image.gif";
$title = constant($matchtitle);
}
else
{
$sql2 = mysql_query("SELECT name, picture FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = ".$matchwinner);
list($name, $picture) = mysql_fetch_array($sql2);
if(($picture == "http://")||($picture == "")){ $picture = "images/no_image.gif"; }
$title = _MATCHRESULT . constant($matchtitle);
}

echo" <td rowspan=8 width=50><img src=\"".$picture."\" border=\"1\" width=\"50\" height=\"50\"></td>
<td bgcolor=".$bgcolor2." lign=\"center\" rowspan=8 align=center width=20%>
<a href=\"index.php?file=Tournament&op=infomatch&matchid=".$matchid."\">".$title."</a>
<br><br>".$date."<br><br><b>".$name."</b></td>";
}

if($i%16==0)
{
$matchtitle = "_TOURNAMENTWIN";
$sql2 = mysql_query("SELECT id, winner, date FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '".$matchtitle."'");
list($matchid, $matchwinner, $date) = mysql_fetch_array($sql2);

if($matchwinner == 0)
{
$name = _NORESULT;
$picture = "images/no_image.gif";
$title = constant($matchtitle);
}
else
{
$sql2 = mysql_query("SELECT name, picture FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = '".$matchwinner."'");
list($name, $picture) = mysql_fetch_array($sql2);
if(($picture == "http://")||($picture == "")){ $picture = "images/no_image.gif"; }
$title = _MATCHRESULT . constant($matchtitle);
}

echo" <td rowspan=16 width=50><img src=\"".$picture."\" border=\"1\" width=\"50\" height=\"50\"></td>
<td bgcolor=".$bgcolor2." lign=\"center\" rowspan=16 align=center width=20%>
<a href=\"index.php?file=Tournament&op=infomatch&matchid=".$matchid."\">".$title."</a>
<br><br>".$date."<br><br><b>".$name."</b></td>";
}
echo"</tr>";
}

echo" </table><br><br>";
echo" <center><a href=index.php?file=Tournament><b>"._HAUTPAGE."</b></a></center><br>";

CloseTable();
}


// -------------------------------------------------------------------------//
// Information on a Tournament's match //
// -------------------------------------------------------------------------//
function infomatch($matchid)
{
global $bgcolor2, $bgcolor3, $theme, $nuked, $user;

opentable();

echo" <center><br>";

$req = "SELECT title, winner, date, score1, score2, report, screen1, screen2, screen3, screen4, status1, status2 FROM ".TOURNAMENT_MATCH_TABLE." WHERE id = " . $matchid;
$sql = mysql_query($req);
list($title, $winner, $date, $score1, $score2, $report, $screen1, $screen2, $screen3, $screen4, $status1, $status2) = mysql_fetch_array($sql);

if($screen1 == "http://") { $screen1 = ""; }
if($screen2 == "http://") { $screen2 = ""; }
if($screen3 == "http://") { $screen3 = ""; }
if($screen4 == "http://") { $screen4 = ""; }
if($status1 == "http://") { $status1 = ""; }
if($status2 == "http://") { $status2 = ""; }

echo" <table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\">";

echo" <tr><td bgcolor=\"$bgcolor3\" colspan=\"2\" align=\"center\">
<big><b>" . constant($title) . "</b></big>
</td></tr>";

echo" <tr><td colspan=\"2\" align=center>
<br>" . $date . "<br><br>
</td></tr>";

if(($score1 != 0)||($score2 != 0))
{
echo" <tr><td align=\"right\" valign=\"top\" width=\"15%\"><b>" . _MATCHSCORES . "</b> </td>
<td align=\"left\" valign=\"top\">" .$score1. " - " .$score2. "<br><br></td></tr>";
}

if($report != "")
{
echo" <tr><td align=\"right\" valign=\"top\" width=\"15%\"><b>" . _MATCHREPORT . "</b> </td>
<td align=\"left\" valign=\"top\">" . $report . "<br><br><br></td></tr>";
}

echo"<tr><td colspan=\"2\" align=\"center\">\n";

if($screen1 != "") { echo" <a href=\"".$screen1."\" target=ScreenShot><img src=\"".$screen1."\" width=200></a> \n"; }
if($screen2 != "") { echo" <a href=\"".$screen2."\" target=ScreenShot><img src=\"".$screen2."\" width=200></a><br><br>\n"; }
if($screen3 != "") { echo" <a href=\"".$screen3."\" target=ScreenShot><img src=\"".$screen3."\" width=200></a> \n"; }
if($screen4 != "") { echo" <a href=\"".$screen4."\" target=ScreenShot><img src=\"".$screen4."\" width=200></a><br><br>\n"; }
if($status1 != "") { echo" <a href=\"".$status1."\" target=ScreenShot><img src=\"".$status1."\" width=200></a> \n"; }
if($status2 != "") { echo" <a href=\"".$status2."\" target=ScreenShot><img src=\"".$status2."\" width=200></a><br><br>\n"; }

echo" </td></tr></table><br><br>";
echo" <center><a href=index.php?file=Tournament><b>"._HAUTPAGE."</b></a></center><br>";

CloseTable();
}


// -------------------------------------------------------------------------//
// Register & Edit form for a Tournament's team //
// -------------------------------------------------------------------------//
function addteam($teamid)
{
global $bgcolor2, $bgcolor3, $theme, $nuked, $user;

if (!$user)
{
echo "<br><br><div style=\"text-align: center;\">" . _LOGINTEAM . "</div>" ;
return;
}

if($teamid != 0)
{
$req = "SELECT name, tag, url, picture, leader, leadersteam, leaderid, mail, member1, steam1, member2, steam2, member3, steam3, member4, steam4 FROM ".TOURNAMENT_TEAM_TABLE." WHERE id = " . $teamid;
$sql1 = mysql_query($req);
list($teamname, $teamtag, $teamurl, $teampict, $teamleader, $leadersteam, $leaderid, $teammail, $member[1], $steam[1], $member[2], $steam[2], $member[3], $steam[3], $member[4], $steam[4]) = mysql_fetch_array($sql1);

if($leaderid != $user[0])
{
echo "<br><br><div style=\"text-align: center;\">" . _NOACCESS . "</div>" ;
return;
}
}
else
{
$teamurl = "http://";
$teampict = "http://";
}

$req = "SELECT type FROM ".TOURNAMENT_INTRO_TABLE." WHERE 1";
$sql2 = mysql_query($req);
list($type) = mysql_fetch_array($sql2);

opentable();

echo" <script type=\"text/javascript\">\n"
. "<!--\n"
. "function verifchamps()\n"
. "{"
. "if (document.getElementById('teamname').value.length < 4)"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if (document.getElementById('teamleader').value.length < 4)"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb1').value.length < 4)&&(document.getElementById('type').value > 0))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb2').value.length < 4)&&(document.getElementById('type').value > 1))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb3').value.length < 4)&&(document.getElementById('type').value > 2))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb4').value.length < 4)&&(document.getElementById('type').value > 3))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if (document.getElementById('teammail').value.indexOf('@') == -1)"
. "{ alert('" . _MAILFAILED . "'); return false; }\n"
. "return true;\n"
. "}\n"
. "// -->\n"
. "</script>";

if($teamid != 0)
{
echo"<form method=\"post\" action=\"index.php?file=Tournament&op=updteam\" onsubmit=\"return verifchamps();\">";
}
else
{
echo"<form method=\"post\" action=\"index.php?file=Tournament&op=regteam\" onsubmit=\"return verifchamps();\">";
}

echo" <table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\">
<tr>
<td bgcolor=\"$bgcolor3\" colspan=\"3\" align=\"center\"><big><b>"._TITREFORM."</b></big></td></tr>
<tr><td colspan=\"3\"> </td></tr>";

if($teamid != 0)
{
echo" <tr><td width=\"20%\"> </td>
<td align=\"left\" width=\"30%\">"._TEAMNAME."</td>
<td width=\"50%\">".$teamname."<input type=hidden name=teamid value=".$teamid."></td></tr>";
}
else
{
echo" <tr><td width=\"20%\"> </td>
<td align=\"left\" width=\"30%\">"._TEAMNAME."</td>
<td width=\"50%\"><input type=text size=30 name=teamname></td></tr>";
}

if($type > 0)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMTAG."</td>
<td><input type=text size=10 name=teamtag value=".$teamtag."></td></tr>";
}

echo" <tr><td> </td>
<td align=\"left\">"._TEAMPICT."</td>
<td><input type=text size=50 name=teampict value=".$teampict."></td></tr>";

if($type > 0)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMURL."</td>
<td><input type=text size=50 name=teamurl value=".$teamurl."></td></tr>";
}

echo" <tr><td> </td>
<td align=\"left\">"._TEAMLEADER."</td>
<td><input type=text size=30 name=teamleader value=".$teamleader."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._LEADERSTEAM."</td>
<td><input type=text size=30 name=leadersteam value=".$leadersteam."></td></tr>";

if($teamid != 0)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMMAIL."</td>
<td>".$teammail."</td></tr>";
}
else
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMMAIL."</td>
<td><input type=text size=30 name=teammail></td></tr>";
}

echo" <input type=hidden name=type value=".$type.">";

for($i=0; $i<$type; $i++)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMMB.($i+1)." :</td>
<td><input type=text size=30 name=teammb".($i+1)." value=".$member[($i+1)]."></td></tr>
<tr><td> </td>
<td align=\"left\">"._STEAM.($i+1)." :</td>
<td><input type=text size=30 name=steam".($i+1)." value=".$steam[($i+1)]."></td></tr>";
}

echo" <tr><td colspan=\"3\"> </td></tr>";
echo" <tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" value=\"" . _TEAMREGISTER . "\" /></td></tr>";
echo" </table></form><br><br>";
echo" <center><a href=index.php?file=Tournament>[ <b>"._TOURNAMENTBACK."</b> ]</a></center><br>";

CloseTable();
}


// -------------------------------------------------------------------------//
// Registration or edition of a Tournament's team in database //
// -------------------------------------------------------------------------//
function regteam($teamid, $teamname, $teampict, $teamurl, $teamtag, $teamleader, $leadersteam, $teammail, $teammb1, $steam1, $teammb2, $steam2, $teammb3, $steam3, $teammb4, $steam4)
{
global $nuked, $user;

if (!$user)
{
echo "<br><br><div style=\"text-align: center;\">" . _LOGINTEAM . "</div>" ;
return;
}

opentable();

$user_id = $user[0];
$teamname = htmlentities($teamname, ENT_QUOTES);
$teamtag = htmlentities($teamtag, ENT_QUOTES);
$teamtag = addslashes($teamtag);

if (strlen($teamname) > 30)
{
echo "<br /><br /><div style=\"text-align: center;\">" . _NICKTOLONG . "</div><br /><br />";
redirect("index.php?file=Tournament&op=addteam", 2);
closetable();
footer();
exit();
}

if($teamid != 0)
{
$req = "SELECT leaderid FROM ".TOURNAMENT_TEAM_TABLE." WHERE id = '".$teamid."'";
$sql=mysql_query($req);
list($leaderid) = mysql_fetch_array($sql);

if($leaderid != $user[0])
{
echo "<br><br><div style=\"text-align: center;\">" . _NOACCESS . "</div>" ;
return;
}

$req = "UPDATE " . TOURNAMENT_TEAM_TABLE . " SET url='".$teamurl."', picture='".$teampict."', tag='".$teamtag."', leader='".$teamleader."', steamleader='".$steamleader."', member1='".$teammb1."', steam1='".$steam1."', member2='".$teammb2."', steam2='".$steam2."', member3='".$teammb3."', steam3='".$steam3."', member4='".$teammb4."', steam4='".$steam4."' WHERE id = '" . $teamid . "'";
$upd = mysql_query($req);

echo "<br /><br /><div style=\"text-align: center;\">" . _VALIDEDITSUCCES . "</div><br /><br />";
}
else
{
$req = "SELECT id FROM ".TOURNAMENT_TEAM_TABLE." WHERE name = '".$teamname."'";
$sql=mysql_query($req);
list($teambdd) = mysql_fetch_array($sql);

if($teambdd == $teamname)
{
echo "<br /><br /><div style=\"text-align: center;\">" . _TEAMEXISTS . "</div><br /><br />";
redirect("index.php?file=Tournament", 2);
closetable();
footer();
exit();
}

$add = mysql_query("INSERT INTO " . TOURNAMENT_TEAM_TABLE . " ( `id`, `name`, `url`, `picture`, `tag`, `leader`, `leadersteam`, `leaderid`, `mail`, `member1`, `steam1`, `member2`, `steam2`, `member3`, `steam3`, `member4`, `steam4`) VALUES( '' , '".$teamname."' , '".$teamurl."' , '".$teampict."' , '".$teamtag."' , '".$teamleader."' , '".$leadersteam."' , '".$user_id."', '".$teammail."' , '".$teammb1."' , '".$steam1."' , '".$teammb2."' , '".$steam2."' , '".$teammb3."' , '".$steam3."' , '".$teammb4."' , '".$steam4."' )");

$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE name = '" . $teamname . "'");
list($teamid) = mysql_fetch_array($sql);

$subject = _MAILSUBJECT . $teamname ;
$corps = _TEAMVALID . "\r\n" . $nuked['url'] . "/index.php?file=Tournament&op=validation&teamid=" . $teamid . "\r\n\r\n\r\n" . $nuked['name'] . " - " . $nuked['slogan'];
$from = "From: " . $nuked['name'] . " <" . $nuked['mail'] . ">\r\nReply-To: " . $nuked['mail'];

$subject = @html_entity_decode($subject);
$corps = @html_entity_decode($corps);
$from = @html_entity_decode($from);

email($teammail, $subject, $corps, $from);

echo "<br /><br /><div style=\"text-align: center;\">" . _VALIDMAILSUCCES . " " . $teammail . "</div><br /><br />";
}

closeTable();
redirect("index.php?file=Tournament", 5);
}


// -------------------------------------------------------------------------//
// Validate the registration of a Tournament's team //
// -------------------------------------------------------------------------//
function validation($teamid)
{
global $nuked, $user;

if (!$user)
{
echo "<br><br><div style=\"text-align: center;\">" . _LOGINTEAM . "</div>" ;
return;
}

opentable();

$sql = "UPDATE " . TOURNAMENT_TEAM_TABLE . " SET validated = 1 WHERE id = ".$teamid;
$add = mysql_query($sql);

echo "<br /><br /><div style=\"text-align: center;\">" . _VALIDTEAM . "</div><br /><br />" ;
closeTable();
redirect("index.php?file=Tournament", 5);
}


// -------------------------------------------------------------------------//
// Display the information on a Tournament's team //
// -------------------------------------------------------------------------//
function infoteam($teamid)
{
global $bgcolor2, $bgcolor3, $theme, $nuked, $user;

opentable();

echo" <center><br>";

$req = "SELECT name, tag, url, picture, leader, leadersteam, leaderid, member1, steam1, member2, steam2, member3, steam3, member4, steam4 FROM ".TOURNAMENT_TEAM_TABLE." WHERE id = " . $teamid;
$sql1 = mysql_query($req);
list($teamname, $teamtag, $teamurl, $teampict, $teamleader, $leadersteam, $leaderid, $member[1], $steam[1], $member[2], $steam[2], $member[3], $steam[3], $member[4], $steam[4]) = mysql_fetch_array($sql1);

$req = "SELECT type FROM ".TOURNAMENT_INTRO_TABLE." WHERE 1";
$sql2 = mysql_query($req);
list($type) = mysql_fetch_array($sql2);

if(($teampict == "http://")||($teampict == ""))
{
$teampict = "images/no_image.gif";
}

echo" <table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\">
<tr><td bgcolor=\"$bgcolor3\" colspan=\"3\" align=\"center\"><big><b>" . _INFOTEAM . $teamname . "</b></big></td></tr>
<tr><td width=100><img src=\"" . $teampict . "\" width=100 height=100></td>
<td align=center>" . _INFOTEAM . $teamname . "<br><br>";

if($teamurl != "http://")
{
echo" <a href=\"" . $teamurl . "\">" . _INFOSITE . "</a><br><br>";
}

if($user)
{
if($leaderid == $user[0])
{
echo" <a href=\"index.php?file=Tournament&op=editteam&teamid=".$teamid."\">" . _EDITTEAM . "</a>";
}
}

echo" </td><td align=left>". $teamtag . " " . $teamleader . "<br>";

for($i=0; $i<$type; $i++)
{
echo $teamtag . " " . $member[($i+1)] . "<br>";
}

echo" </td></tr></table><br><br>";
echo" <center><a href=index.php?file=Tournament><b>"._HAUTPAGE."</b></a></center><br>";

CloseTable();
}


// -------------------------------------------------------------------------//
// Functions' Switch //
// -------------------------------------------------------------------------//
switch($op)
{
case"index":
index();
break;

case"addteam":
addteam(0);
break;

case"editteam":
addteam($teamid);
break;

case"regteam":
regteam(0, $teamname, $teampict, $teamurl, $teamtag, $teamleader, $leadersteam, $teammail, $teammb1, $steam1, $teammb2, $steam2, $teammb3, $steam3, $teammb4, $steam4);
break;

case"updteam":
regteam($teamid, $teamname, $teampict, $teamurl, $teamtag, $teamleader, $leadersteam, $teammail, $teammb1, $steam1, $teammb2, $steam2, $teammb3, $steam3, $teammb4, $steam4);
break;

case"validation":
validation($teamid);
break;

case"infoteam":
infoteam($teamid);
break;

case"infomatch":
infomatch($matchid);
break;

default:
index();

}

}else{opentable();echo"<br><br><center>"._NOENTRANCE."<br><br><a href=\"javascript:history.back()\"><b>"._BACK."</b></a><br><br></center>";closetable();}

?>

Autres pages sur : aide modif page site web

10 Novembre 2008 18:31:44

Personne a la réponse ?? :( 
10 Novembre 2008 20:02:19

Perso ca me marque "Vous devez vous identifier avant de pouvoir inscrire votre team." quand j'essaye de cliquer sur ta page.
Contenus similaires
10 Novembre 2008 21:05:00

ui normal , mes après t'ètre indentifier tu pourra y accéder et sa je ne veux pas moi si quelqu'un pouvais maider
17 Novembre 2008 00:10:41

personne n'est dans la capasité de me dire ??


Je vous mes l' admin.php ou cas ou sa peut servir:


Citation :
<?php
// -------------------------------------------------------------------------//
// Tournament Module written by L@pinViolent from ArSeNaL (2006) - V1.4 //
// http://www.team-arsenal.com //
// Contact me at lapinviolent@hotmail.fr //
// //
// Edit by Grillon69 from V1.4 to V1.4.1 //
// http://la-team-69.verygames.net //
// -------------------------------------------------------------------------//
// Nuked-KlaN - PHP Portal //
// http://www.nuked-klan.org //
// -------------------------------------------------------------------------//
// This program is free software. you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License. //
// -------------------------------------------------------------------------//
if (!defined("INDEX_CHECK"))
{
die ("<div style=\"text-align: center;\">You cannot open this page directly</div>");
}

global $user, $language, $rep_img;
translate("modules/Tournament/lang/" . $language . ".lang.php");

if (!$user)
{
$visiteur = 0;
}
else
{
$visiteur = $user[1];
}
$ModName = basename(dirname(__FILE__));
$level_admin = admin_mod($ModName);
if ($visiteur >= $level_admin && $level_admin > -1)
{
define("TOURNAMENT_TEAM_TABLE", $nuked['prefix'] . "_tournament_team");
define("TOURNAMENT_INTRO_TABLE", $nuked['prefix'] . "_tournament_intro");
define("TOURNAMENT_MATCH_TABLE", $nuked['prefix'] . "_tournament_match");

$rep_img = "upload/Tournament/";

// -------------------------------------------------------------------------//
// List of the Tournament's matches //
// -------------------------------------------------------------------------//
function main()
{
global $nuked, $language, $bgcolor1, $bgcolor2, $bgcolor3;

echo "<a href=\"#\" onclick=\"javascript:window.open('help/" . $language . "/Tournament.html','Help','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=350,height=300');return(false)\">\n"
. "<img style=\"border: 0;\" src=\"help/help.gif\" alt=\"\" title=\"" . _HELP . "\" /></a><div style=\"text-align: center;\"><h3>" . _ADMINTOURNAMENT . "</h3></div>\n"
. "<div style=\"text-align: center;\">" . _MATCHES . "<b> | "
. "<a href=\"index.php?file=Tournament&page=admin&op=main_team\">" . _TEAMS . "</a> | "
. "<a href=\"index.php?file=Tournament&page=admin&op=main_pref\">" . _TOURNAMENTPREFS . "</a></b></div><br />\n";

echo "<table style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">\n"
. "<tr style=\"background: " . $bgcolor3 . ";\">\n"
. "<td style=\"width: 30%;\" align=\"center\"><b>" . _MATCHTITLE . "</b></td>\n"
. "<td style=\"width: 30%;\" align=\"center\"><b>" . _TOURNAMENTDATE . "</b></td>\n"
. "<td style=\"width: 30%;\" align=\"center\"><b>" . _WINNER . "</b></td>\n"
. "<td style=\"width: 10%;\" align=\"center\"><b>" . _MATCHEDIT . "</b></td></tr>\n";

$bgcolor = $bgcolor2;
$sql = mysql_query("SELECT id, title, date, winner FROM " . TOURNAMENT_MATCH_TABLE );
while(list($matchid, $title, $date, $winner) = mysql_fetch_row($sql))
{
if($winner == 0)
{
$windispl = _TOPLAY;
}
else
{
$sql2 = mysql_query("SELECT name FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = " . $winner);
list($name) = mysql_fetch_row($sql2);
$windispl = $name;
}

echo" <tr style=\"background: " . $bgcolor . ";\">
<td><a href=\"index.php?file=Tournament&page=admin&op=edit_match&matchid=".$matchid."\">" . constant($title) . "</a></td>\n
<td align=\"center\">" . $date . "</td>\n
<td align=\"center\">" . $windispl . "</td>\n
<td align=\"center\"><a href=\"index.php?file=Tournament&page=admin&op=edit_match&matchid=".$matchid."\"><img src=\"images/edit.gif\" border=\"0\"></<a></td></tr>\n";

if($bgcolor == $bgcolor1) { $bgcolor = $bgcolor2; } else { $bgcolor = $bgcolor1; }
}

echo "</table>\n";
echo "<br /><div style=\"text-align: center;\">[ <a href=\"index.php?file=Admin\"><b>" . _TOURNAMENTBACK . "</b></a> ]</div><br />";
}


// -------------------------------------------------------------------------//
// List of the Tournament's teams //
// -------------------------------------------------------------------------//
function main_team()
{
global $nuked, $language, $bgcolor1, $bgcolor2, $bgcolor3;

echo"<script type=\"text/javascript\">\n"
."<!--\n"
."\n"
. "function del_team(name, id)\n"
. "{\n"
. "if (confirm('" . _DELETETEAM . " '+name+' ! " . _TOURNAMENTCONFIRM . "'))\n"
. "{document.location.href = 'index.php?file=Tournament&page=admin&op=do_removeteam&teamid='+id;}\n"
. "}\n"
. "\n"
. "// -->\n"
. "</script>\n";

echo "<a href=\"#\" onclick=\"javascript:window.open('help/" . $language . "/Tournament.html','Help','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=350,height=300');return(false)\">\n"
. "<img style=\"border: 0;\" src=\"help/help.gif\" alt=\"\" title=\"" . _HELP . "\" /></a><div style=\"text-align: center;\"><h3>" . _ADMINTOURNAMENT . "</h3></div>\n"
. "<div style=\"text-align: center;\"><b><a href=\"index.php?file=Tournament&page=admin\">" . _MATCHES . "</a> | </b>"
. _TEAMS . "<b> | "
. "<a href=\"index.php?file=Tournament&page=admin&op=main_pref\">" . _TOURNAMENTPREFS . "</a></b></div><br />\n";

echo "<table style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">\n"
. "<tr style=\"background: " . $bgcolor3 . ";\">\n"
. "<td style=\"width: 20%;\" align=\"center\"><b>" . _TEAMS . "</b></td>\n"
. "<td style=\"width: 15%;\" align=\"center\"><b>" . _LEADER . "</b></td>\n"
. "<td style=\"width: 20%;\" align=\"center\"><b>" . _MAIL . "</b></td>\n"
. "<td style=\"width: 15%;\" align=\"center\"><b>" . _INSCRIPTION . "</b></td>\n"
. "<td style=\"width: 10%;\" align=\"center\"><b>" . _MATCHEDIT . "</b></td>\n"
. "<td style=\"width: 10%;\" align=\"center\"><b>" . _TEAMDEL . "</b></td></tr>\n";

$bgcolor = $bgcolor2;
$sql = mysql_query("SELECT id, name, leader, mail, validated FROM " . TOURNAMENT_TEAM_TABLE );
while(list($id, $name, $leader, $mail, $validated) = mysql_fetch_row($sql))
{
echo" <tr style=\"background: " . $bgcolor . ";\">
<td>" . $name . "</td>\n
<td align=\"center\">" . $leader . "</td>\n
<td align=\"center\">" . $mail . "</td>\n";

if($validated == 1)
{
echo" <td align=\"center\">" . _CONFIRMED . "</td>\n";
}
else
{
echo" <td align=\"center\">" . _TOBECONFIRMED . "</td>\n";
}

echo" <td align=\"center\"><a href=\"index.php?file=Tournament&page=admin&op=edit_team&teamid=".$id."\"><img src=\"images/edit.gif\" border=\"0\"></a></td>\n";
echo" <td align=\"center\"><a href=\"javascript:D el_team('".$name."', '".$id."');\"><img src=\"images/del.gif\" border=\"0\"></a></td></tr>\n";

if($bgcolor == $bgcolor1) { $bgcolor = $bgcolor2; } else { $bgcolor = $bgcolor1; }
}

echo "</table>\n";
echo "<br /><div style=\"text-align: center;\">[ <a href=\"index.php?file=Admin\"><b>" . _TOURNAMENTBACK . "</b></a> ]</div><br />";
}


// -------------------------------------------------------------------------//
// Remove a team //
// -------------------------------------------------------------------------//
function do_removeteam($teamid)
{
global $nuked;

$upd = mysql_query("DELETE FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = " . $teamid);
echo "<br /><br /><div style=\"text-align: center;\">" . _TEAMREMOVED . "</div><br /><br />";
redirect("index.php?file=Tournament&page=admin&op=main_team", 2);
}


// -------------------------------------------------------------------------//
// Modify Tournament's preferences //
// -------------------------------------------------------------------------//
function main_pref()
{
global $nuked, $language, $bgcolor1, $bgcolor2, $bgcolor3;

echo"<script type=\"text/javascript\">\n"
. "<!--\n"
. "\n"
. "function preview(){\n"
. "\n"
. "ns4 = (document.layers) ? true : false;\n"
. "ie4 = (document.all) ? true : false;\n"
. "\n"
. "var bbcodeoff=0;\n"
. "var smileyoff=0;\n"
. "var texte=document.getElementById('intro_texte').value;\n"
. "texte = texte.replace(/\\\/g,'\\\\\\\');\n"
. "texte1 = texte.replace(/\+/g,'_PLUS_');\n"
. "var text1 = escape(texte1);\n"
. "\n"
. "if(ie4)\n"
. "{\n"
. "var text2 = text1.replace(/\\r/g,'<br />');\n"
. "}\n"
. "else\n"
. "{\n"
. "var text2 = text1.replace(/\\n/g,'<br />');\n"
. "}\n"
. "\n"
. "var titre=\"\";\n"
. "\n"
. "window.open('index.php?file=Tournament&nuked_nude=admin&op=preview&texte='+ text2 +'&bbcodeoff='+ bbcodeoff +'&smileyoff='+ smileyoff,'preview','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=550,height=300,top=30,left=0');\n"
. "return(false)\n"
. "}\n"
. "\n"
. "// -->\n"
. "</script>\n";

echo "<a href=\"#\" onclick=\"javascript:window.open('help/" . $language . "/Tournament.html','Help','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=350,height=300');return(false)\">\n"
. "<img style=\"border: 0;\" src=\"help/help.gif\" alt=\"\" title=\"" . _HELP . "\" /></a><div style=\"text-align: center;\"><h3>" . _ADMINTOURNAMENT . "</h3></div>\n"
. "<div style=\"text-align: center;\"><b><a href=\"index.php?file=Tournament&page=admin\">" . _MATCHES . "</a> | "
. "<a href=\"index.php?file=Tournament&page=admin&op=main_team\">" . _TEAMS . "</a> | "
. "</b>" . _TOURNAMENTPREFS . "</div><br>\n"
. "<form method=\"post\" action=\"index.php?file=Tournament&page=admin&op=do_edit\" onsubmit=\"backslash('intro_texte');BBcode_close('intro_texte');\">\n"
. "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n";

$sql = mysql_query("SELECT intro, type FROM " . TOURNAMENT_INTRO_TABLE );
list($intro, $type) = mysql_fetch_row($sql);

echo" <tr><td align=\"left\">"._MATCHTYPE."<SELECT name=type>";

for($i=0; $i<5; $i++)
{
if($type == $i)
{
echo" <OPTION value=".$i." selected>".($i+1)."vs".($i+1)."</OPTION>";
}
else
{
echo" <OPTION value=".$i.">".($i+1)."vs".($i+1)."</OPTION>";
}

}

echo" </select><br><br><br></td></tr>";

$intro = stripslashes($intro);
$texte = BBcode($intro);

if ($smileyoff == 0)
{
$texte = icon($texte);
}

echo "<tr><td align=left>"
. "<table style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"2\">\n"
. "<tr><td>" . $texte . "<br></td></tr></table>"
. "<br><br></td></tr>\n";

echo "<tr><td align=\"center\">\n";

buttonBB("intro_texte");

echo "</td></tr><tr><td align=\"center\">\n";

smiley("intro_texte");

echo" </td></tr>";

echo" <tr><td align=\"center\"><b>" . _TEXT . " :</b><br /><textarea id=\"intro_texte\" name=\"texte\" cols=\"70\" rows=\"15\" onselect=\"storeCaret('intro_texte');\" onclick=\"storeCaret('intro_texte');\" onkeyup=\"storeCaret('intro_texte');\">".$intro."</textarea></td></tr>\n"
. "</table>\n"
. "<div style=\"text-align: center;\"><br /><input type=\"submit\" name=\"Submit\" value=\"" . _EDITINTRO . "\" />"
. " <input type=\"button\" name=\"apercu\" value=\"" . _PREVIEW . "\" onclick=\"preview();\" /></div>\n"
. "<div style=\"text-align: center;\"><br />[ <a href=\"index.php?file=Tournament&page=admin\"><b>" . _TOURNAMENTBACK . "</b></a> ]</div></form><br />\n";
}


// -------------------------------------------------------------------------//
// Edit Tournament's preferences //
// -------------------------------------------------------------------------//
function do_edit($type, $texte)
{
global $nuked;

$texte = addslashes($texte);

$upd = mysql_query("UPDATE " . TOURNAMENT_INTRO_TABLE . " SET intro = '" . $texte . "', type = " . $type);
echo "<br /><br /><div style=\"text-align: center;\">" . _INTROMODIF . "</div><br /><br />";
redirect("index.php?file=Tournament&page=admin", 2);
}


// -------------------------------------------------------------------------//
// Preview Tournament's introduction //
// -------------------------------------------------------------------------//
function preview()
{
global $nuked, $theme, $bgcolor3, $bgcolor2, $texte, $bbcodeoff, $smileyoff;

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
. "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"fr\">\n"
. "<head><title>" . _PREVIEW . "</title>\n"
. "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n"
. "<meta http-equiv=\"content-style-type\" content=\"text/css\" />\n"
. "<link title=\"style\" type=\"text/css\" rel=\"stylesheet\" href=\"themes/" . $theme . "/style.css\" /></head>\n"
. "<body style=\"background: " . $bgcolor2 . ";\">\n";

if ($texte != "")
{
$texte = str_replace("<br />", "\n", $texte);
$texte = str_replace("_PLUS_", "+", $texte);
$texte = stripslashes($texte);

if ($bbcodeoff == 0)
{
$texte = htmlentities($texte);
$texte = BBcode($texte);
}
else
{
$texte = htmlentities($texte, ENT_NOQUOTES);

$texte = eregi_replace("<", "<", $texte);
$texte = eregi_replace(">", ">", $texte);
}

if ($smileyoff == 0)
{
$texte = icon($texte);
}

$texte = str_replace("(--pagebreak--)", _PAGEB, $texte);

echo "<table width=\"100%\" cellspacing=\"3\" cellpadding=\"3\" border=\"0\">\n"
. "<tr><td align=\"left\" style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\">" . $texte . "</td></tr></table>\n";
}
else
{
echo "<div style=\"text-align: center;\"><br /><br /><b>" . _NOTEXTPREVIEW . "</b><br /><br /></div>\n";
}
echo "<div style=\"text-align: center;\"><br /><a href=\"#\" onclick=\"javascript:window.close()\"><b>" . _TOURNAMENTCLOSEWINDOW . "</b></a><br /></div></body></html>";
}


// -------------------------------------------------------------------------//
// Edit Tournament's matches //
// -------------------------------------------------------------------------//
function edit_match($matchid)
{
global $nuked, $language, $bgcolor1, $bgcolor2, $bgcolor3;

echo" <script type=\"text/javascript\">\n"
."<!--\n"
. "function verifchamps()\n"
. "{"
. "return true;\n"
. "}\n"
. "// -->\n"
. "</script>";

echo "<a href=\"#\" onclick=\"javascript:window.open('help/" . $language . "/Tournament.html','Help','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=350,height=300');return(false)\">\n"
. "<img style=\"border: 0;\" src=\"help/help.gif\" alt=\"\" title=\"" . _HELP . "\" /></a><div style=\"text-align: center;\"><h3>" . _ADMINTOURNAMENT . "</h3></div>\n"
. "<div style=\"text-align: center;\">" . _MATCHES . "<b> | "
. "<a href=\"index.php?file=Tournament&page=admin&op=main_team\">" . _TEAMS . "</a> | "
. "<a href=\"index.php?file=Tournament&page=admin&op=main_pref\">" . _TOURNAMENTPREFS . "</a></b></div><br />\n"
. "<form method=\"post\" action=\"index.php?file=Tournament&page=admin&op=do_edit_match&matchid=".$matchid."\" enctype=\"multipart/form-data\" onsubmit=\"return verifchamps();\">\n"
. "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n";

$req = "SELECT title, date, winner, score1, score2, report, screen1, screen2, screen3, screen4, status1, status2 FROM " . TOURNAMENT_MATCH_TABLE . " WHERE id = ". $matchid;
$sql = mysql_query($req);
list($title, $date, $winner, $score1, $score2, $report, $screen1, $screen2, $screen3, $screen4, $status1, $status2) = mysql_fetch_row($sql);

echo" <tr><td> </td>
<td align=\"left\">"._MATCHNAME."</td>
<td>".constant($title)."</td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._MATCHDATE."</td>
<td><input type=text size=20 name=matchdate value=".$date."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._MATCHWINNER."</td>";

if(constant($title) == _TOURNAMENTWIN)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTHALFWIN1'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTHALFWIN2'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTHALFWIN1)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTQUARTER1'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTQUARTER2'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTHALFWIN2)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTQUARTER3'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTQUARTER4'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTQUARTER1)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER1'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER2'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTQUARTER2)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER3'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER4'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTQUARTER3)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER5'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER6'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTQUARTER4)
{
$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER7'";
$sql = mysql_query($req);
list($winner1) = mysql_fetch_row($sql);

$req = "SELECT winner FROM " . TOURNAMENT_MATCH_TABLE . " WHERE title = '_TOURNAMENTEIGHTER8'";
$sql = mysql_query($req);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER1)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 0,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER2)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 4,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER3)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 6,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER4)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 8,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER5)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 10,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER6)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 12,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER7)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 14,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}
else if(constant($title) == _TOURNAMENTEIGHTER8)
{
$sql = mysql_query("SELECT id FROM " . TOURNAMENT_TEAM_TABLE . " WHERE validated = 1 ORDER BY id LIMIT 16,2");
list($winner1) = mysql_fetch_row($sql);
list($winner2) = mysql_fetch_row($sql);
}

echo" <td><select name=matchwinner>";

$selected = FALSE;
if($winner1 != 0)
{
$req = "SELECT name FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = ". $winner1;
$sql = mysql_query($req);
list($name1) = mysql_fetch_row($sql);

if($name1 != "")
{
if($winner1 == $winner)
{
echo" <option value=".$winner1." selected>".$name1."</option>";
$selected = TRUE;
}
else
{
echo" <option value=".$winner1.">".$name1."</option>";
}
}
}

if($winner2 != 0)
{
$req = "SELECT name FROM " . TOURNAMENT_TEAM_TABLE . " WHERE id = ". $winner2;
$sql = mysql_query($req);
list($name2) = mysql_fetch_row($sql);

if($name2 != "")
{
if($winner2 == $winner)
{
echo" <option value=".$winner2." selected>".$name2."</option>";
$selected = TRUE;
}
else
{
echo" <option value=".$winner2.">".$name2."</option>";
}
}
}

if($selected == TRUE)
{
echo" <option value=0>"._TOPLAY."</option>";
}
else
{
echo" <option value=0 selected>"._TOPLAY."</option>";
}

echo" </select></td></tr>";

if(($winner1 != 0)&&($winner2 != 0))
{
echo" <tr><td> </td>
<td align=\"left\">". _MATCHSCORE . $name1 ." :</td>
<td><input type=text size=2 name=matchscore1 value=".$score1."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">". _MATCHSCORE . $name2 ." :</td>
<td><input type=text size=2 name=matchscore2 value=".$score2."></td></tr>";
}
else
{
echo "<input type=hidden name=matchscore1 value=".$score1.">";
echo "<input type=hidden name=matchscore2 value=".$score2.">";
}

if($screen1 == "") $screen1 = "http://";
if($screen2 == "") $screen2 = "http://";
if($screen3 == "") $screen3 = "http://";
if($screen4 == "") $screen4 = "http://";
if($status1 == "") $status1 = "http://";
if($status2 == "") $status2 = "http://";

echo" <tr><td> </td>
<td align=\"left\">"._MATCHSCREEN1."</td>
<td><input type=text size=20 name=matchscreen1 value=".$screen1."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\"> </td>
<td><input type=\"file\" name=\"filename1\" /></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._MATCHSCREEN1."</td>
<td><input type=text size=20 name=matchscreen2 value=".$screen2."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\"> </td>
<td><input type=\"file\" name=\"filename2\" /></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._MATCHSCREEN2."</td>
<td><input type=text size=20 name=matchscreen3 value=".$screen3."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\"> </td>
<td><input type=\"file\" name=\"filename3\" /></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._MATCHSCREEN2."</td>
<td><input type=text size=20 name=matchscreen4 value=".$screen4."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\"> </td>
<td><input type=\"file\" name=\"filename4\" /></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._STATUS1."</td>
<td><input type=text size=20 name=matchstatus1 value=".$status1."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\"> </td>
<td><input type=\"file\" name=\"filename5\" /></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._STATUS2."</td>
<td><input type=text size=20 name=matchstatus2 value=".$status2."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\"> </td>
<td><input type=\"file\" name=\"filename6\" /></td></tr>";

echo" <tr><td> </td>
<td align=\"left\" valign=\"top\">"._MATCHREPORT."</td>
<td><textarea id=\"matchreport\" name=\"matchreport\" cols=\"50\" rows=\"4\">".$report."</textarea></td></tr>";

echo "</table>"
. "<div style=\"text-align: center;\"><br /><input type=\"submit\" name=\"Submit\" value=\"" . _EDITMATCH . "\" /></div>\n"
. "<div style=\"text-align: center;\"><br />[ <a href=\"index.php?file=Tournament&page=admin\"><b>" . _TOURNAMENTBACK . "</b></a> ]</div></form><br />\n";
}


// -------------------------------------------------------------------------//
// Execute match's edition //
// -------------------------------------------------------------------------//
function do_edit_match($id, $date, $winner, $score1, $score2, $report,
$screen1, $screen2, $screen3, $screen4, $status1, $status2,
$filename1, $filename2, $filename3, $filename4)
{
global $nuked, $rep_img;

$screen1 = addslashes($screen1);
$screen2 = addslashes($screen2);
$screen3 = addslashes($screen3);
$screen4 = addslashes($screen4);
$status1 = addslashes($status1);
$status2 = addslashes($status2);

if((($screen1 == "")||($screen1 == "http://"))&&($_FILES['filename1']['name'] != ""))
{
$fichier = $_FILES['filename1']['name'];
$fichier = str_replace(" ", "_", $fichier);
$screen1 = $rep_img . $fichier;

if((!is_file($screen1))&&($_FILES['filename1']['size']<1000000))
{
move_uploaded_file($_FILES['filename1']['tmp_name'], $screen1) or die ("Upload file failed !!!");
@chmod ($screen1, 0644);
}
else
{
$screen1="http://";
}
}

if((($screen2 == "")||($screen2 == "http://"))&&($_FILES['filename2']['name'] != ""))
{
$fichier = $_FILES['filename2']['name'];
$fichier = str_replace(" ", "_", $fichier);
$screen2 = $rep_img . $fichier;

if((!is_file($screen2))&&($_FILES['filename2']['size']<1000000))
{
move_uploaded_file($_FILES['filename2']['tmp_name'], $screen2) or die ("Upload file failed !!!");
@chmod ($screen2, 0644);
}
else
{
$screen2="http://";
}
}

if((($screen3 == "")||($screen3 == "http://"))&&($_FILES['filename3']['name'] != ""))
{
$fichier = $_FILES['filename3']['name'];
$fichier = str_replace(" ", "_", $fichier);
$screen3 = $rep_img . $fichier;

if((!is_file($screen3))&&($_FILES['filename3']['size']<1000000))
{
move_uploaded_file($_FILES['filename3']['tmp_name'], $screen3) or die ("Upload file failed !!!");
@chmod ($screen3, 0644);
}
else
{
$screen3="http://";
}
}

if((($screen4 == "")||($screen4 == "http://"))&&($_FILES['filename4']['name'] != ""))
{
$fichier = $_FILES['filename4']['name'];
$fichier = str_replace(" ", "_", $fichier);
$screen4 = $rep_img . $fichier;

if((!is_file($screen4))&&($_FILES['filename4']['size']<1000000))
{
move_uploaded_file($_FILES['filename4']['tmp_name'], $screen4) or die ("Upload file failed !!!");
@chmod ($screen4, 0644);
}
else
{
$screen4="http://";
}
}

if((($status1 == "")||($status1 == "http://"))&&($_FILES['filename5']['name'] != ""))
{
$fichier = $_FILES['filename5']['name'];
$fichier = str_replace(" ", "_", $fichier);
$screen1 = $rep_img . $fichier;

if((!is_file($status1))&&($_FILES['filename5']['size']<1000000))
{
move_uploaded_file($_FILES['filename5']['tmp_name'], $status1) or die ("Upload file failed !!!");
@chmod ($status1, 0644);
}
else
{
$status1="http://";
}
}

if((($status2 == "")||($status2 == "http://"))&&($_FILES['filename6']['name'] != ""))
{
$fichier = $_FILES['filename6']['name'];
$fichier = str_replace(" ", "_", $fichier);
$screen1 = $rep_img . $fichier;

if((!is_file($status2))&&($_FILES['filename6']['size']<1000000))
{
move_uploaded_file($_FILES['filename6']['tmp_name'], $status2) or die ("Upload file failed !!!");
@chmod ($status2, 0644);
}
else
{
$status2="http://";
}
}

$req = "UPDATE " . TOURNAMENT_MATCH_TABLE . " SET date='".$date."', winner=".$winner.", score1=".$score1.", score2=".$score2.", report='".$report."', screen1='".$screen1."', screen2='".$screen2."', screen3='".$screen3."', screen4='".$screen4."', status1='".$status1."', status2='".$status2."' WHERE id = ". $id;
$upd = mysql_query($req);

echo "<br /><br /><div style=\"text-align: center;\">" . _INTROMODIF . "</div><br /><br />";
redirect("index.php?file=Tournament&page=admin", 2);
}


// -------------------------------------------------------------------------//
// Edit form for a Tournament's team //
// -------------------------------------------------------------------------//
function edit_team($teamid)
{
global $bgcolor2, $bgcolor3, $theme, $nuked, $user;

$req = "SELECT name, tag, url, picture, leader, leadersteam, leaderid, mail, member1, steam1, member2, steam2, member3, steam3, member4, steam4, validated FROM ".TOURNAMENT_TEAM_TABLE." WHERE id = " . $teamid;
$sql1=mysql_query($req);
list($teamname, $teamtag, $teamurl, $teampict, $teamleader, $leadersteam, $leaderid, $teammail, $member[1], $steam[1], $member[2], $steam[2], $member[3], $steam[3], $member[4], $steam[4], $validated) = mysql_fetch_array($sql1);

$req = "SELECT type FROM ".TOURNAMENT_INTRO_TABLE." WHERE 1";
$sql2=mysql_query($req);
list($type) = mysql_fetch_array($sql2);

echo" <script type=\"text/javascript\">\n"
. "<!--\n"
. "function verifchamps()\n"
. "{"
. "if (document.getElementById('teamname').value.length < 4)"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if (document.getElementById('teamleader').value.length < 4)"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb1').value.length < 4)&&(document.getElementById('type').value > 0))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb2').value.length < 4)&&(document.getElementById('type').value > 1))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb3').value.length < 4)&&(document.getElementById('type').value > 2))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if ((document.getElementById('teammb4').value.length < 4)&&(document.getElementById('type').value > 3))"
. "{ alert('" . _4TYPEMIN . "'); return false; }\n"
. "if (document.getElementById('teammail').value.indexOf('@') == -1)"
. "{ alert('" . _MAILFAILED . "'); return false; }\n"
. "return true;\n"
. "}\n"
. "// -->\n"
. "</script>";

echo"<form method=\"post\" action=\"index.php?file=Tournament&page=admin&op=updteam\" onsubmit=\"return verifchamps();\">";

echo" <table width=\"100%\" cellspacing=\"0\" cellpadding=\"1\" border=\"0\">
<tr>
<td bgcolor=\"$bgcolor3\" colspan=\"3\" align=\"center\"><big><b>"._TITREFORM."</b></big></td></tr>
<tr><td colspan=\"3\"> </td></tr>";

echo" <tr><td width=\"20%\"> </td>
<td align=\"left\" width=\"30%\">"._TEAMNAME."</td>
<td width=\"50%\"><input type=text size=30 name=teamname value=\"".$teamname."\">
<input type=hidden name=teamid value=".$teamid."></td></tr>";

if($type != 0)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMTAG."</td>
<td><input type=text size=10 name=teamtag value=".$teamtag."></td></tr>";
}

echo" <tr><td> </td>
<td align=\"left\">"._TEAMPICT."</td>
<td><input type=text size=50 name=teampict value=".$teampict."></td></tr>";

if($type != 0)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMURL."</td>
<td><input type=text size=50 name=teamurl value=".$teamurl."></td></tr>";
}

echo" <tr><td> </td>
<td align=\"left\">"._TEAMLEADER."</td>
<td><input type=text size=30 name=teamleader value=".$teamleader."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._LEADERSTEAM."</td>
<td><input type=text size=30 name=leadersteam value=".$leadersteam."></td></tr>";

echo" <tr><td> </td>
<td align=\"left\">"._TEAMMAIL."</td>
<td><input type=text size=30 name=teammail value=\"".$teammail."\"></td></tr>";

echo" <input type=hidden name=type value=".$type.">";

for($i=0; $i<$type; $i++)
{
echo" <tr><td> </td>
<td align=\"left\">"._TEAMMB.($i+1)." :</td>
<td><input type=text size=30 name=teammb".($i+1)." value=".$member[($i+1)]."></td></tr>
<tr><td> </td>
<td align=\"left\">"._STEAM.($i+1)." :</td>
<td><input type=text size=30 name=steam".($i+1)." value=".$steam[($i+1)]."></td></tr>";
}

if($validated == 0)
{
$nooption = "selected";
$yesoption = "";
}
else
{
$nooption = "";
$yesoption = "selected";
}

echo" <tr><td> </td>
<td align=\"left\">"._VALIDATED."</td>
<td><select name=validated>
<option value=1 ".$yesoption.">"._YES."</option>
<option value=0 ".$nooption.">"._NO."</option>
</td></tr>";

echo" <tr><td colspan=\"3\"> </td></tr>";
echo" <tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" value=\"" . _EDITTEAM . "\" /></td></tr>";
echo" </table></form><br><br>";
echo" <center><a href=index.php?file=Tournament&page=admin>[ <b>"._TOURNAMENTBACK."</b> ]</a></center><br>";
}


// -------------------------------------------------------------------------//
// Edition of a Tournament's team in database //
// -------------------------------------------------------------------------//
function updteam($teamid, $teamname, $teampict, $teamurl, $teamtag, $teamleader, $leaderteam, $teammail,
$teammb1, $steam1, $teammb2, $steam2, $teammb3, $steam3, $teammb4, $steam4, $validated)
{
global $nuked, $user;

$user_id = $user[0];
$teamname = htmlentities($teamname, ENT_QUOTES);
$teamtag = htmlentities($teamtag, ENT_QUOTES);
$teamtag = addslashes($teamtag);

if (strlen($teamname) > 30)
{
echo "<br /><br /><div style=\"text-align: center;\">" . _NICKTOLONG . "</div><br /><br />";
redirect("index.php?file=Tournament&op=addteam", 2);
closetable();
footer();
exit();
}

$req = "UPDATE " . TOURNAMENT_TEAM_TABLE . " SET name='".$teamname."', mail='".$teammail."', url='".$teamurl."', picture='".$teampict."', tag='".$teamtag."', leader='".$teamleader."', leadersteam='".$leadersteam."', member1='".$teammb1."', steam1='".$steam1."', member2='".$teammb2."', steam2='".$steam2."', member3='".$teammb3."', steam3='".$steam3."', member4='".$teammb4."', steam4='".$steam4."', validated=".$validated." WHERE id = '" . $teamid . "'";
$upd = mysql_query($req);

echo "<br /><br /><div style=\"text-align: center;\">" . _VALIDEDITSUCCES . "</div><br /><br />";

redirect("index.php?file=Tournament&page=admin&op=main_team", 5);
}


// -------------------------------------------------------------------------//
// Functions' Switch //
// -------------------------------------------------------------------------//
switch ($op)
{
case "main":
opentable();
main();
closetable();
break;

case "main_pref":
opentable();
main_pref();
closetable();
break;

case "main_team":
opentable();
main_team();
closetable();
break;

case "do_edit":
opentable();
do_edit($type, $texte);
closetable();
break;

case "do_removeteam":
opentable();
do_removeteam($teamid);
closetable();
break;

case "preview":
preview();
break;

case "edit_match":
opentable();
edit_match($matchid);
closetable();
break;

case "do_edit_match":
opentable();
do_edit_match($matchid, $matchdate, $matchwinner, $matchscore1, $matchscore2, $matchreport,
$matchscreen1, $matchscreen2, $matchscreen3, $matchscreen4, $matchstatus1, $matchstatus2,
$filename1, $filename2, $filename3, $filename4);
closetable();
break;

case "edit_team":
opentable();
edit_team($teamid);
closetable();
break;

case "updteam":
opentable();
updteam($teamid, $teamname, $teampict, $teamurl, $teamtag, $teamleader, $leadersteam, $teammail,
$teammb1, $steam1, $teammb2, $steam2, $teammb3, $steam3, $teammb4, $steam4, $validated);
closetable();
break;

default:
opentable();
main();
closetable();
break;
}

}
else if ($level_admin == -1)
{
opentable();
echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _TOURNAMENTBACK . "</b></a></div><br /><br />";
closetable();
}
else if ($visiteur > 1)
{
opentable();
echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _TOURNAMENTBACK . "</b></div></a><br /><br />";
closetable();
}
else
{
opentable();
echo "<br /><br /><div style=\"text-align: center;\">" . _ZONEADMIN . "<br /><br /><a href=\"javascript:history.back()\"><b>" . _TOURNAMENTBACK . "</b></a></div><br /><br />";
closetable();
}

?>

Tom's guide dans le monde
  • Allemagne
  • Italie
  • Irlande
  • Royaume Uni
  • Etats Unis
Suivre Tom's Guide
Inscrivez-vous à la Newsletter
  • ajouter à twitter
  • ajouter à facebook
  • ajouter un flux RSS