Hi ich ma wieder mit was neuem^^
Im Admin-Bereich kann man unter Lastwars auch Statements eingeben sowohl eigene als auch die des Gegners.
diese wollte ich nun auch in den Last Wars anzeigen lassen.
und habe auch schon ein Stück geschafft.
Ich habe es in der War_last.htm eingefügt und in der Wars.php aus dem content-bereich.
Es funktioniert auch fast, ich hab nur ein kleines prob. und find die lösung nicht. ich wollte es so haben wenn man nichts im Adminbereich in diese zeilen schreibt das dort steht: Kein Statement abgegeben.
Das macht er auch, aber leider auch wenn etwas drin steht, ich habe jetzt schon alles mögliches probiert und komme zu keinem ergebnis, kann mir jemand bitte helfen?
hier meine
include/admin/templates/wars/last.htm
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<div><div style="float:left";>Navigation: </div><div style="float:left;"><form name="navi">
<select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
<option value="admin.php?wars">[ bitte auswählen ]</option>
<option value="admin.php?wars-last">Last Wars</option>
<option value="admin.php?wars-next">Next Wars</option>
<option value="admin.php?wars-fightus">FightUs-Anfragen</option>
<option value="admin.php?wars-opponent">Gegnerverwaltung</option>
<option value="admin.php?wars-teams">Teamverwaltung</option>
<option value="admin.php?wars-check">Versionskontrolle</option>
</select>
</form>
</div>
</div>
<br />
<br />
<br />
<div>
<table cellpadding="0" cellspacing="0" border="0"><tr><td><img src="include/images/icons/admin/wars_last.png" /></td><td width="30"></td><td valign="bottom"><h1>Lastwars</h1></td></tr></table>
<div class="info_box">
<b>Merke (Mapbilder)</b>
<br />
<span class="smalfont">
Die Mapbilder müssen in 'include/images/warmaps' kopiert werden.
Es muss eine .png, .jpg oder .gif-Datei sein.
Bsp.: de_dust.jpg , dann muss bei der Map de_dust eingetragen werden.
</span>
</div>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="60%" valign="top">
<form action="admin.php?wars-last" method="POST" name="form">
<input type="hidden" name="pkey" value="{pkey}" />
<input type="hidden" name="status" value="3" />
<table class="border" cellpadding="3" cellspacing="1" border="0">
{msg}
<tr class="Cdark">
<td colspan="2"><b>Gegner Wahl</b></td>
</tr><tr>
<td class="Cmite">Bitte einen zuvor erstellten Gegner auswählen...</td>
<td class="Cnorm"><select name="oid">{oid}</select></td>
</tr>
<tr class="Cdark">
<td colspan="2"><b>News-Optionen</b></td>
</tr><tr>
<td class="Cmite">News schreiben/editieren?</td>
<td class="Cnorm">Ja <input type="radio" name="news" value="0" />, Nein <input type="radio" name="news" value="1" checked="checked" /></td>
</tr>
<tr>
<td class="Cmite">Lineup Gegner (Wird auch für Last Wars genutzt!)</td>
<td class="Cnorm"><input type="text" name="lineupopp" size="50" value="{lineupopp}"/></td>
</tr>
<tr>
<td class="Cmite">PSL-Statement Gegner</td>
<td class="Cnorm"><textarea cols="47" rows="5" name="oppstate">{oppstate}</textarea></td>
</tr>
<tr>
<td class="Cmite">Eigenes PSL-Statement</td>
<td class="Cnorm"><textarea cols="47" rows="5" name="owpstate">{owpstate}</textarea></td>
</tr><tr class="Cdark">
<td colspan="2"><b>Matchinfo</b></td>
</tr><tr>
<td class="Cmite">Datum | Zeit</td>
<td class="Cnorm"><table cellpadding="0" cellspacing="0" border="0"><tr><td><input type="text" name="day" value="{day}" size="2"><b>.</b><input type="text" name="mon" value="{mon}" size="2"><b>.</b><input type="text" name="jahr" value="{jahr}" size="4"> <b>-</b> <input type="text" name="stu" value="{stu}" size="2"><b>:</b><input type="text" name="min" value="{min}" size="2"><b>:</b><input type="text" name="sek" value="{sek}" size="2"> </td><td><input type="checkbox" id="kalender"{kalck} value="yes" name="kalender" /></td><td><label for="kalender" style="cursor: pointer"><span class="smalfont">Kalender eintragen / ändern.</span></label></td></tr></table></td>
</tr>
<tr>
<td class="Cmite">Matchlink</td>
<td class="Cnorm"><input type="Text" name="mlink" value="{mlink}" size="46" ></td>
</tr><tr>
<td class="Cmite">Team</td>
<td class="Cnorm"><select name="tid">{tid}</select></td>
</tr><tr>
<td class="Cmite">XonX</td>
<td class="Cnorm"><select onchange="sichtbarA()" name="mod">{mod}<option value="neu">Neu:</option></select> <input type="text" name="newmod" /></td>
</tr><tr>
<td class="Cmite">Game</td>
<td class="Cnorm"><select onchange="sichtbarB()" name="game">{game}<option value="neu">Neu:</option></select> <input type="text" name="newgame" /></td>
</tr><tr>
<td class="Cmite">Matchtyp</td>
<td class="Cnorm"><select onchange="sichtbarC()" name="mtyp">{mtyp}<option value="neu">Neu:</option></select> <input type="text" name="newmtyp" /></td>
</tr>
<tr>
<td class="Cmite">Member</td>
<td class="Cnorm"><a href="javascript:manageMember()">Member die gespielt haben verwalten.</a></td>
</tr><tr>
<td class="Cmite">Ergebnis</td>
<td class="Cnorm"><select name="wlp">{wlp}</select></td>
</tr>
<tr>
<td class="Cnorm" colspan="2" width="100%">
<table cellpadding="1" cellspacing="1" border="0" class="border" width="100%">
<tr>
<td class="Cdark" colspan="2"><b>Map 1</b></td>
</tr><tr>
<td class="Cmite" width="20%">Name</td>
<td class="Cnorm" width="80%"><input type="text" name="map[1]" value="{map1}"/> </td>
</tr>
<tr>
<td class="Cmite" width="20%">Ergebnis</td>
<td class="Cnorm" width="80%"><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[1]" value="{owp1}" /> :
<input type="text" size="3" onKeyUp="setOPPsum()" name="opp[1]" value="{opp1}" /><i> ( Wir : Gegner )</i></td>
</tr>
<tr>
<td colspan="2" class="Cdark">
<b>Map 2</b>
</td>
</tr>
<tr>
<td class="Cmite" width="20%">Name</td>
<td class="Cnorm" width="80%"><input type="text" name="map[3]" value="{map3}" /></td>
</tr>
<tr>
<td width="20%" class="Cmite">Ergebnis</td>
<td class="Cnorm" width="80%"><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[3]" value="{owp3}" /> :
<input type="text" size="3" onKeyUp="setOPPsum()" name="opp[3]" value="{opp3}" /><i> ( Wir : Gegner )</i></td>
</tr>
<tr>
<td class="Cdark" colspan="2"><b>Map 3</b></td>
</tr><tr>
<td class="Cmite" width="20%">Name</td>
<td class="Cnorm" width="80%"><input type="text" name="map[5]" value="{map5}" /> </td>
</tr>
<tr>
<td class="Cmite" width="20%">Ergebnis</td>
<td class="Cnorm" width="80%"><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[5]" value="{owp5}" /> :
<input type="text" size="3" onKeyUp="setOPPsum()" name="opp[5]" value="{opp5}" /><i> ( Wir : Gegner )</i></td>
</tr>
<tr>
<td class="Cdark" colspan="2"><b>Map 4</b></td>
</tr><tr>
<td class="Cmite" width="20%">Name</td>
<td class="Cnorm" width="80%"><input type="text" name="map[7]" value="{map7}" /> </td>
</tr>
<tr>
<td class="Cmite" width="20%">Ergebnis</td>
<td class="Cnorm" width="80%"><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[7]" value="{owp7}" /> :
<input type="text" size="3" onKeyUp="setOPPsum()" name="opp[7]" value="{opp7}" /><i> ( Wir : Gegner )</i></td>
</tr><!--<tr>
<td><input type="text" name="map[5]" value="{map5}" /></td>
<td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[5]" value="{opp5}" /></td>
<td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[5]" value="{owp5}" /></td>
<td><a href="javascript:manageMap({pkey},5)">Bild</a></td>
</tr>-->
<tr>
<td colspan="2" class="Cdark"><b>Gesamt</b></td>
</tr>
<tr>
<td class="Cmite" width="20%">Ergebnis</td>
<td class="Cnorm" width="80%"><input type="text" size="3" name="sumowp" value="{owp}" /> :
<input type="text" size="3" name="sumopp" value="{opp}" /></td>
</tr>
</table>
</td>
</tr><tr>
<td class="Cmite">War-Bericht</td>
<td class="Cnorm"><textarea cols="47" rows="5" name="txt">{txt}</textarea></td>
</tr><tr class="Cdark">
<td></td>
<td><input type="submit" value="Absenden" name="sub" /></td>
</tr>
</table>
</form>
</td>
<td width="40%" valign="top">
<table class="border" cellpadding="3" cellspacing="1" border="0">
<tr class="Chead">
<td colspan="5">Übersicht</td>
</tr>
{EXPLODE}
<tr class="{class}">
<td>{team} vs. <img src="include/images/flags/{land2}" /> {gegner}</td>
<td>{erg}</td>
<td align="center"><a href="javascript:del('{id}')"><img src="include/images/icons/del.gif" alt="{_lang_delete}" title="{_lang_delete}" /></a></td>
<td align="center"><a href="admin.php?wars-last&pkey={id}"><img src="include/images/icons/edit.gif" alt="{_lang_change}" title="{_lang_change}" /></a></td>
<td align="center">
<a href="javascript:tm('{id}')">{topmatchstatus}</a>
</td>
</tr>
{EXPLODE}
</table>
{MPL}
</td>
</tr>
</table>
<script language="JavaScript" type="text/javascript">
<!--
function del ( id1 ) {
var x = confirm ( "do you really want to delete?" );
if ( x ) {
document.location.href="admin.php?wars-last&delete="+id1;
}
}
function tm ( id1 ) {
var x = confirm ( "Als Topmatch setzen?" );
if ( x ) {
document.location.href="admin.php?wars-last&topmatch="+id1;
}
}
function manageMap ( wid, mid ) {
if ( wid == 0 ) {
alert ( 'Bitte den Lastwar erst speichern und dann hier das Bild einfuegen!...' );
} else {
var Fenster = window.open ('admin.php?wars-last-upload=0&wid=' + wid + '&mid=' + mid, 'managemap', 'scrollbars=yes,height=150,width=325,left=300,top=50');
Fenster.focus();
}
}
function manageMember () {
if ( document.form.pkey.value == 0 ) {
alert ( 'Bitte den Lastwar erst speichern und dann hier die Member bearbeiten!...' );
} else {
var Fenster = window.open ('admin.php?wars-last-members&wid={pkey}', 'manageMember', 'scrollbars=yes,height=300,width=250,left=300,top=50');
Fenster.focus();
}
}
function setOPPsum () {
var summe = 0;
summe = summe + ( document.getElementsByName('opp[1]')[0].value * 1);
summe = summe + ( document.getElementsByName('opp[3]')[0].value * 1);
summe = summe + ( document.getElementsByName('opp[5]')[0].value * 1);
summe = summe + ( document.getElementsByName('opp[7]')[0].value * 1);
document.form.sumopp.value = summe;
}
function setOWPsum () {
var summe = 0;
summe = summe + ( document.getElementsByName('owp[1]')[0].value * 1);
summe = summe + ( document.getElementsByName('owp[3]')[0].value * 1);
summe = summe + ( document.getElementsByName('owp[5]')[0].value * 1);
summe = summe + ( document.getElementsByName('owp[7]')[0].value * 1);
document.form.sumowp.value = summe;
}
function sichtbarA(){
if(document.form.mod.value=="neu"){
document.form.newmod.style.visibility="visible";
} else {
document.form.newmod.style.visibility="hidden";
}
}
function sichtbarB() {
if(document.form.game.value=="neu"){
document.form.newgame.style.visibility="visible";
} else {
document.form.newgame.style.visibility="hidden";
}
}
function sichtbarC() {
if(document.form.mtyp.value=="neu"){
document.form.newmtyp.style.visibility="visible";
} else {
document.form.newmtyp.style.visibility="hidden";
}
}
function visitpage () {
var page = document.form.page.value;
var n = 'page';
var o = '';
var f = window.open (page, n, o);
f.focus();
}
sichtbarB();
sichtbarC();
sichtbarA();
//-->
</script>
</div>
include/templates/wars_last.htm
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td width="100%" class="Chead" align="left"><strong>» Matchübersicht</strong></td>
</tr>
<tr>
<td width="100%" class="Cmite" valign="top">
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td width="100%" colspan="3" class="Cmite"> </td>
</tr>
<tr>
<td width="35%" class="Cbla" align="center" style="font-size: 12px; font-weight: bold;text-align:center;">
<img src="{teamlogo}" style="border:1px solid #000000;" /><br />{team}
</td>
<td width="30%" class="Cmite" style="font-size: 20px;text-align:center;" align="center"><strong>[{owp} : {opp}]</strong><br />{mlink}</td>
<td width="35%" class="Cbla" align="center" style="font-size: 12px; font-weight: bold;text-align:center;">
<img src="{logo}" style="border:1px solid #000000;" /><br /> <img src="include/images/flags/{land}" alt="" /> <a href="?gegner-{oid}" target="_blank">{gegner}</a>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td width="100%" align="center" colspan="3"></td>
</tr>
</table>
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td colspan="3" align="left" class="Chead"><strong>» Matchdetails</strong></td>
</tr>
<tr>
<td width="100%" colspan="3" class="Cnorm" align="left">
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td width="33%" class="Cmite">Datum:</td>
<td width="67%" class="Cmite">{datum}</td>
</tr>
<tr>
<td width="33%" class="Cmite">Uhrzeit:</td>
<td width="67%" class="Cmite">{zeit} {_lang_oclock}</td>
</tr>
<tr>
<td width="33%" class="Cmite">Spieltyp:</td>
<td width="67%" class="Cmite">{mtyp} ({mod})</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" colspan="3" align="center" class="Cmite"> </td>
</tr>
<tr>
<td colspan="3" align="left" class="Chead"><strong>» Rundenergebnisse</strong></td>
</tr>
<tr>
<td colspan="3" class="Cnorm">
{ergliste}
</td>
</tr>
<tr>
<td width="100%" colspan="3" align="center" class="Cmite"> </td>
</tr>
<tr>
<td width="100%" colspan="3" align="center" class="Cmite"> </td>
</tr>
<tr>
<td width="100%" colspan="3" align="left" class="Chead"><strong>» Lineup: {team}</strong></td>
</tr>
<tr>
<td width="100%" colspan="3" align="center" class="Cnorm" style="padding:0px auto 0px auto"><div style="position: relative;">{memberliste}</div></td>
</tr>
<tr>
<td width="100%" colspan="3" align="left" class="Chead"><strong>» Eigenes PSL-Statement</strong></td>
</tr>
<tr>
<td width="100%" colspan="3" align="left" class="Cnorm">{owpstate}</td>
</tr>
<tr>
<td class="Cmite" colspan="3"> </td>
</tr>
<tr>
<td width="100%" colspan="3" align="left" class="Chead"><strong>» Lineup: {gegner}</strong></td>
</tr>
<tr>
<td width="100%" colspan="3" align="center" class="Cnorm">{lineupopp}</td>
</tr>
<tr>
<td width="100%" colspan="3" align="left" class="Chead"><strong>» Gegner PSL-Statement</strong></td>
</tr>
<tr>
<td width="100%" colspan="3" align="left" class="Cnorm">{oppstate}</td>
</tr>
<tr>
<td class="Cmite" colspan="3"> </td>
</tr>
<tr>
<td width="100%" colspan="3" class="Chead" align="left"><strong>» Matchbericht</strong></td>
</tr>
<tr>
<td width="100%" colspan="3" class="Cblub" align="left">{txt}</td>
</tr>
<tr>
<td width="100%" colspan="3" class="Chead" align="center"> </td>
</tr>
</table>
{EXPLODE}
<form action="index.php?wars-more-{id}" method="POST">
<input type="hidden" name="kommentar_fuer_last_wars" value="yes" />
<table border="0" cellpadding="2" cellspacing="1" class="border" width="100%">
<tr>
<td class="Chead">{_lang_addcomment}</td>
</tr><tr>
<td class="Cmite"><textarea cols="60" rows="2" name="text"></textarea></td>
</tr><tr>
<td class="Cdark"><input type="submit" value="{_lang_formsub}" /></td>
</tr>
</table>
{EXPLODE}
<table border="0" cellpadding="2" cellspacing="1" class="border" width="100%">
<tr>
<td width="10%"class="{class}">{name}</td>
<td class="{class}">{text}</td>
</tr>
</table>
{EXPLODE}
</form>
include/contents/wars.php
<?php
# Copyright by: Manuel
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
function get_erg_liste($wid) {
$list = ''; $enar = array ( 'jpg', 'gif', 'png', 'jpeg');
$erg = db_query("SELECT * FROM prefix_warmaps WHERE wid = ".$wid);
$list .= '<div style="width: 100%;">';
while($row = db_fetch_assoc($erg) ) {
if ( $row['opp'] == $row['owp'] ) {
$farbe = 'FDFBB7'; #pat
$farbe2= 'orange';
} elseif ( $row['opp'] < $row['owp'] ) {
$farbe = 'C8E1B8'; #win
$farbe2= 'green';
} elseif ( $row['opp'] > $row['owp'] ) {
$farbe = 'D8B9B9'; #los
$farbe2= 'red';
}
foreach ($enar as $v) {
if(file_exists('include/images/warmaps/'.$row['map'].'.'.$v)) {
$row['map2'] = $row['map'].'.'.$v;
}
}
$list .= '<div style="float:left; width: 48%; margin: 2px;" class="Cmite">
<table><tr>';
$list .= '<td colspan="2"><img src="include/images/warmaps/'.$row['map2'].'" border="0" alt="'.$row['map'].'"/></td>';
$list .= '</tr><tr style="color: '.$farbe2.';" class="Cbla">';
$list .= '<td style="text-align: center; font-size: 16px; width: 50%;"><strong>'.$row['owp'].'</strong></td>';
$list .= '<td style="text-align: center; font-size: 16px; width: 50%;"><strong>'.$row['opp'].'</strong></td>';
$list .= '</tr></table></div>';
}
$list .= '</div>';
return ($list);
}
function get_screen_liste($wid) {
$list = '<div>';
$enar = array ( 'jpg', 'gif', 'png', 'jpeg');
$erg = db_query("SELECT * FROM prefix_warmaps WHERE wid = ".$wid);
while($row = db_fetch_assoc($erg) ) {
foreach($enar as $v) {
if ( file_exists ( 'include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v ) ) {
$row['mappics1'] = '<a href="include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v.'" target="_blank" style="padding:2px;"><img src="include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v.'" alt="Plant '.$row['mnr'].'" width="100" height="80" border="0" /></a>';
}
}
$row['mnr'] = $row['mnr'] + 1;
foreach($enar as $v) {
if ( file_exists ( 'include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v ) ) {
$row['mappics2'] = '<a href="include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v.'" target="_blank" style="padding:2px;"><img src="include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v.'" alt="Plant '.$row['mnr'].'" width="100" height="80" border="0" /></a>';
break;
}
}
$list .= $row['mappics1'].$row['mappics2'];
}
$list .= '</div>';
return ($list);
}
function lastwars_get_memberlist ( $id ) {
$l = '';
$erg = db_query("SELECT prefix_user.id,prefix_user.name,prefix_user.avatar FROM prefix_user LEFT JOIN prefix_warmember ON prefix_warmember.uid = prefix_user.id AND prefix_warmember.wid = ".$id." WHERE wid = ".$id." ORDER BY prefix_user.name ASC");
while($r = db_fetch_assoc($erg)) {
$l .= '<div style="float:left; padding: 3px auto 3px auto; position: relative; background: #c0c0c0; margin: 1px;"><div><a href="index.php?user-details-'.$r['id'].'"><img src="'.$r['avatar'].'" alt=""/></a><div align="center" style="clear: left;">'.$r['name'].'</div></div></div>';
#$l .= '<a href="index.php?user-details-'.$r['id'].'">'.$r['name'].'</a>, ';
}
if(empty($l)) {
$l .= "- Kein Lineup eingetragen -";
}
//return (substr($l,0,-2));
return $l;
}
if ( $menu->get(2) == '' OR $menu->getA(2) == 'p' ) {
$title = $allgAr['title'].' :: Wars';
$hmenu = 'Wars';
$design = new design ( $title , $hmenu );
$design->header();
$ergWin = db_query('SELECT COUNT(id) FROM `prefix_wars` WHERE wlp = "1"');
$anzWin = db_result($ergWin,0);
$ergLos = db_query('SELECT COUNT(id) FROM `prefix_wars` WHERE wlp = "2"');
$anzLos = db_result($ergLos,0);
$ergPat = db_query('SELECT COUNT(id) FROM `prefix_wars` WHERE wlp = "3"');
$anzPat = db_result($ergPat,0);
$ergGes = db_query('SELECT COUNT(id) FROM `prefix_wars` WHERE status= "3"');
$anzGes = db_result($ergGes,0);
if($anzGes == 0) {
$percentWin = 0;
$percentLos = 0;
$percentPat = 0;
} else {
$percentWin = round($anzWin / $anzGes * 100);
$percentLos = round($anzLos / $anzGes * 100);
$percentPat = round($anzPat / $anzGes * 100);
}
$tpl = new tpl ( 'wars.htm' );
$tpl->set_ar_out ( array('PATH' => $percentPat, 'WINH' => $percentWin, 'LOSH' => $percentLos, 'PAT' => $anzPat, 'WIN' => $anzWin, 'LOS' => $anzLos, 'GES' => $anzGes, 'TITLE'=> $allgAr['title'] ) , 0 );
$akttime = date('Y-m-d');
$class = '';
$erg = db_query("SELECT a.id,a.oid,a.game,b.name as team,DATE_FORMAT(datime,'%d.%m.%Y - %H:%i:%s') as time FROM prefix_wars a left join prefix_groups b ON a.tid = b.id WHERE status = 2 AND a.datime >= '".$akttime."' ORDER BY a.datime");
if ( db_num_rows ( $erg ) == 0 ) {
echo '<tr class="Cmite"><td colspan="4"><i>There are no upcoming Matches!</i></td></tr>';
} else {
while ($row = db_fetch_assoc($erg) ) {
if ( $class == 'Cmite' ) { $class = 'Cbla'; } else { $class = 'Cmite'; }
$row['page'] = get_opponent_details('homepage', $row['oid']);
$row['team'] = get_wargameimg($row['game']).' '.$row['team'];
$row['class'] = $class;
$row['gegner'] = get_opponent_details('name',$row['oid']);
$tpl->set_ar_out($row,1);
}
}
$tpl->out(2);
$class = '';
if ( $menu->get(1) == '' ) {
$teams = dblistee ( '', "SELECT id,name FROM prefix_groups ORDER BY name");
$game= dblistee ('', "SELECT DISTINCT `game`,`game` FROM prefix_wars ORDER BY `game`" );
$mtype= dblistee ( '', "SELECT DISTINCT `mtyp`,`mtyp` FROM prefix_wars ORDER BY `mtyp`" );
$tpl->set_ar_out ( array('tid' => $teams, 'game' => $game, 'typ' => $mtype ) , 3 );
} elseif ($menu->get(1) == 'last') {
$tpl->out(4);
$sqla='WHERE status = 3 ';
if(!empty($_POST['tid'])){
$sqla.= 'AND tid="'.$_POST['tid'].'" ';
}
if(!empty($_POST['wpl'])){
$sqla.= 'AND wlp="'.$_POST['wpl'].'" ';
}
if(!empty($_POST['spiel'])){
$sqla.= 'AND game="'.$_POST['spiel'].'" ';
}
if(!empty($_POST['typ'])){
$sqla.= 'AND mtyp="'.$_POST['typ'].'" ';
}
# seiten funktion
$limit = $allgAr['wars_last_limit']; // Limit
$page = ( $menu->getA(2) == 'p' ? $menu->getE(2) : 1 );
$MPL = db_make_sites ($page , "WHERE status = 3" , $limit , "?wars-last" , 'wars' );
$anfang = ($page - 1) * $limit;
# seiten funktion
$farbe1wlpar = array(1=>'C8E1B8',2=>'D8B9B9',3=>'FDFBB7');
$farbe2wlpar = array(1=>'00FF00',2=>'FF0000',3=>'FFFF00');
$farbe3wlpar = array(1=>'green',2=>'red',3=>'orange');
$erg = db_query("SELECT a.owp,a.opp,a.wlp,a.mtyp,a.game,a.id,a.oid,b.name as team,DATE_FORMAT(datime,'%d.%m.%Y %H:%i') as time FROM prefix_wars a left join prefix_groups b ON a.tid = b.id ".$sqla." ORDER BY a.datime DESC, id DESC LIMIT ".$anfang.",".$limit);
while ($row = db_fetch_assoc($erg) ) {
$row['erg'] = $row['owp'].':'.$row['opp'];
$row['farbe'] = $farbe1wlpar[$row['wlp']];
$row['farbe2'] = $farbe3wlpar[$row['wlp']];
$row['gegner'] = get_opponent_details('name', $row['oid']);
if ( $class == 'Cmite' ) { $class = 'Cbla'; } else { $class = 'Cmite'; }
$row['page'] = get_opponent_details('homepage', $row['oid']);
$row['team'] = get_wargameimg($row['game']).' '.$row['team'];
$row['class'] = $class;
$tpl->set_ar_out($row,5);
}
$tpl->out(6);
echo $MPL;
}
$design->footer();
} elseif ( is_numeric($menu->get(2)) ) {
$_GET['mehr'] = escape($menu->get(2),'integer');
$erg = @db_query("SELECT
DATE_FORMAT(datime,'%d.%m.%Y') as datum,
tid, status, owp, opp, wlp,
DATE_FORMAT(datime,'%H:%i:%s') as zeit,
oid, wo, prefix_wars.`mod`, mtyp,
game, txt,mlink,lineupopp,tv,maps,lineupowp,pw, prefix_wars.id,
name as team
FROM prefix_wars
left join prefix_groups ON prefix_wars.tid = prefix_groups.id
WHERE prefix_wars.id = ".$_GET['mehr']);
db_check_erg ($erg);
$row = db_fetch_assoc($erg);
## Gegnerdaten ##
$row['page'] = get_opponent_details('homepage', $row['oid']);
$row['gegner'] = get_opponent_details('name', $row['oid']);
$row['logo'] = get_opponent_details('logo', $row['oid']);
$row['land'] = get_opponent_details('land', $row['oid']);
## Gegnerlogo ##
if(empty($row['logo'])) {
$row['logo'] = 'include/images/clanlogos/na.gif';
}
## Teamlogo ##
$row['teamlogo'] = get_team_details('logo', $row['tid']);
if(empty($row['logo'])) {
$row['teamlogo'] = 'include/images/clanlogos/na.gif';
}
$row['txt'] = bbcode($row['txt']);
if ( $row['status'] == 2 ) {
# nextwars
$title = $allgAr['title'].' :: Wars :: Nextwars';
$hmenu = '<a href="?wars" class="smalfont">Wars</a><b> » </b>Nextwars';
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('wars_next');
$row['tag'] = ( empty($row['tag']) ? $row['gegner'] : $row['tag'] );
$row['owp'] = "xx";
$row['opp'] = "xx";
if(has_right($allgAr['wars_matchlink_recht'])) {
$row['mlink'] = '<a href="'.$row['mlink'].'" style="font-size: 10px;" target="_blank" />Matchlink</a>';
} else {
$row['mlink'] = "";
}
if(has_right($allgAr['wars_server_recht'])) {
$row['wo'] = $row['wo'];
} else {
$row['wo'] = "<i>Keine Berechtigung</i>";
}
if(has_right($allgAr['wars_password_recht'])) {
$row['pw'] = $row['pw'];
} else {
$row['pw'] = "******";
}
if(has_right($allgAr['wars_tv_recht'])) {
$row['tv'] = $row['tv'];
} else {
$row['tv'] = "<i>Keine Berechtigung</i>";
}
if ( $_SESSION['authright'] <= -0 ) {
$row['maps'] = $row['maps'];
} else {
$row['maps'] = "<i>Keine Berechtigung</i>";
}
if ( $_SESSION['authright'] <= -0 ) {
$row['lineupowp'] = $row['lineupowp'];
} else {
$row['lineupowp'] = "<i>Keine Berechtigung</i>";
}
$tpl->set_ar_out($row,0);
if ( $_SESSION['authright'] <= -2 ) {
# get benoetige member
$bm = substr($row['mod'],0,3); $needed = '';
for($i=0;$i<strlen($bm);$i++) {
if ( is_numeric($bm{$i}) ) {
$needed .= $bm{$i};
}
}
$uid = $_SESSION['authid'];
if ($menu->get(3) == 'delete') { $uid = $menu->get(4); }
$ck = db_count_query("SELECT COUNT(wid) FROM prefix_warmember WHERE wid = ".$_GET['mehr']." AND uid = ".$uid);
# eine zu bzw. absage loeschen
if ( $menu->get(3) == 'delete' AND ((has_right(array($row['tid'])) === true AND $uid == $_SESSION['authid']) OR is_siteadmin('wars')) AND $ck == 1) {
db_query("DELETE FROM prefix_warmember WHERE wid = ".$_GET['mehr']." AND uid = ".$uid );
$ck = 0;
}
$available = db_count_query("SELECT COUNT(uid) FROM prefix_warmember WHERE wid = ".$_GET['mehr']." AND aktion = 1");
$aout1 = array (
'needed' => $needed,
'available' => $available,
'id' => $_GET['mehr']
);
$tpl->set_ar_out($aout1,1);
if ( $ck == 0 AND has_right(array($row['tid'])) === true) {
if ( isset ($_POST['sub']) ) {
switch ($_POST['sub']) {
case 'zusagen': $aktion = 1; break;
case 'absagen': $aktion = 0; break;
case 'vielleicht': $aktion = 2; break;
} ;
$kom = escape($_POST['kom'],'string');
$dat = date('Y.n.j - H:i:s');
db_query("INSERT INTO prefix_warmember (uid,wid,aktion,dat,kom) VALUES (".$_SESSION['authid'].",".$_GET['mehr'].",".$aktion.",'".$dat."','".$kom."')");
} else {
$tpl->out(2);
}
}
$class = '';
$erg1 = db_query("SELECT b.id as uid, b.name, a.aktion, a.kom, DATE_FORMAT(a.dat,'%d.%m.%Y - %H:%i:%s') as datum FROM prefix_warmember a left join prefix_user b ON b.id = a.uid WHERE a.wid = ".$_GET['mehr']." ORDER BY a.dat ASC");
while ($row1 = db_fetch_assoc($erg1) ) {
if ( $class == 'Cmite' ) { $class = 'Cbla'; } else { $class = 'Cmite'; }
$aktionar = array ('<font style="color:#FF0000; font-weight:bold;">hat am '.$row1['datum'].' abgesagt</font>','<font style="font-weight:bold; color:#228b22;">hat am '.$row1['datum'].' zugesagt</font>','<font style="font-weight:bold; color:#ff8c00;">hat am '.$row1['datum'].' unter Vorbehalt zugesagt</font>');
$row1['class'] = $class;
$row1['aktion'] = $aktionar[$row1['aktion']];
if ( $row1['uid'] == $_SESSION['authid'] OR is_siteadmin('wars')) {
$row1['name'] = '<a href="index.php?wars-more-'.$_GET['mehr'].'-delete-'.$row1['uid'].'"><img src="include/images/icons/del.gif" border="0" title="löschen" /></a> '.$row1['name'];
}
$tpl->set_ar_out($row1,3);
}
}
$tpl->out(4);
} elseif ($row['status'] == 3) {
# lastwars
$row['memberliste'] = lastwars_get_memberlist($_GET['mehr']);
if(empty($row['owpstate'])) {
$_POST['owpstate'] == 'Kein Statement abgegeben';
}
$wlpar = array(1=>'gewonnen',2=>'verloren',3=>'unentschieden');
$row['erg'] = $row['owp'].' zu '.$row['opp'];
$row['ergliste'] = get_erg_liste($_GET['mehr']);
$row['screenliste'] = get_screen_liste($_GET['mehr']);
if($row['screenliste'] == "<div></div>") {
$row['screenliste'] = "- Keine Screenshots vorhanden -";
}
if(empty($row['lineupopp'])) {
$row['lineupopp'] = "- Kein Lineup eingetragen -";
}
if(empty($row['oppstate'])) {
$row['oppstate'] = '- Kein Statement abgegeben -';
}
else {
$row['oppstate'] = $row['oppstate'];
}
if(empty($row['txt'])) {
$row['txt'] = '<div style="text-align:center;">- Kein Bericht vorhanden -</div>';
}
$row['wlp'] = $wlpar[$row['wlp']];
$title = $allgAr['title'].' :: Wars :: Lastwars';
$hmenu = '<a href="?wars" class="smalfont">Wars</a><b> » </b>Lastwars';
$design = new design ( $title , $hmenu );
$design->header();
$tpl = new tpl ('wars_last');
$row['tag'] = ( empty($row['tag']) ? $row['gegner'] : $row['tag'] );
if($row['owp'] > $row['opp']) {
$row['owp'] = '<span style="color: green;">'.$row['owp'].'</span>';
$row['opp'] = '<span style="color: red;">'.$row['opp'].'</span>';
} elseif($row['owp'] < $row['opp']) {
$row['owp'] = '<span style="color: red;">'.$row['owp'].'</span>';
$row['opp'] = '<span style="color: green;">'.$row['opp'].'</span>';
} else {
$row['owp'] = '<span style="color: yellow;">'.$row['owp'].'</span>';
$row['opp'] = '<span style="color: yellow;">'.$row['opp'].'</span>';
}
if(has_right($allgAr['wars_matchlink_recht'])) {
$row['mlink'] = '<a href="'.$row['mlink'].'" style="font-size: 10px;" target="_blank" />Matchlink</a>';
} else {
$row['mlink'] = "";
}
if(has_right($allgAr['wars_server_recht'])) {
$row['wo'] = $row['wo'];
} else {
$row['wo'] = "<i>Keine Berechtigung</i>";
}
if(has_right($allgAr['wars_password_recht'])) {
$row['pw'] = $row['pw'];
} else {
$row['pw'] = "******";
}
if(has_right($allgAr['wars_tv_recht'])) {
$row['tv'] = $row['tv'];
} else {
$row['tv'] = "<i>Keine Berechtigung</i>";
}
$tpl->set_ar_out($row,0);
# kommentare fuer lastwars
if ($allgAr['wars_last_komms'] < 0 AND has_right ($allgAr['wars_last_komms'])) {
# aktion
if (isset ($_POST['kommentar_fuer_last_wars'])) {
$name = $_SESSION['authname'];
$text = escape($_POST['text'],'textarea');
db_query("INSERT INTO prefix_koms (name,cat,text,uid) VALUES ('".$name."','WARSLAST', '".$text."', ".$_GET['mehr']." )");
}
if (isset ($_GET['kommentar_fuer_last_wars_loeschen']) AND is_siteadmin('wars')) {
db_query("DELETE FROM prefix_koms WHERE cat = 'WARSLAST' AND uid = ".$_GET['mehr']." AND id = ".$_GET['kommentar_fuer_last_wars_loeschen']);
}
# anzeigen
$tpl->out(1);
$class = '';
$erg = db_query("SELECT name,text,id FROM prefix_koms WHERE cat = 'WARSLAST' AND uid = ".$_GET['mehr']." ORDER BY id DESC");
while($r = db_fetch_assoc($erg)) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
$r['text'] = bbcode($r['text']);
if (is_siteadmin('wars')) { $r['text'] .= '<a href="index.php?wars-more-'.$_GET['mehr'].'=0&kommentar_fuer_last_wars_loeschen='.$r['id'].'"><img src="include/images/icons/del.gif" title="löschen" alt="löschen" border="0"></a>'; }
$r['class'] = $class;
$tpl->set_ar_out($r,2);
}
$tpl->out(3);
}
}
$design->footer();
}
?>