Jump to content
php.lv forumi

Palidzat ludzu


hEiti

Recommended Posts

tas pedejais kods nestrada diemzel :(

ar shito esmu ticis tik talu kad rada baltu taisnsturi apaxa kas ir falsh file bet tik un ta negrib piekapties un paradit tas manas bildes ;(

      <td> <td style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" align=\"center\" colspan=\"2\">
    <object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="180" height="60" title="flashs">
    <param name="movie" value="modules/Wars/images/maps/".$map_1.".swf" />
    <param name="quality" value="high" />
    <embed src="modules/Wars/images/maps/".$map_1.".swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="100"></embed>
 </object>

Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Ok, tad sāksim no sākuma.

Tev nepārsē mainīgo. Kaut kas nav.

 

Iesākumā ieliec pliku kodu uz flash. Uz kādu konkrētu failu. Tā, lai darbojas. Piemēram uz de_dust.swf

 

Tad kaut kur ap viņu uztaisi echo 'Karte '.$map_1;

 

Un skaties vai tiek izvadīts kartes nosaukums!

 

Ja izvada, tad iekš flaša parādīšanas koda mapes nosaukuma vietā ieliec ".$map_1.", ja neizvada, tad problēma ir kaut kur citur.

 

Līdz šim tu kodu esi sarakstījis tā, ka to $map_1 php nepārsē. Vajag, lai pārsē!

Link to comment
Share on other sites

       		<object type="application/x-shockwave-flash" data="http://www.tp.lathost.lv/images/mapsf/de_dust.swf" width="450" height="100">
		<param name="movie" value="themes/Mx_evilX/flash/members.swf" />
		<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
		<param name="bgcolor" value="#232323" />
		<param name="menu" value="false" />
		<param name="quality" value="best" />
		<param name="scale" value="exactfit" />
           <embed src="modules/Wars/images/maps/".$map_1.".swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="100"></embed>

 

ja es pareizi izpratu tevi teikto tad man galu gala iznaca kkas lidzigs shim :) bet es ta skatos kad nav pareizi vai vari ludzu savlaicigi palabot mani un varbut tu varu pastities kas tur ar tiem echo utc...

Link to comment
Share on other sites

<td><html>

   		<object type="application/x-shockwave-flash" data="http://www.tp.lathost.lv/images/mapsf/de_dust.swf" width="450" height="100">
		<param name="movie" value="themes/Mx_evilX/flash/members.swf" />
		<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
		<param name="bgcolor" value="#232323" />
		<param name="menu" value="false" />
		<param name="quality" value="best" />
		<param name="scale" value="exactfit" />
</html></td>
 </tr>

 <tr>

 

wtf?

kas tev tie par html tagiem?

Kur noslēdzošais object tags?

Kāpēc dažādi flaš faili norādīti?

 

tev tur konkrēts kišmišs. No normāla koda nav ne miņas!

Link to comment
Share on other sites

Nu labi es isti nesapratu ko tev vajadzeja tapec izlidzos ka varu

<center><table>
 <tr>
   <td><html>
      		<object type="application/x-shockwave-flash" data="http://www.tp.lathost.lv/images/mapsf/de_dust.swf" width="450" height="100">
		<param name="movie" value="images/mapsf/de_dust.swf" />
		<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
		<param name="bgcolor" value="#232323" />
		<param name="menu" value="false" />
		<param name="quality" value="best" />
		<param name="scale" value="exactfit" />
           <embed src="images/mapsf/".$map_1.".swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="100"></embed>
</object>
</html></td>
 </tr>
 <tr>
 </tr>
</table></center>
<?php

// -------------------------------------------------------------------------//
// Nuked-KlaN - PHP Portal                                                  //
// [url="http://www.nuked-klan.org"]http://www.nuked-klan.org[/url]                                                //
// -------------------------------------------------------------------------//
// 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 $nuked, $language, $user;
translate("modules/Wars/lang/" . $language . ".lang.php");

if (!$user)
{
   $visiteur = 0;
} 
else
{
   $visiteur = $user[1];
} 
$ModName = basename(dirname(__FILE__));
$level_access = nivo_mod($ModName);
if ($visiteur >= $level_access && $level_access > -1)
{
   compteur("Wars");

   function index()
   {
       global $bgcolor1, $bgcolor2, $bgcolor3, $nuked, $theme, $language, $tid, $p, $orderby;

       opentable();

       $sql = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1");
       $nb_matchs = mysql_num_rows($sql);

if ($nb_matchs > 0)
       {
           $sql_victory = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND score_team > score_adv");
           $nb_victory = mysql_num_rows($sql_victory);

           $sql_defeat = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND score_adv > score_team");
           $nb_defeat = mysql_num_rows($sql_defeat);

           $nb_nul = $nb_matchs - ($nb_victory + $nb_defeat);
}
else
{
           $nb_victory = 0;
           $nb_defeat = 0;
           $nb_nul = 0;
}

       if ($nb_matchs == 0)
       {
           echo"<br /><div style=\"text-align: center;\"><big><b>" . _MATCHES . " - " . $nuked['name'] . "</b></big></div>\n"
           . "<br /><div style=\"text-align: center;\">" . _NOMATCH . "</div><br />\n";
       }
       else
       {
           $sql2 = mysql_query("SELECT A.titre, B.team FROM " . TEAM_TABLE . " AS A LEFT JOIN " . WARS_TABLE . " AS B ON A.cid = B.team WHERE B.etat = 1 GROUP BY B.team ORDER BY A.ordre, A.titre");
           $nb_team = mysql_num_rows($sql2);

           if (!$tid && $nb_team > 1)
           {
               while (list($team_name, $team) = mysql_fetch_array($sql2))
               {
                   if ($team_name!="")
                   {
                       $team_name = stripslashes($team_name);
                       $team_name = htmlentities($team_name);
                   }
                   else
                   {
                       $team_name = $nuked['name'];
                   }

                   echo "<br /><div style=\"text-align: center;\"><big><b>" . _MATCHES . " - </b></big><a href=\"index.php?file=Wars&tid=" . $team . "\"><b><big>" . $team_name . "</b></big></a></div>\n"
                   . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" cellpadding=\"2\" cellspacing=\"1\">\n"
                   . "<tr style=\"background: ". $bgcolor3 . "\">\n"
                   . "<td style=\"width: 5%;\"> </td>\n"
                   . "<td style=\"width: 10%;\"><b>" . _DATE . "</b></td>"
                   . "<td style=\"width: 30%;\" align=\"center\"><b>" . _OPPONENT . "</b></td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\"><b>" . _TYPE . "</b></td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\"><b>" . _STYLE . "</b></td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\"><b>" . _RESULT . "</b></td>\n"
                   . "<td style=\"width: 10%;\" align=\"center\"><b>" . _DETAILS . "</b></td></tr>\n";

                   $sql6 = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND team = '" . $team . "'");
                   $count = mysql_num_rows($sql6);

                   $sql4 = mysql_query("SELECT warid, adversaire, url_adv, pays_adv, type, style, game, date_jour, date_mois, date_an, score_team, score_adv FROM " . WARS_TABLE . " WHERE etat = 1 AND team = " . $team . " ORDER BY date_an DESC, date_mois DESC, date_jour DESC LIMIT 0, 10");
                   while (list($war_id, $adv_name, $adv_url, $pays_adv, $type, $style, $game, $jour, $mois, $an, $score_team, $score_adv) = mysql_fetch_array($sql4))
                   {
                       $adv_name = stripslashes($adv_name);
                       $type = stripslashes($type);
                       $style = stripslashes($style);

                       $adv_name = htmlentities($adv_name);
                       $type = htmlentities($type);
                       $style = htmlentities($style);

                       list ($pays, $ext) = split ('[.]', $pays_adv);

                       if ($language == "french")
                       {
                           $date = $jour . "/" . $mois . "/" . $an;
                       }
                       else
                       {
                           $date = $mois . "/" . $jour . "/" . $an;
                       }

                       if ($score_team > $score_adv)
                       {
                           $color = "#009900";
                       }
                       else if ($score_team < $score_adv)
                       {
                           $color = "#990000";
                       }
                       else
                       {
                           $color = "#3333FF";
                       }

                       if ($j == 0)
                       {
                           $bg = $bgcolor2;
                           $j++;
                       }
                       else
                       {
                           $bg = $bgcolor1;
                           $j = 0;
                       }

                       $sql5 = mysql_query("SELECT name, icon FROM " . GAMES_TABLE . " WHERE id = '" . $game . "'");
                       list($game_name, $icon) = mysql_fetch_array($sql5);
                       $game_name = stripslashes($game_name);
                       $game_name = htmlentities($game_name);

                       if ($icon != "" && is_file($icon))
                       {
                           $icone = $icon;
                       }
                       else
                       {
                           $icone = "images/games/nk.gif";
                       }

                       echo "<tr style=\"background: ". $bg . "\">\n"
                       . "<td style=\"width: 5%;\"> <img src=\"" . $icone . "\" alt=\"\" title=\"" . $game_name . "\" /></td>\n"
                       . "<td style=\"width: 10%;\">" . $date . "</td>\n"
                       . "<td style=\"width: 30%;\"><img src=\"images/flags/" . $pays_adv . "\" alt=\"\" title=\"" . $pays . "\" /> - ";

                       if ($adv_url != "")
                       {
                           echo "<a href=\"" . $adv_url . "\" onclick=\"window.open(this.href); return false;\">" . $adv_name . "</a>";
                       }
                       else
                       {
                           echo $adv_name;
                       }

                       if (is_file("themes/" . $theme . "/images/report.gif"))
                       {
                           $img = "themes/" . $theme . "/images/report.gif";
                       }
                       else
                       {
                           $img = "modules/Wars/images/report.gif";
                       }

                       echo "</td><td style=\"width: 15%;\" align=\"center\">" . $type . "</td>\n"
                       . "<td style=\"width: 15%;\" align=\"center\">" . $style . "</td>\n"
                       . "<td style=\"background: " . $color . ";width: 15%;\" align=\"center\"><span style=\"color: #FFFFFF;\"><b>" . $score_team . "/" . $score_adv . "</b></span></td>\n"
                       . "<td style=\"width: 10%;\" align=\"center\"><a href=\"index.php?file=Wars&op=detail&war_id=" . $war_id . "\"><img style=\"border: 0;\" src=\"" . $img . "\" alt=\"\" /></a></td></tr>\n";
                   }
                   echo "</table>\n";

                   if ($count > 10)
                   {
                       echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Wars&tid=" . $team . "\">" . _MORE . "</a></div>\n";
                   }
                   $j = 0;
               }
           }
           else
           {
               $nb_wars = $nuked['max_wars'];
               if (!$p) $p = 1;
               $start = $p * $nb_wars - $nb_wars;

               if (!$tid && $team > 0)
               {
                   $tid = $team;
               }

               if ($tid != "")
               {
                   $sql6 = mysql_query("SELECT titre FROM " . TEAM_TABLE . " WHERE cid = '" . $tid . "'");
                   list($team_name, $team) = mysql_fetch_array($sql6);
                   $team_name = stripslashes($team_name);
                   $team_name = htmlentities($team_name);
                   $and = "AND team = '" . $tid . "'";
                   $sql7 = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND team = '" . $tid . "'");
                   $count = mysql_num_rows($sql7);
               }
               else
               {
                   $team_name = $nuked['name'];
                   $and = "";
                   $count = $nb_matchs;
               }

               echo "<br /><div style=\"text-align: center;\"><big><b>" . _MATCHES . " - " . $team_name . "</b></big></div>";

               if (!$orderby)
               {
                   $orderby = "date";
               }

               if ($orderby == "date")
               {
                   $order = "ORDER BY date_an DESC, date_mois DESC, date_jour DESC";
               }
               else if ($orderby == "adver")
               {
                   $order = "ORDER BY adversaire";
               }
               else if ($orderby == "game")
               {
                   $order = "ORDER BY game";
               }
               else if ($orderby == "type")
               {
                   $order = "ORDER BY type";
               }
               else if ($orderby == "style")
               {
                   $order = "ORDER BY style";
               }
               else
               {
                   $order = "ORDER BY date_an DESC, date_mois DESC, date_jour DESC";
               }

               if ($count > 1)
                   {
                       echo "<br /><table width=\"100%\"><tr><td align=\"right\">" . _ORDERBY . " : </b>";
                   }
                   else
                   {
                   if ($orderby == "type")

                       echo"<b>" . _TYPE . "</b> | ";
                   }
                   {
                   echo "<br /><table width=\"100%\"><tr><td align=\"right\">" . _ORDERBY . " : </b>";

                   if ($orderby == "date")
                   {
                       echo "<b>" . _DATE . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=date\">" . _DATE . "</a> | ";
                   }

                   if ($orderby == "adver")
                   {
                       echo "<b>" . _OPPONENT . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=adver\">" . _OPPONENT . "</a> | ";
                   }

                   if ($orderby == "game")
                   {
                       echo "<b>" . _GAME . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=game\">" . _GAME . "</a> | ";
                   }

                   if ($orderby == "type")
                   {
                       echo"<b>" . _TYPE . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=type\">" . _TYPE . "</a> | ";
                   }

                   if ($orderby == "style")
                   {
                       echo "<b>" . _STYLE . "</b>";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=style\">" . _STYLE . "</a>";
                   }
                   echo "</td></tr></table>\n";
               }

               if ($count > $nb_wars)
               {
                   $url_page = "index.php?file=Wars&tid=" . $tid . "&orderby=" . $orderby;
                   number($count, $nb_wars, $url_page);
               }
	echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" cellpadding=\"2\" cellspacing=\"1\">\n"

       . "<tr style=\"background: " . $bgcolor3 . "\">\n"
	. "<td style=\"width: 5%;\"> </td>\n"
	. "<td style=\"width: 10%;\"><b>" . _DATE . "</b></td>"
       		. "<td style=\"width: 10%;\"><b>" . _map . "</b></td>"
	. "<td style=\"width: 30%;\" align=\"center\"><b>" . _OPPONENT . "</b></td>\n"
	. "<td style=\"width: 15%;\" align=\"center\"><b>" . _TYPE . "</b></td>\n"
	. "<td style=\"width: 15%;\" align=\"center\"><b>" . _STYLE . "</b></td>\n"
	. "<td style=\"width: 15%;\" align=\"center\"><b>" . _RESULT . "</b></td>\n"
	. "<td style=\"width: 10%;\" align=\"center\"><b>" . _DETAILS . "</b></td></tr>\n";

               $sql4 = mysql_query("SELECT warid, adversaire, url_adv, pays_adv, type, style, game, date_jour, date_mois, date_an, score_team, score_adv FROM " . WARS_TABLE . " WHERE etat = 1 " . $and . $order . " LIMIT " . $start . "," . $nb_wars);
               while (list($war_id, $adv_name, $adv_url, $pays_adv, $type, $style, $game, $jour, $mois, $an, $score_team, $score_adv) = mysql_fetch_array($sql4))
               {
                   $adv_name = stripslashes($adv_name);
                   $type = stripslashes($type);
                   $style = stripslashes($style);

                   $adv_name = htmlentities($adv_name);
                   $type = htmlentities($type);
                   $style = htmlentities($style);

                   list ($pays, $ext) = split ('[.]', $pays_adv);

                   if ($language == "french")
                   {
                       $date = $jour . "/" . $mois . "/" . $an;
                   }
                   else
                   {
                       $date = $mois . "/" . $jour . "/" . $an;
                   }

                   if ($score_team > $score_adv)
                   {
                       $color = "#009900";
                   }
                   else if ($score_team < $score_adv)
                   {
                       $color = "#990000";
                   }
                   else
                   {
                       $color = "#3333FF";
                   }

                   if ($j == 0)
                   {
                       $bg = $bgcolor2;
                       $j++;
                   }
                   else
                   {
                       $bg = $bgcolor1;
                       $j = 0;
                   }

                   $sql5 = mysql_query("SELECT name, icon FROM " . GAMES_TABLE . " WHERE id = '" . $game . "'");
                   list($game_name, $icon) = mysql_fetch_array($sql5);
                   $game_name = stripslashes($game_name);
                   $game_name = htmlentities($game_name);

                   if ($icon != "" && is_file($icon))
                   {
                       $icone = $icon;
                   }
                   else
                   {
                       $icone = "images/games/nk.gif";
                   }

                   echo "<tr style=\"background: ". $bg . "\">\n"
                   . "<td style=\"width: 5%;\"> <img src=\"" . $icone . "\" alt=\"\" title=\"" . $game_name . "\" /></td>\n"
                   . "<td style=\"width: 10%;\">" . $date . "</td>\n"
                   . "<td style=\"width: 30%;\"><img src=\"images/flags/" . $pays_adv . "\" alt=\"\" title=\"" . $pays . "\" /> - ";

                   if ($adv_url != "")
                   {
                       echo "<a href=\"" . $adv_url . "\" onclick=\"window.open(this.href); return false;\">" . $adv_name . "</a>";
                   }
                   else
                   {
                       echo $adv_name;
                   }

                   if (is_file("themes/" . $theme . "/images/report.gif"))
                   {
                       $img = "themes/" . $theme . "/images/report.gif";
                   }
                   else
                   {
                       $img = "modules/Wars/images/report.gif";
                   }

                   echo "</td><td style=\"width: 15%;\" align=\"center\">" . $type . "</td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\">" . $style . "</td>\n"
                   . "<td style=\"background: " . $color . ";width: 15%;\" align=\"center\"><span style=\"color: #FFFFFF;\"><b>" . $score_team . "/" . $score_adv . "</b></span></td>\n"
                   . "<td style=\"width: 10%;\" align=\"center\"><a href=\"index.php?file=Wars&op=detail&war_id=" . $war_id . "\"><img style=\"border: 0;\" src=\"" . $img . "\" alt=\"\" /></a></td></tr>\n";
                   }
                   echo "</table>\n";

               if ($count > $nb_wars)
               {
                   $url_page = "index.php?file=Wars&tid=" . $tid . "&orderby=" . $orderby;
                   number($count, $nb_wars, $url_page);
               }
           }
       }

       if ($nb_matchs > 0)
       {
    if ($nb_matchs > 1) $war = _MATCHES; else $war = _MATCH;
           echo "<br /><div style=\"text-align: center;\"><small><b>" . $nb_matchs . "</b> " . $war . " : <b><span style=\"color: #009900;\">" . $nb_victory . "</span></b> " . _WIN . " - <b><span style=\"color: #990000;\">" . $nb_defeat . "</span></b> " . _LOST . " - <b><span style=\"color: #3333FF;\">" . $nb_nul . "</span></b> " . _DRAW . "</small></div><br />\n";
       }

       closetable();
   }

   function detail($war_id)
   {
       global $nuked, $user, $visiteur, $language, $bgcolor1, $bgcolor2, $bgcolor3;

       opentable();

       $sql = mysql_query("SELECT team, adversaire, url_adv, pays_adv, date_jour, date_mois, date_an, type, style, score_team, score_adv, map_1, map_2, map_3, report, auteur, url_league FROM " . WARS_TABLE . " WHERE warid = '" . $war_id . "'");
       list($team, $adv_name, $adv_url, $pays_adv, $jour, $mois, $an, $type, $style, $score_team, $score_adv, $map_1, $map_2, $map_3, $report, $auteur, $url_league) = mysql_fetch_array($sql);
       list ($pays, $ext) = split ('[.]', $pays_adv);

       $adv_name = stripslashes($adv_name);
       $report = stripslashes($report);
       $type = stripslashes($type);
       $style = stripslashes($style);
       $map_1 = stripslashes($map_1);
       $map_2 = stripslashes($map_2);
       $map_3 = stripslashes($map_3);

       $adv_name = htmlentities($adv_name);
       $report = htmlentities($report);
       $type = htmlentities($type);
       $style = htmlentities($style);
       $map_1 = htmlentities($map_1);
       $map_2 = htmlentities($map_2);
       $map_3 = htmlentities($map_3);


       if ($language == "french")
       {
           $date = $jour . "/" . $mois . "/" . $an;
       }
       else
       {
           $date = $mois . "/" . $jour. "/" . $an;
       }

       if ($team > 0)
       {
           $sql_team = mysql_query("SELECT titre FROM " . TEAM_TABLE . " WHERE cid = '" . $team . "'");
           list($team_name) = mysql_fetch_array($sql_team);
           $team_name = stripslashes($team_name);
           $team_name = htmlentities($team_name);
       }
       else
       {
           $team_name = $nuked['name'];
       }

       if ($visiteur >= admin_mod("Wars"))
       {
           echo"<script type=\"text/javascript\">\n"
           ."<!--\n"
           ."\n"
           . "function delmatch(adversaire, id)\n"
           . "{\n"
           . "if (confirm('" . _DELETEMATCH . " '+adversaire+' ! " . _CONFIRM . "'))\n"
           . "{document.location.href = 'index.php?file=Wars&page=admin&op=del_war&war_id='+id;}\n"
           . "}\n"
           . "\n"
           . "// -->\n"
           . "</script>\n";

           echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Wars&page=admin&op=match&do=edit&war_id=" . $war_id . "\"><img style=\"border: 0;\" src=\"images/edition.gif\" alt=\"\" title=\"" . _EDIT . "\" /></a>"
           . " <a href=\"java script:delmatch('" . addslashes($adv_name) . "', '" . $war_id . "');\"><img style=\"border: 0;\" src=\"images/delete.gif\" alt=\"\" title=\"" . _DEL . "\" /></a> </div>";
       }

       echo "<br /><table style=\"margin-left: auto;margin-right: auto;text-align: left;background: " . $bgcolor2 . ";\" width=\"90%\" border=\"0\" cellpadding=\"3\" cellspacing=\"3\">\n"
. "<tr><td style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" align=\"center\" colspan=\"2\"><big><b>" . $team_name . "</b> " . _VS . " <b>" . $adv_name . "</b></big></td></tr>\n"
   . "<tr><td style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" align=\"center\" colspan=\"2\">" . $map_1 . "</td></tr>\n"
   . "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _OPPONENT . "</b> : ";
           if ($adv_url != "")
       {
           echo "<a href=\"" . $adv_url . "\" onclick=\"window.open(this.href); return false;\">" . $adv_name . "</a>";
       } 
       else
       {
           echo $adv_name;
       }

       echo " <img src=\"images/flags/" . $pays_adv . "\" alt=\"\" title=\"" . $pays . "\" /></td></tr>\n"
  	. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _DATE . "</b> : " . $date . "</td></tr>\n"
. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _TYPE . "</b> : " . $type . "</td></tr>\n"
. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _STYLE . "</b> : " . $style . "</td></tr>\n"
. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _MAPS . "</b> : " . $map_1;


       if ($map_2 != "")
       {
           echo ", " . $map_2;
       }

       if ($map_3 != "")
       {
           echo ", " . $map_3;
       }

       echo "</td></tr><tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _RESULT . "</b> :";

       if ($score_team < $score_adv)
       {
           echo " <span style=\"color: #990000;\"><b>" . $score_team . "</b></span> - <span style=\"color: #009900;\"><b>" . $score_adv . "</b></span></td></tr>\n";
       } 
       else if ($score_team > $score_adv)
       {
           echo " <span style=\"color: #009900;\"><b>" . $score_team . "</b></span> - <span style=\"color: #990000;\"><b>" . $score_adv . "</b></span></td></tr>\n";
       } 
       else
       {
           echo " <b>" . $score_team . " - " . $score_adv . "</b></td></tr>\n";
       } 

       echo "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\">";

       include ("modules/Comment/index.php");
       com_index("match", $war_id);

       echo "</td></tr><tr style=\"background: " . $bgcolor2 . ";\"><td> </td></tr>\n";


       if ($report != "")
       {
           $report = BBcode($report);
           echo "<tr><td style=\"background: " . $bgcolor2 . ";border: 1px dashed " . $bgcolor3 . ";\"><b>" . _REPORTBY . " <a href=\"index.php?file=Members&op=detail&autor=" . urlencode($auteur) . "\">" . $auteur . "</a> : </b></td></tr>\n"
           . "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\">" . $report;

           if ($url_league != "")
           {
               echo "<br /><br /><a href=\"" . $url_league . "\" onclick=\"window.open(this.href); return false;\"><i>" . _OFFICIALREPORT . "</i></a>";
           } 

           echo "</td></tr><tr style=\"background: " . $bgcolor2 . ";\"><td> </td></tr>\n";
}

       $sql_screen = mysql_query("SELECT url FROM " . JOIN_FILES_TABLE . " WHERE module = 'Wars' AND type = 'screen' AND im_id = '" . $war_id . "'");
       $nb_screen = mysql_num_rows($sql_screen);

       if ($nb_screen > 0)
       {
           echo "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\">";

           while (list($url) = mysql_fetch_array($sql_screen))
           {
               echo " <a href=\"#\" onclick=\"java script:window.open('" . $url . "','screen','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=800,height=600,top=30,left=0');return(false)\">"
               . "<img style=\"border: 1px solid #000000;\" src=\"" . $url . "\" width=\"150\" alt=\"\" /></a>";
           } 
           echo "</td></tr><tr style=\"background: " . $bgcolor2 . ";\"><td> </td></tr>\n";
       } 

       $sql_demo = mysql_query("SELECT url FROM " . JOIN_FILES_TABLE . " WHERE module = 'Wars' AND type = 'demo' AND im_id = '" . $war_id . "'");
       $nb_demo = mysql_num_rows($sql_demo);

       if ($nb_demo > 0)
       {
           $l = 1;
           echo "<tr style=\"background: " . $bgcolor2 . ";\"><td><table align=\"center\">";

           while (list($url) = mysql_fetch_array($sql_demo))
           {
               if ($nb_demo > 1)
               {
                   $demos = $l . "/" . $nb_demo;
               } 
               else
               {
                   $demos = "";
               } 
               $l++;
               echo "<tr><td><img src=\"modules/Wars/images/demo.gif\" alt=\"\" /></td><td><a href=\"" . $url . "\" onclick=\"window.open(this.href); return false;\">" . _DOWNLOADDEMO . " " . $demos . "</a></td></tr>\n";
           } 
           echo "</table></td></tr>\n";
       } 
       echo "</table><br />\n";

       closetable();
   } 

   switch ($op)
   {
       case"index":
           index();
           break;

       case"detail":
           detail($war_id);
           break;

       default:
           index();
           break;
   } 

} 
else if ($level_access == -1)
{
   opentable();
   echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"java script:history.back()\"><b>" . _BACK . "</b></a><br /><br /></div>";
   closetable();
} 
else if ($level_access == 1 && $visiteur == 0)
{
   opentable();
   echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b><br /><br /></div>";
   closetable();
} 
else
{
   opentable();
   echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"java script:history.back()\"><b>" . _BACK . "</b></a><br /><br /></div>";
   closetable();
} 

?>

Edited by hEiti
Link to comment
Share on other sites

LOOOOOLLLLL

pārsmējos! ((:

Tu takš viņu iekš HTML koda vispār esi iebāzis! Kā tad tavuprāt HTML nopārsēs PHP mainīgo???

 

Tā jau mēs te līdz nākamās nedēļas beigām varētu ņemties un neko neizdarīt :D Pēc tam gan arī nekas nemainītos... :D :D :D

 

Gaidi - šas uzmetīšu tev labotu kodu. Bet nu 2 vārdos - tev iekš php no db kartes nosaukums ir jāsavāc ātrāk, kā tu viņu mēģini izvadīt. un ja izvadi, tad pārliecinies, ka pirms viņa ir atverošais php tags un aiz ir aizverošais. tipa <?PHP un ?>

 

Paklau un dod man pilnu kodu! Tev pirms tā <center> dauz kas vēl ir!

Edited by ohmygod
Link to comment
Share on other sites

pirms pec neka vairs nav neaizmirsti kad shis ir engine web un tas ir tikai modulis tas nav pats web !!!!

 

lidz vietia <?php esmu taisijis es pats ;P

 

<center><table>
 <tr>
   <td><html>
      		<object type="application/x-shockwave-flash" data="http://www.tp.lathost.lv/images/mapsf/de_dust.swf" width="450" height="100">
		<param name="movie" value="images/mapsf/de_dust.swf" />
		<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
		<param name="bgcolor" value="#232323" />
		<param name="menu" value="false" />
		<param name="quality" value="best" />
		<param name="scale" value="exactfit" />
           <embed src="images/mapsf/".$map_1.".swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="450" height="100"></embed>
</object>
</html></td>
 </tr>
 <tr>
 </tr>
</table></center>
<?php

// -------------------------------------------------------------------------//
// Nuked-KlaN - PHP Portal                                                  //
// [url="http://www.nuked-klan.org"]http://www.nuked-klan.org[/url]                                                //
// -------------------------------------------------------------------------//
// 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 $nuked, $language, $user;
translate("modules/Wars/lang/" . $language . ".lang.php");

if (!$user)
{
   $visiteur = 0;
} 
else
{
   $visiteur = $user[1];
} 
$ModName = basename(dirname(__FILE__));
$level_access = nivo_mod($ModName);
if ($visiteur >= $level_access && $level_access > -1)
{
   compteur("Wars");

   function index()
   {
       global $bgcolor1, $bgcolor2, $bgcolor3, $nuked, $theme, $language, $tid, $p, $orderby;

       opentable();

       $sql = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1");
       $nb_matchs = mysql_num_rows($sql);

if ($nb_matchs > 0)
       {
           $sql_victory = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND score_team > score_adv");
           $nb_victory = mysql_num_rows($sql_victory);

           $sql_defeat = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND score_adv > score_team");
           $nb_defeat = mysql_num_rows($sql_defeat);

           $nb_nul = $nb_matchs - ($nb_victory + $nb_defeat);
}
else
{
           $nb_victory = 0;
           $nb_defeat = 0;
           $nb_nul = 0;
}

       if ($nb_matchs == 0)
       {
           echo"<br /><div style=\"text-align: center;\"><big><b>" . _MATCHES . " - " . $nuked['name'] . "</b></big></div>\n"
           . "<br /><div style=\"text-align: center;\">" . _NOMATCH . "</div><br />\n";
       }
       else
       {
           $sql2 = mysql_query("SELECT A.titre, B.team FROM " . TEAM_TABLE . " AS A LEFT JOIN " . WARS_TABLE . " AS B ON A.cid = B.team WHERE B.etat = 1 GROUP BY B.team ORDER BY A.ordre, A.titre");
           $nb_team = mysql_num_rows($sql2);

           if (!$tid && $nb_team > 1)
           {
               while (list($team_name, $team) = mysql_fetch_array($sql2))
               {
                   if ($team_name!="")
                   {
                       $team_name = stripslashes($team_name);
                       $team_name = htmlentities($team_name);
                   }
                   else
                   {
                       $team_name = $nuked['name'];
                   }

                   echo "<br /><div style=\"text-align: center;\"><big><b>" . _MATCHES . " - </b></big><a href=\"index.php?file=Wars&tid=" . $team . "\"><b><big>" . $team_name . "</b></big></a></div>\n"
                   . "<table style=\"margin-left: auto;margin-right: auto;text-align: left;background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" cellpadding=\"2\" cellspacing=\"1\">\n"
                   . "<tr style=\"background: ". $bgcolor3 . "\">\n"
                   . "<td style=\"width: 5%;\"> </td>\n"
                   . "<td style=\"width: 10%;\"><b>" . _DATE . "</b></td>"
                   . "<td style=\"width: 30%;\" align=\"center\"><b>" . _OPPONENT . "</b></td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\"><b>" . _TYPE . "</b></td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\"><b>" . _STYLE . "</b></td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\"><b>" . _RESULT . "</b></td>\n"
                   . "<td style=\"width: 10%;\" align=\"center\"><b>" . _DETAILS . "</b></td></tr>\n";

                   $sql6 = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND team = '" . $team . "'");
                   $count = mysql_num_rows($sql6);

                   $sql4 = mysql_query("SELECT warid, adversaire, url_adv, pays_adv, type, style, game, date_jour, date_mois, date_an, score_team, score_adv FROM " . WARS_TABLE . " WHERE etat = 1 AND team = " . $team . " ORDER BY date_an DESC, date_mois DESC, date_jour DESC LIMIT 0, 10");
                   while (list($war_id, $adv_name, $adv_url, $pays_adv, $type, $style, $game, $jour, $mois, $an, $score_team, $score_adv) = mysql_fetch_array($sql4))
                   {
                       $adv_name = stripslashes($adv_name);
                       $type = stripslashes($type);
                       $style = stripslashes($style);

                       $adv_name = htmlentities($adv_name);
                       $type = htmlentities($type);
                       $style = htmlentities($style);

                       list ($pays, $ext) = split ('[.]', $pays_adv);

                       if ($language == "french")
                       {
                           $date = $jour . "/" . $mois . "/" . $an;
                       }
                       else
                       {
                           $date = $mois . "/" . $jour . "/" . $an;
                       }

                       if ($score_team > $score_adv)
                       {
                           $color = "#009900";
                       }
                       else if ($score_team < $score_adv)
                       {
                           $color = "#990000";
                       }
                       else
                       {
                           $color = "#3333FF";
                       }

                       if ($j == 0)
                       {
                           $bg = $bgcolor2;
                           $j++;
                       }
                       else
                       {
                           $bg = $bgcolor1;
                           $j = 0;
                       }

                       $sql5 = mysql_query("SELECT name, icon FROM " . GAMES_TABLE . " WHERE id = '" . $game . "'");
                       list($game_name, $icon) = mysql_fetch_array($sql5);
                       $game_name = stripslashes($game_name);
                       $game_name = htmlentities($game_name);

                       if ($icon != "" && is_file($icon))
                       {
                           $icone = $icon;
                       }
                       else
                       {
                           $icone = "images/games/nk.gif";
                       }

                       echo "<tr style=\"background: ". $bg . "\">\n"
                       . "<td style=\"width: 5%;\"> <img src=\"" . $icone . "\" alt=\"\" title=\"" . $game_name . "\" /></td>\n"
                       . "<td style=\"width: 10%;\">" . $date . "</td>\n"
                       . "<td style=\"width: 30%;\"><img src=\"images/flags/" . $pays_adv . "\" alt=\"\" title=\"" . $pays . "\" /> - ";

                       if ($adv_url != "")
                       {
                           echo "<a href=\"" . $adv_url . "\" onclick=\"window.open(this.href); return false;\">" . $adv_name . "</a>";
                       }
                       else
                       {
                           echo $adv_name;
                       }

                       if (is_file("themes/" . $theme . "/images/report.gif"))
                       {
                           $img = "themes/" . $theme . "/images/report.gif";
                       }
                       else
                       {
                           $img = "modules/Wars/images/report.gif";
                       }

                       echo "</td><td style=\"width: 15%;\" align=\"center\">" . $type . "</td>\n"
                       . "<td style=\"width: 15%;\" align=\"center\">" . $style . "</td>\n"
                       . "<td style=\"background: " . $color . ";width: 15%;\" align=\"center\"><span style=\"color: #FFFFFF;\"><b>" . $score_team . "/" . $score_adv . "</b></span></td>\n"
                       . "<td style=\"width: 10%;\" align=\"center\"><a href=\"index.php?file=Wars&op=detail&war_id=" . $war_id . "\"><img style=\"border: 0;\" src=\"" . $img . "\" alt=\"\" /></a></td></tr>\n";
                   }
                   echo "</table>\n";

                   if ($count > 10)
                   {
                       echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Wars&tid=" . $team . "\">" . _MORE . "</a></div>\n";
                   }
                   $j = 0;
               }
           }
           else
           {
               $nb_wars = $nuked['max_wars'];
               if (!$p) $p = 1;
               $start = $p * $nb_wars - $nb_wars;

               if (!$tid && $team > 0)
               {
                   $tid = $team;
               }

               if ($tid != "")
               {
                   $sql6 = mysql_query("SELECT titre FROM " . TEAM_TABLE . " WHERE cid = '" . $tid . "'");
                   list($team_name, $team) = mysql_fetch_array($sql6);
                   $team_name = stripslashes($team_name);
                   $team_name = htmlentities($team_name);
                   $and = "AND team = '" . $tid . "'";
                   $sql7 = mysql_query("SELECT warid FROM " . WARS_TABLE . " WHERE etat = 1 AND team = '" . $tid . "'");
                   $count = mysql_num_rows($sql7);
               }
               else
               {
                   $team_name = $nuked['name'];
                   $and = "";
                   $count = $nb_matchs;
               }

               echo "<br /><div style=\"text-align: center;\"><big><b>" . _MATCHES . " - " . $team_name . "</b></big></div>";

               if (!$orderby)
               {
                   $orderby = "date";
               }

               if ($orderby == "date")
               {
                   $order = "ORDER BY date_an DESC, date_mois DESC, date_jour DESC";
               }
               else if ($orderby == "adver")
               {
                   $order = "ORDER BY adversaire";
               }
               else if ($orderby == "game")
               {
                   $order = "ORDER BY game";
               }
               else if ($orderby == "type")
               {
                   $order = "ORDER BY type";
               }
               else if ($orderby == "style")
               {
                   $order = "ORDER BY style";
               }
               else
               {
                   $order = "ORDER BY date_an DESC, date_mois DESC, date_jour DESC";
               }

               if ($count > 1)
                   {
                       echo "<br /><table width=\"100%\"><tr><td align=\"right\">" . _ORDERBY . " : </b>";
                   }
                   else
                   {
                   if ($orderby == "type")

                       echo"<b>" . _TYPE . "</b> | ";
                   }
                   {
                   echo "<br /><table width=\"100%\"><tr><td align=\"right\">" . _ORDERBY . " : </b>";

                   if ($orderby == "date")
                   {
                       echo "<b>" . _DATE . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=date\">" . _DATE . "</a> | ";
                   }

                   if ($orderby == "adver")
                   {
                       echo "<b>" . _OPPONENT . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=adver\">" . _OPPONENT . "</a> | ";
                   }

                   if ($orderby == "game")
                   {
                       echo "<b>" . _GAME . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=game\">" . _GAME . "</a> | ";
                   }

                   if ($orderby == "type")
                   {
                       echo"<b>" . _TYPE . "</b> | ";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=type\">" . _TYPE . "</a> | ";
                   }

                   if ($orderby == "style")
                   {
                       echo "<b>" . _STYLE . "</b>";
                   }
                   else
                   {
                       echo "<a href=\"index.php?file=Wars&tid=" . $tid . "&orderby=style\">" . _STYLE . "</a>";
                   }
                   echo "</td></tr></table>\n";
               }

               if ($count > $nb_wars)
               {
                   $url_page = "index.php?file=Wars&tid=" . $tid . "&orderby=" . $orderby;
                   number($count, $nb_wars, $url_page);
               }
	echo "<table style=\"margin-left: auto;margin-right: auto;text-align: left;background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" width=\"100%\" cellpadding=\"2\" cellspacing=\"1\">\n"

       . "<tr style=\"background: " . $bgcolor3 . "\">\n"
	. "<td style=\"width: 5%;\"> </td>\n"
	. "<td style=\"width: 10%;\"><b>" . _DATE . "</b></td>"
       		. "<td style=\"width: 10%;\"><b>" . _map . "</b></td>"
	. "<td style=\"width: 30%;\" align=\"center\"><b>" . _OPPONENT . "</b></td>\n"
	. "<td style=\"width: 15%;\" align=\"center\"><b>" . _TYPE . "</b></td>\n"
	. "<td style=\"width: 15%;\" align=\"center\"><b>" . _STYLE . "</b></td>\n"
	. "<td style=\"width: 15%;\" align=\"center\"><b>" . _RESULT . "</b></td>\n"
	. "<td style=\"width: 10%;\" align=\"center\"><b>" . _DETAILS . "</b></td></tr>\n";

               $sql4 = mysql_query("SELECT warid, adversaire, url_adv, pays_adv, type, style, game, date_jour, date_mois, date_an, score_team, score_adv FROM " . WARS_TABLE . " WHERE etat = 1 " . $and . $order . " LIMIT " . $start . "," . $nb_wars);
               while (list($war_id, $adv_name, $adv_url, $pays_adv, $type, $style, $game, $jour, $mois, $an, $score_team, $score_adv) = mysql_fetch_array($sql4))
               {
                   $adv_name = stripslashes($adv_name);
                   $type = stripslashes($type);
                   $style = stripslashes($style);

                   $adv_name = htmlentities($adv_name);
                   $type = htmlentities($type);
                   $style = htmlentities($style);

                   list ($pays, $ext) = split ('[.]', $pays_adv);

                   if ($language == "french")
                   {
                       $date = $jour . "/" . $mois . "/" . $an;
                   }
                   else
                   {
                       $date = $mois . "/" . $jour . "/" . $an;
                   }

                   if ($score_team > $score_adv)
                   {
                       $color = "#009900";
                   }
                   else if ($score_team < $score_adv)
                   {
                       $color = "#990000";
                   }
                   else
                   {
                       $color = "#3333FF";
                   }

                   if ($j == 0)
                   {
                       $bg = $bgcolor2;
                       $j++;
                   }
                   else
                   {
                       $bg = $bgcolor1;
                       $j = 0;
                   }

                   $sql5 = mysql_query("SELECT name, icon FROM " . GAMES_TABLE . " WHERE id = '" . $game . "'");
                   list($game_name, $icon) = mysql_fetch_array($sql5);
                   $game_name = stripslashes($game_name);
                   $game_name = htmlentities($game_name);

                   if ($icon != "" && is_file($icon))
                   {
                       $icone = $icon;
                   }
                   else
                   {
                       $icone = "images/games/nk.gif";
                   }

                   echo "<tr style=\"background: ". $bg . "\">\n"
                   . "<td style=\"width: 5%;\"> <img src=\"" . $icone . "\" alt=\"\" title=\"" . $game_name . "\" /></td>\n"
                   . "<td style=\"width: 10%;\">" . $date . "</td>\n"
                   . "<td style=\"width: 30%;\"><img src=\"images/flags/" . $pays_adv . "\" alt=\"\" title=\"" . $pays . "\" /> - ";

                   if ($adv_url != "")
                   {
                       echo "<a href=\"" . $adv_url . "\" onclick=\"window.open(this.href); return false;\">" . $adv_name . "</a>";
                   }
                   else
                   {
                       echo $adv_name;
                   }

                   if (is_file("themes/" . $theme . "/images/report.gif"))
                   {
                       $img = "themes/" . $theme . "/images/report.gif";
                   }
                   else
                   {
                       $img = "modules/Wars/images/report.gif";
                   }

                   echo "</td><td style=\"width: 15%;\" align=\"center\">" . $type . "</td>\n"
                   . "<td style=\"width: 15%;\" align=\"center\">" . $style . "</td>\n"
                   . "<td style=\"background: " . $color . ";width: 15%;\" align=\"center\"><span style=\"color: #FFFFFF;\"><b>" . $score_team . "/" . $score_adv . "</b></span></td>\n"
                   . "<td style=\"width: 10%;\" align=\"center\"><a href=\"index.php?file=Wars&op=detail&war_id=" . $war_id . "\"><img style=\"border: 0;\" src=\"" . $img . "\" alt=\"\" /></a></td></tr>\n";
                   }
                   echo "</table>\n";

               if ($count > $nb_wars)
               {
                   $url_page = "index.php?file=Wars&tid=" . $tid . "&orderby=" . $orderby;
                   number($count, $nb_wars, $url_page);
               }
           }
       }

       if ($nb_matchs > 0)
       {
    if ($nb_matchs > 1) $war = _MATCHES; else $war = _MATCH;
           echo "<br /><div style=\"text-align: center;\"><small><b>" . $nb_matchs . "</b> " . $war . " : <b><span style=\"color: #009900;\">" . $nb_victory . "</span></b> " . _WIN . " - <b><span style=\"color: #990000;\">" . $nb_defeat . "</span></b> " . _LOST . " - <b><span style=\"color: #3333FF;\">" . $nb_nul . "</span></b> " . _DRAW . "</small></div><br />\n";
       }

       closetable();
   }

   function detail($war_id)
   {
       global $nuked, $user, $visiteur, $language, $bgcolor1, $bgcolor2, $bgcolor3;

       opentable();

       $sql = mysql_query("SELECT team, adversaire, url_adv, pays_adv, date_jour, date_mois, date_an, type, style, score_team, score_adv, map_1, map_2, map_3, report, auteur, url_league FROM " . WARS_TABLE . " WHERE warid = '" . $war_id . "'");
       list($team, $adv_name, $adv_url, $pays_adv, $jour, $mois, $an, $type, $style, $score_team, $score_adv, $map_1, $map_2, $map_3, $report, $auteur, $url_league) = mysql_fetch_array($sql);
       list ($pays, $ext) = split ('[.]', $pays_adv);

       $adv_name = stripslashes($adv_name);
       $report = stripslashes($report);
       $type = stripslashes($type);
       $style = stripslashes($style);
       $map_1 = stripslashes($map_1);
       $map_2 = stripslashes($map_2);
       $map_3 = stripslashes($map_3);

       $adv_name = htmlentities($adv_name);
       $report = htmlentities($report);
       $type = htmlentities($type);
       $style = htmlentities($style);
       $map_1 = htmlentities($map_1);
       $map_2 = htmlentities($map_2);
       $map_3 = htmlentities($map_3);


       if ($language == "french")
       {
           $date = $jour . "/" . $mois . "/" . $an;
       }
       else
       {
           $date = $mois . "/" . $jour. "/" . $an;
       }

       if ($team > 0)
       {
           $sql_team = mysql_query("SELECT titre FROM " . TEAM_TABLE . " WHERE cid = '" . $team . "'");
           list($team_name) = mysql_fetch_array($sql_team);
           $team_name = stripslashes($team_name);
           $team_name = htmlentities($team_name);
       }
       else
       {
           $team_name = $nuked['name'];
       }

       if ($visiteur >= admin_mod("Wars"))
       {
           echo"<script type=\"text/javascript\">\n"
           ."<!--\n"
           ."\n"
           . "function delmatch(adversaire, id)\n"
           . "{\n"
           . "if (confirm('" . _DELETEMATCH . " '+adversaire+' ! " . _CONFIRM . "'))\n"
           . "{document.location.href = 'index.php?file=Wars&page=admin&op=del_war&war_id='+id;}\n"
           . "}\n"
           . "\n"
           . "// -->\n"
           . "</script>\n";

           echo "<div style=\"text-align: right;\"><a href=\"index.php?file=Wars&page=admin&op=match&do=edit&war_id=" . $war_id . "\"><img style=\"border: 0;\" src=\"images/edition.gif\" alt=\"\" title=\"" . _EDIT . "\" /></a>"
           . " <a href=\"java script:delmatch('" . addslashes($adv_name) . "', '" . $war_id . "');\"><img style=\"border: 0;\" src=\"images/delete.gif\" alt=\"\" title=\"" . _DEL . "\" /></a> </div>";
       }

       echo "<br /><table style=\"margin-left: auto;margin-right: auto;text-align: left;background: " . $bgcolor2 . ";\" width=\"90%\" border=\"0\" cellpadding=\"3\" cellspacing=\"3\">\n"
. "<tr><td style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" align=\"center\" colspan=\"2\"><big><b>" . $team_name . "</b> " . _VS . " <b>" . $adv_name . "</b></big></td></tr>\n"
   . "<tr><td style=\"background: " . $bgcolor2 . ";border: 1px solid " . $bgcolor3 . ";\" align=\"center\" colspan=\"2\">" . $map_1 . "</td></tr>\n"
   . "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _OPPONENT . "</b> : ";
           if ($adv_url != "")
       {
           echo "<a href=\"" . $adv_url . "\" onclick=\"window.open(this.href); return false;\">" . $adv_name . "</a>";
       } 
       else
       {
           echo $adv_name;
       }

       echo " <img src=\"images/flags/" . $pays_adv . "\" alt=\"\" title=\"" . $pays . "\" /></td></tr>\n"
  	. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _DATE . "</b> : " . $date . "</td></tr>\n"
. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _TYPE . "</b> : " . $type . "</td></tr>\n"
. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _STYLE . "</b> : " . $style . "</td></tr>\n"
. "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _MAPS . "</b> : " . $map_1;


       if ($map_2 != "")
       {
           echo ", " . $map_2;
       }

       if ($map_3 != "")
       {
           echo ", " . $map_3;
       }

       echo "</td></tr><tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\"><b>" . _RESULT . "</b> :";

       if ($score_team < $score_adv)
       {
           echo " <span style=\"color: #990000;\"><b>" . $score_team . "</b></span> - <span style=\"color: #009900;\"><b>" . $score_adv . "</b></span></td></tr>\n";
       } 
       else if ($score_team > $score_adv)
       {
           echo " <span style=\"color: #009900;\"><b>" . $score_team . "</b></span> - <span style=\"color: #990000;\"><b>" . $score_adv . "</b></span></td></tr>\n";
       } 
       else
       {
           echo " <b>" . $score_team . " - " . $score_adv . "</b></td></tr>\n";
       } 

       echo "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\">";

       include ("modules/Comment/index.php");
       com_index("match", $war_id);

       echo "</td></tr><tr style=\"background: " . $bgcolor2 . ";\"><td> </td></tr>\n";


       if ($report != "")
       {
           $report = BBcode($report);
           echo "<tr><td style=\"background: " . $bgcolor2 . ";border: 1px dashed " . $bgcolor3 . ";\"><b>" . _REPORTBY . " <a href=\"index.php?file=Members&op=detail&autor=" . urlencode($auteur) . "\">" . $auteur . "</a> : </b></td></tr>\n"
           . "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\">" . $report;

           if ($url_league != "")
           {
               echo "<br /><br /><a href=\"" . $url_league . "\" onclick=\"window.open(this.href); return false;\"><i>" . _OFFICIALREPORT . "</i></a>";
           } 

           echo "</td></tr><tr style=\"background: " . $bgcolor2 . ";\"><td> </td></tr>\n";
}

       $sql_screen = mysql_query("SELECT url FROM " . JOIN_FILES_TABLE . " WHERE module = 'Wars' AND type = 'screen' AND im_id = '" . $war_id . "'");
       $nb_screen = mysql_num_rows($sql_screen);

       if ($nb_screen > 0)
       {
           echo "<tr style=\"background: " . $bgcolor1 . ";\"><td style=\"border: 1px dashed " . $bgcolor3 . ";\">";

           while (list($url) = mysql_fetch_array($sql_screen))
           {
               echo " <a href=\"#\" onclick=\"java script:window.open('" . $url . "','screen','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=800,height=600,top=30,left=0');return(false)\">"
               . "<img style=\"border: 1px solid #000000;\" src=\"" . $url . "\" width=\"150\" alt=\"\" /></a>";
           } 
           echo "</td></tr><tr style=\"background: " . $bgcolor2 . ";\"><td> </td></tr>\n";
       } 

       $sql_demo = mysql_query("SELECT url FROM " . JOIN_FILES_TABLE . " WHERE module = 'Wars' AND type = 'demo' AND im_id = '" . $war_id . "'");
       $nb_demo = mysql_num_rows($sql_demo);

       if ($nb_demo > 0)
       {
           $l = 1;
           echo "<tr style=\"background: " . $bgcolor2 . ";\"><td><table align=\"center\">";

           while (list($url) = mysql_fetch_array($sql_demo))
           {
               if ($nb_demo > 1)
               {
                   $demos = $l . "/" . $nb_demo;
               } 
               else
               {
                   $demos = "";
               } 
               $l++;
               echo "<tr><td><img src=\"modules/Wars/images/demo.gif\" alt=\"\" /></td><td><a href=\"" . $url . "\" onclick=\"window.open(this.href); return false;\">" . _DOWNLOADDEMO . " " . $demos . "</a></td></tr>\n";
           } 
           echo "</table></td></tr>\n";
       } 
       echo "</table><br />\n";

       closetable();
   } 

   switch ($op)
   {
       case"index":
           index();
           break;

       case"detail":
           detail($war_id);
           break;

       default:
           index();
           break;
   } 

} 
else if ($level_access == -1)
{
   opentable();
   echo "<br /><br /><div style=\"text-align: center;\">" . _MODULEOFF . "<br /><br /><a href=\"java script:history.back()\"><b>" . _BACK . "</b></a><br /><br /></div>";
   closetable();
} 
else if ($level_access == 1 && $visiteur == 0)
{
   opentable();
   echo "<br /><br /><div style=\"text-align: center;\">" . _USERENTRANCE . "<br /><br /><b><a href=\"index.php?file=User&op=login_screen\">" . _LOGINUSER . "</a> | <a href=\"index.php?file=User&op=reg_screen\">" . _REGISTERUSER . "</a></b><br /><br /></div>";
   closetable();
} 
else
{
   opentable();
   echo "<br /><br /><div style=\"text-align: center;\">" . _NOENTRANCE . "<br /><br /><a href=\"java script:history.back()\"><b>" . _BACK . "</b></a><br /><br /></div>";
   closetable();
} 

?>

Link to comment
Share on other sites


×
×
  • Create New...