So Lord habs geändert.
bei mir wills einfach nicht klappen.
Bei dir auf der Hp ist die stats anzeige echt nice grins.
ich schnall einfach nicht an welche stellen ich es in der wars.php & der wars.htm reinschreiben soll das es funzt.Hatt noch nie so ein prob was einzufügen.Hab wohl ein bier zu viel getrunken und dabei ein paar gehirnzellen zuviel vernichtet.
das ist meine wars.htm
<table border="0" cellspacing="1" cellpadding="1" class="border">
<tr class="Chead">
<td align="center" colspan="4" ><b>{TITLE}</b></td>
</tr><tr class="Cmite">
<td align="center">{_lang_whole}</td>
<td align="center">{_lang_win}</td>
<td align="center">{_lang_los}</td>
<td align="center">{_lang_pat}</td>
</tr><tr class="Cnorm">
<td align="center"><font class="textalter">{GES}</font></td>
<td align="center"><font color="#00FF00">{WIN}</font></td>
<td align="center"><font color="#FF4242">{LOS}</font></td>
<td align="center"><font color="#FFEE00">{PAT}</font></td>
</tr>
</table>
<br>
<br>
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
<tr class="Chead">
<td colspan="4"><b>{_lang_nextwars}</b></td>
</tr>
<tr class="Cdark">
<td width="30%"><b>{_lang_date}</b></td>
<td width="30%"><b>{_lang_opponent}</b></td>
<td width="30%"><b>{_lang_squad}</b></td>
<td width="10%"><b>{_lang_more}</b></td>
</tr>
{EXPLODE}
<tr class="{class}">
<td>{time}</td>
<td><a href="{page}" target="_blank">{gegner}</a></td>
<td>{team}</td>
<td><a href="index.php?wars-more-{id}">{_lang_more}</a></td>
</tr>
{EXPLODE}
</table>
<br />
<br />
{EXPLODE}
<form action="?wars-last" method="POST">
<input type="hidden" name="che" value="1">
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
<tr class="Chead">
<td colspan="3"><b>{_lang_lastwars}</b></td>
</tr>
<tr class="Cnorm">
<td>Team:</td>
<td colspan="2"><select name="tid"><option value="">----------</option> {tid}</select></td>
</tr>
<tr class="Cmite">
<td>{_lang_result}:</td>
<td colspan="2"><select name="wpl">
<option value="">----------</option>
<option value="1">{_lang_win}</option>
<option value="2">{_lang_los}</option>
<option value="3">{_lang_pat}</option>
</select>
</td>
</tr>
<tr class="Cnorm">
<td>Game:</td>
<td colspan="2"><select name="spiel"><option value="">----------</option> {game}</select></td>
</tr>
<tr class="Cmite">
<td>Typ:</td>
<td colspan="2"><select name="typ"><option value="">----------</option> {typ}</td>
</tr>
<tr class="Cnorm">
<td></td><td><input type="Submit" name="Go" value="Go"></td><td><a href="index.php?wars-last">Zeige alle {_lang_lastwars}</a></td>
</tr>
</table>
</form>
{EXPLODE}
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="border">
<tr class="Chead">
<td colspan="7"><b>{_lang_lastwars}</b></td>
</tr>
<tr class="Cdark">
<td width="15%"><b>{_lang_date}</b></td>
<td width="20%"><b>{_lang_opponent}</b></td>
<td width="25%"><b>{_lang_squad}</b></td>
<td width="15%"><b>{_lang_matchtype}</b></td>
<td width="15%"><b>{_lang_result}</b></td>
<td width="10%"><b>{_lang_more}</b></td>
</tr>
{EXPLODE}
<tr class="{class}">
<td>{time}</td>
<td><img src="include/images/flags/{land}" alt="" /> <a href="{page}" target="_blank">{gegner}</a></td>
<td>{team}</td>
<td>{mtyp}</td>
<td><div style="border: solid #{farbe2} 1px; margin: 0px; background-color: #{farbe}; color:#000000">{erg}</div></td>
<td><a href="index.php?wars-more-{id}">{_lang_more}</a></td>
</tr>
{EXPLODE}
</table>
und das die wars.php
<?php
# Copyright by: Manuel Staechele
# 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);
while($row = db_fetch_assoc($erg) ) {
if ( $row['opp'] == $row['owp'] ) {
$farbe = 'FDFBB7'; #pat
} elseif ( $row['opp'] < $row['owp'] ) {
$farbe = 'C8E1B8'; #win
} elseif ( $row['opp'] > $row['owp'] ) {
$farbe = 'D8B9B9'; #los
}
foreach($enar as $v) {
if ( file_exists ( 'include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v ) ) {
$size=getimagesize('include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v);
$breite=$size[0];
$hoehe=$size[1];
break;
}
}
$list .= '<tr bgcolor="#'.$farbe.'">';
$list .= '<td><font color="#000000">'.$row['map'].'</font></td>';
$list .= '<td><font color="#000000">'.$row['opp'].'</font></td>';
$list .= '<td><font color="#000000">'.$row['owp'].'</font></td>';
if (file_exists('include/images/maps/'.$row['map'].'.jpg') ) {
$list .= '<td><a href="#" onClick="javascript:window.open(\'include/images/maps/'.$row['map'].'.jpg\',\'bild\',\'height=500 ,width=500\')"><img src="include/images/maps/'.$row['map'].'.jpg" width="100" height="80" border="0" alt="'.$row['map'].'" title="'.$row['map'].'" /></a></td>';
} else {
$list .= '<td><img src="include/images/maps/nopic.jpg" width="100" height="80" border="0"></td>';
}
if ( file_exists ( 'include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v ) ) {
$list .= '<td><a href="#" onClick="javascript:window.open(\'include/images/wars/'.$wid.'_'.$row['mnr'].'.'.$v.'\',\'bild\',\'height='.$hoehe.',width='.$breite.'\')"><img src="include/images/wars/'.$wid.'_'.$row['mnr'].'.jpg" width="100" height="80" border="0"></a></td>';
} else {
$list .= '<td><a><img src="include/images/wars/noscreen.jpg" width="100" height="80" border="0"></a></td>';
}
}
return ($list);
}
function lastwars_get_memberlist ( $id ) {
$l = '';
$erg = db_query("SELECT prefix_user.id,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.id ASC");
while($r = db_fetch_assoc($erg)) {
$l .= file_exists($r['avatar']) ? '<a href="index.php?user-details-'.$r['id'].'"><img src="'.$r['avatar'].'" alt="'.$r['name'].'" info="'.$r['name'].'" /></a> ' : '<a href="index.php?user-details-'.$r['id'].'"><img src="include/images/avatars/noavatar.jpg" alt="'.$r['name'].'" info="'.$r['name'].'" /></a> ';
}
return (substr($l,0,-2));
}
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);
$tpl = new tpl ( 'wars.htm' );
$tpl->set_ar_out ( array('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.gegner,a.page,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"><strong>kein Next War vorhanden</strong></td></tr>';
} else {
while ($row = db_fetch_assoc($erg) ) {
if ( $class == 'Cmite' ) { $class = 'Cnorm'; } else { $class = 'Cmite'; }
$row['page'] = get_homepage($row['page']);
$row['team'] = get_wargameimg($row['game']).' '.$row['team'];
$row['class'] = $class;
$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');
$erg = db_query("SELECT a.owp,a.opp,a.wlp,a.land,a.mtyp,a.game,a.id,a.gegner,a.page,b.name as team,DATE_FORMAT(datime,'%d.%m.%Y') 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['opp'].':'.$row['owp'];
$row['farbe'] = $farbe1wlpar[$row['wlp']];
$row['farbe2'] = $farbe2wlpar[$row['wlp']];
if ( $class == 'Cmite' ) { $class = 'Cnorm'; } else { $class = 'Cmite'; }
$row['page'] = get_homepage($row['page']);
$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,
gegner, tag, page, mail, icq, wo, prefix_wars.`mod`, mtyp,
game, land, txt, 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);
$row['page'] = get_homepage($row['page']);
$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'] );
if ( $_SESSION['authright'] <= -3 ) {
$row['mail']=$row['mail'];
$row['icq']=$row['icq'];
$row['wo']=$row['wo'];
$row['txt']=$row['txt'];
} else{
$row['icq']='locked';
$row['mail']='locked';
$row['wo']='locked';
$row['txt']='locked';
}
$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']) ) {
$aktion = ( $_POST['sub'] == 'zusagen' ? 1 : 0 );
$kom = escape($_POST['kom'],'string');
db_query("INSERT INTO prefix_warmember (uid,wid,aktion,kom) VALUES (".$_SESSION['authid'].",".$_GET['mehr'].",".$aktion.",'".$kom."')");
} else {
$tpl->out(2);
}
}
$class = '';
$aktionar = array ('<font style="color:#FF0000; background:#666666; font-weight:bold;">abgesagt</font>','<font style="font-weight:bold; color:#00FF00; background:#666666;">zugesagt</font>');
$erg1 = db_query("SELECT b.id as uid, b.name, a.aktion, a.kom FROM prefix_warmember a left join prefix_user b ON b.id = a.uid WHERE a.wid = ".$_GET['mehr']);
while ($row1 = db_fetch_assoc($erg1) ) {
if ( $class == 'Cmite' ) { $class = 'Cnorm'; } else { $class = 'Cmite'; }
$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']);
$wlpar = array(1=>'gewonnen',2=>'verloren',3=>'unentschieden');
$row['erg'] = $row['owp'].' zu '.$row['opp'];
$row['ergliste'] = get_erg_liste($_GET['mehr']);
$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'] );
$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();
}
?>