';
if(!isset($_GET['action'])) {
$cwID = $_GET['cwID'];
$ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."clanwars WHERE cwID='$cwID'"));
$date=date("d.m.Y", $ds[date]);
$opponent=''.$ds[opptag].' / '.$ds[opponent].'>';
$league=''.$ds[league].'';
$game='';
// v1.0
$homescr=array_sum(explode("||", $ds[homescore]));
$oppscr =array_sum(explode("||", $ds[oppscore]));
$theMaps=explode("||", $ds[maps]);
if(is_array($theMaps)) {
$n=1;
foreach($theMaps as $map) {
if($n == 1) {
$maps.=$map;
} else {
if($map=='') {
$maps='no maps';
} else {
$maps.=', '.$map;
}
}
$n++;
}
}
if($homescr>$oppscr) $results=''.$homescr.':'.$oppscr.'';
elseif($homescr<$oppscr) $results=''.$homescr.':'.$oppscr.'';
else $results=''.$homescr.':'.$oppscr.'';
if(isclanwaradmin($userID))
$adminaction='
';
$report=cleartext($ds[report]);
$report = toggle($report, $ds[cwID]);
if($report=="") $report="n/a";
$squad=''.getsquadname($ds[squad]).'';
$opptag=$ds[opptag];
$oppteam=$ds[oppteam];
$server=$ds[server];
$hltv=$ds[hltv];
$opptag=$ds[opptag];
if(!empty($ds[hometeam])) {
$array=explode("|", $ds[hometeam]);
$n=1;
foreach($array as $id) {
if(!empty($id)) {
if($n>1) $hometeam.=', '.getnickname($id).'';
else $hometeam.=''.getnickname($id).'';
$n++;
}
}
}
if(!empty($ds[screens])) $screens=explode("|", $ds[screens]);
if(is_array($screens)) {
$n=1;
foreach($screens as $screen) {
if(!empty($screen)) {
$screenshots.='';
if($nbr==2) {
$nbr=1;
$screenshots.='
';
} else {
$nbr=2;
}
$n++;
}
}
}
if(!(strlen(trim($screenshots)))) $screenshots='no Screenshots available';
$bg1=BG_1;
$bg2=BG_2;
$bg3=BG_3;
$bg4=BG_4;
$linkpage=cleartext($ds[linkpage]);
$linkpage=str_replace('http://','',$ds[linkpage]);
if($linkpage=="") $linkpage="#";
// -- v1.0, extended results -- //
$scoreHome=explode("||", $ds[homescore]);
$scoreOpp=explode("||", $ds[oppscore]);
$homescr=array_sum($scoreHome);
$oppscr=array_sum($scoreOpp);
if($homescr>$oppscr) {
$result_map='[color='.$wincolor.'][b]'.$homescr.':'.$oppscr.'[/b][/color]';
$result_map2='won';
}
elseif($homescr<$oppscr) {
$result_map='[color='.$loosecolor.'][b]'.$homescr.':'.$oppscr.'[/b][/color]';
$result_map2='lost';
}
else {
$result_map='[color='.$drawcolor.'][b]'.$homescr.':'.$oppscr.'[/b][/color]';
$result_map2='draw';
}
if(is_array($theMaps)) {
$d=0;
foreach($theMaps as $map) {
if(($d+1)%2) { $bgone=BG_1; $bgtwo=BG_2; } else { $bgone=BG_3; $bgtwo=BG_4; }
if($scoreHome[$d] > $scoreOpp[$d]) $score.=''.$scoreHome[$d].' : '.$scoreOpp[$d].'';
elseif($scoreHome[$d] < $scoreOpp[$d]) $score.=''.$scoreHome[$d].' : '.$scoreOpp[$d].'';
else $score.=''.$scoreHome[$d].' : '.$scoreOpp[$d].'';
eval ("\$clanwars_details_results = \"".gettemplate("clanwars_details_results")."\";");
$extendedresults.=$clanwars_details_results;
unset($score);
$d++;
}
} else $extendedresults='';
// -- clanwar output -- //
eval ("\$clanwars_details = \"".gettemplate("clanwars_details")."\";");
echo $clanwars_details;
$comments_allowed = $ds[comments];
$parentID = $cwID;
$type = "cw";
$referer = "index.php?site=clanwars_details&cwID=$cwID";
include("comments.php");
}
?>