Wollten eine 2te Lastwars erstellen weil wir mehrere Spiele haben doch das will nicht so wie wir Wollen!!
Kann uns da jemand Helfen ??
Link 1
lastwars.php (nicht Verändert ! )
<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> <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>Basis Informationen</b></td> </tr><tr> <td class="Cmite">Gegner Nation</td> <td class="Cnorm"><select name="land">{land}</select></td> </tr><tr> <td class="Cmite">Gegner Tag</td> <td class="Cnorm"><input size="46" type="text" name="tag" value="{tag}"></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">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="Cmite"></td> <td class="Cnorm"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td>Map/Runde</td> <td>Gegner </td> <td>Eigene</td> </tr><tr> <td><input type="text" name="map[1]" value="{map1}" /> </td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[1]" value="{opp1}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[1]" value="{owp1}" /></td> <td><a href="javascript:manageMap({pkey},1)">Bild</a></td> </tr><tr> <td><input type="text" name="map[2]" value="{map2}" /></td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[2]" value="{opp2}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[2]" value="{owp2}" /></td> <td><a href="javascript:manageMap({pkey},2)">Bild</a></td> </tr><tr> <td><input type="text" name="map[3]" value="{map3}" /></td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[3]" value="{opp3}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[3]" value="{owp3}" /></td> <td><a href="javascript:manageMap({pkey},3)">Bild</a></td> </tr><tr> <td><input type="text" name="map[4]" value="{map4}" /></td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[4]" value="{opp4}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[4]" value="{owp4}" /></td> <td><a href="javascript:manageMap({pkey},4)">Bild</a></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 align="right">Summe: </td> <td><input type="text" size="3" name="sumopp" value="{opp}" /></td> <td><input type="text" size="3" name="sumowp" value="{owp}" /></td> </tr> </table> </td> </tr><tr> <td class="Cmite">Nachricht</td> <td class="Cnorm"><textarea cols="47" rows="2" 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="3">Übersicht</td> </tr> {EXPLODE} <tr class="{class}"> <td>{game} {gegner}</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> </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 manageMap ( wid, mid ) { if ( wid == 0 ) { alert ( 'Bitte den Lastwar erst speichern und dann hier das Bild einfuegen!...' ); } else if (document.getElementsByName('opp['+mid+']')[0].value == '' || document.getElementsByName('owp['+mid+']')[0].value == '' || document.getElementsByName('map['+mid+']')[0].value == '') { alert ( 'Bitte erstmal den Namen und die Ergebnisse dieser Runde/Map eintragen!..' ); } 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[2]')[0].value * 1); summe = summe + ( document.getElementsByName('opp[3]')[0].value * 1); summe = summe + ( document.getElementsByName('opp[4]')[0].value * 1); summe = summe + ( document.getElementsByName('opp[5]')[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[2]')[0].value * 1); summe = summe + ( document.getElementsByName('owp[3]')[0].value * 1); summe = summe + ( document.getElementsByName('owp[4]')[0].value * 1); summe = summe + ( document.getElementsByName('owp[5]')[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>
Lastwars MW3 (Kopie von Lastwars verändert ! ? Fehler?!)
<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 - MW3</h1></td></tr></table> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td width="60%" valign="top"> <form action="admin.php?wars-last_MW3" 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>Basis Informationen</b></td> </tr><tr> <td class="Cmite">Gegner Nation</td> <td class="Cnorm"><select name="land">{land}</select></td> </tr><tr> <td class="Cmite">Gegner Tag</td> <td class="Cnorm"><input size="46" type="text" name="tag" value="{tag}"></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">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="Cmite"></td> <td class="Cnorm"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td>Map/Runde</td> <td>Gegner </td> <td>Eigene</td> </tr><tr> <td><input type="text" name="map[1]" value="{map1}" /> </td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[1]" value="{opp1}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[1]" value="{owp1}" /></td> <td><a href="javascript:manageMap({pkey},1)">Bild</a></td> </tr><tr> <td><input type="text" name="map[2]" value="{map2}" /></td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[2]" value="{opp2}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[2]" value="{owp2}" /></td> <td><a href="javascript:manageMap({pkey},2)">Bild</a></td> </tr><tr> <td><input type="text" name="map[3]" value="{map3}" /></td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[3]" value="{opp3}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[3]" value="{owp3}" /></td> <td><a href="javascript:manageMap({pkey},3)">Bild</a></td> </tr><tr> <td><input type="text" name="map[4]" value="{map4}" /></td> <td><input type="text" size="3" onKeyUp="setOPPsum()" name="opp[4]" value="{opp4}" /></td> <td><input type="text" size="3" onKeyUp="setOWPsum()" name="owp[4]" value="{owp4}" /></td> <td><a href="javascript:manageMap({pkey},4)">Bild</a></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 align="right">Summe: </td> <td><input type="text" size="3" name="sumopp" value="{opp}" /></td> <td><input type="text" size="3" name="sumowp" value="{owp}" /></td> </tr> </table> </td> </tr><tr> <td class="Cmite">Nachricht</td> <td class="Cnorm"><textarea cols="47" rows="2" 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="3">Übersicht</td> </tr> {EXPLODE} <tr class="{class}"> <td>{game} {gegner}</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_MW3&pkey={id}"><img src="include/images/icons/edit.gif" alt="{_lang_change}" title="{_lang_change}" /></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_MW3&delete="+id1; } } function manageMap ( wid, mid ) { if ( wid == 0 ) { alert ( 'Bitte den Lastwar erst speichern und dann hier das Bild einfuegen!...' ); } else if (document.getElementsByName('opp['+mid+']')[0].value == '' || document.getElementsByName('owp['+mid+']')[0].value == '' || document.getElementsByName('map['+mid+']')[0].value == '') { alert ( 'Bitte erstmal den Namen und die Ergebnisse dieser Runde/Map eintragen!..' ); } else { var Fenster = window.open ('admin.php?wars-last_MW3-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_MW3-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[2]')[0].value * 1); summe = summe + ( document.getElementsByName('opp[3]')[0].value * 1); summe = summe + ( document.getElementsByName('opp[4]')[0].value * 1); summe = summe + ( document.getElementsByName('opp[5]')[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[2]')[0].value * 1); summe = summe + ( document.getElementsByName('owp[3]')[0].value * 1); summe = summe + ( document.getElementsByName('owp[4]')[0].value * 1); summe = summe + ( document.getElementsByName('owp[5]')[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>
Wars.php Verändert und Fehler!
<?php # Copyright by: Manuel # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); defined ('admin') or die ( 'only admin access' ); $um = $menu->get(1); $_REQUEST['mid'] = escape($_REQUEST['mid'], 'integer'); $_REQUEST['wid'] = escape($_REQUEST['wid'], 'integer'); $_POST['add_uid'] = escape($_POST['add_uid'], 'integer'); $_GET['delete_uid'] = escape($_GET['delete_uid'], 'integer'); $_GET['delete'] = escape($_GET['delete'], 'integer'); $_GET['pkey'] = escape($_GET['pkey'], 'integer'); # get Flag list # 1 akt flag function get_wlp_array () { $ar = array ( 1 => 'gewonnen', 2 => 'verloren', 3 => 'unentschieden' ); return ($ar); } function get_datime() { $own = true; $_POST['day'] = escape($_POST['day'],'integer'); $_POST['mon'] = escape($_POST['mon'],'integer'); $_POST['jahr'] = escape($_POST['jahr'],'integer'); $_POST['stu'] = escape($_POST['stu'],'integer'); $_POST['min'] = escape($_POST['min'],'integer'); $_POST['sek'] = escape($_POST['sek'],'integer'); if ( checkdate ($_POST['mon'], $_POST['day'] , $_POST['jahr']) == FALSE ) { $own = false; } elseif ( $_POST['stu'] > 24 OR $_POST['min'] > 60 OR $_POST['sek'] > 60 ) { $own = false; } if ( $own ) { return ( $_POST['jahr'].'-'.$_POST['mon'].'-'.$_POST['day'].' '.$_POST['stu'].':'.$_POST['min'].':'.$_POST['sek'] ); } else { return ( date('Y-m-d H:i:s' ) ); } } switch ( $um ) { default : $design = new design ( 'Admins Area', 'Admins Area', 2 ); $design->header(); ?> Folgende Auswahlmöglichkeiten: <ul> <li><a href="admin.php?wars-last">Lastwars</a></li> <li><a href="admin.php?wars-last_MW3">Lastwars_MW3</a></li> <li><a href="admin.php?wars-next">Nextwars</a></li> </ul> <?php $design->footer(); break; # last wars case 'last' : # image upload if ( $menu->get(2) == 'upload' ) { $tpl = new tpl ( 'wars/upload', 1 ); $msg = ''; # aktion if ( isset ($_FILES['f']['name']) ) { $tmp = explode('.',$_FILES['f']['name']); if ( $tmp[1] == 'gif' OR $tmp[1] == 'png' OR $tmp[1] == 'jpg' OR $tmp[1] == 'jpeg') { $nname = $_REQUEST['wid'].'_'.$_REQUEST['mid'].'.'.$tmp[1]; if ( move_uploaded_file ( $_FILES['f']['tmp_name'], 'include/images/wars/'.$nname) ) { @chmod('include/images/wars/'.$nname, 0777); $ar = array ( 'gif'=>'gif','png'=>'png','jpg'=>'jpg','jpeg'=>'jpeg' ); unset($ar[$tmp[1]]); foreach($ar as $v) { @unlink ( 'include/images/wars/'.$_REQUEST['wid'].'_'.$_REQUEST['mid'].'.'.$v ); } $msg = 'Datei ('.$_FILES['f']['name'].' ) <font color="#00FF00">erfolgreich hochgeladen</font><br />'; } else { $msg = 'Datei ( '.$_FILES['f']['name'].' ) <font color="#FF0000">nicht erfolgreich hochgeladen</font><br />'; } } else { $msg = 'Bitte nur Bilder mit der Endung: .gif, .png, .jpg oder .jpeg!'; } } if ( isset($_GET['d']) ) { if ( @unlink ( 'include/images/wars/'.$_GET['d'] ) ) { $msg = 'Datei <font color="#00FF00">erfolgreich gelöscht</font><br />'; } else { $msg = 'Datei <font color="#FF0000">konnte nicht gelöscht werden</font><br />'; } } # anzeigen if ( !is_writeable ( 'include/images/wars' ) ) { $msg = 'Bitte erst dem Ordner "images/wars" Schreibrechte (chmod 777) geben.'; } $mid = $_REQUEST['mid']; $wid = $_REQUEST['wid']; $file = 'Noch kein Bild hochgeladen... '; $ar = array ( 'gif','png','jpg','jpeg' ); foreach($ar as $v) { if ( file_exists ( 'include/images/wars/'.$wid.'_'.$mid.'.'.$v ) ) { $size=getimagesize('include/images/wars/'.$wid.'_'.$mid.'.'.$v); $breite=$size[0]; $hoehe=$size[1]; $file = '<a href="javascript:openImgWindow(\''.$v.'\','.$hoehe.','.$breite.')">include/images/wars/'.$wid.'_'.$mid.'.'.$v.'</a>'; $file .= ' <a href="javascript:deleteMap(\''.$v.'\')"><img src="include/images/icons/del.gif" border="0" title="löschen" /></a>'; break; } } $tpl->set('wid' ,$wid); $tpl->set('mid' ,$mid); $tpl->set('file', $file ); $tpl->set('msg' ,$msg); $tpl->out(0); exit (); } # manag member for war... if ( $menu->get(2) == 'members' ) { $tpl = new tpl ( 'wars/last_member', 1 ); $msg = ''; # aktion if (isset($_POST['add_uid']) AND !empty($_POST['add_uid'])) { db_query("INSERT INTO prefix_warmember (wid,uid,aktion) VALUES (".$_REQUEST['wid'].",".$_POST['add_uid'].",1)"); } if (isset($_GET['delete_uid']) AND !empty($_GET['delete_uid'])) { db_query("DELETE FROM prefix_warmember WHERE wid = ".$_REQUEST['wid']." AND uid = ".$_GET['delete_uid']); } # anzeigen $tpl->set('msg',$msg); $tpl->set('wid',$_REQUEST['wid']); $tpl->set('liste', dblistee ( 0, "SELECT prefix_user.id,name FROM prefix_user LEFT JOIN prefix_warmember ON prefix_warmember.uid = prefix_user.id AND prefix_warmember.wid = ".$_REQUEST['wid']." WHERE prefix_warmember.aktion is NULL AND recht <= -2 ORDER BY `name`" ) ); $tpl->out(0); $class = ''; $erg = db_query("SELECT prefix_user.id, prefix_user.name FROM prefix_warmember LEFT JOIN prefix_user ON prefix_user.id = prefix_warmember.uid WHERE wid = ".$_REQUEST['wid']." ORDER BY prefix_user.name ASC"); while($r = db_fetch_assoc($erg)) { $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $r['class'] = $class; $tpl->set_ar_out($r,1); } $tpl->out(2); exit(); } # last wars $design = new design ( 'Admins Area', 'Admins Area', 2 ); $design->header(); $show = true; $tpl = new tpl ( 'wars/last', 1); if ( !empty ( $_GET['delete'] ) ) { # aus kalender loeschen fals vorhanden db_query("DELETE FROM prefix_kalender WHERE text like '%more-".$_GET['delete']."]%'"); db_query("DELETE FROM prefix_wars WHERE id = '".$_GET['delete']."'"); $wid = $_GET['delete']; $imgar = array ('gif','png','jpg','jpeg'); for($i=1;$i<=5;$i++) { db_query("DELETE FROM prefix_warmaps WHERE wid = ".$wid." AND mnr = ".$i); foreach ($imgar as $v) { if ( file_exists('include/images/wars/'.$wid.'_'.$i.'.'.$v) ) { unlink ('include/images/wars/'.$wid.'_'.$i.'.'.$v); } } } $msg = '<tr class="Cmite"><td colspan="2">Erfolgreich gelöscht</td></tr>'; } if ( !empty($_POST['sub']) ) { if ( !empty($_POST['newmod']) ) { $_POST['mod'] = $_POST['newmod']; } if ( !empty($_POST['newgame']) ) { $_POST['game'] = $_POST['newgame']; } if ( !empty($_POST['newmtyp']) ) { $_POST['mtyp'] = $_POST['newmtyp']; } if ( empty($_POST['tid']) ) { $_POST['tid'] = 0; } $_POST['pkey'] = escape($_POST['pkey'], 'integer'); $_POST['gegner'] = escape($_POST['gegner'], 'string'); $_POST['page'] = get_homepage(escape($_POST['page'], 'string')); $_POST['tid'] = escape($_POST['tid'], 'integer'); $_POST['mod'] = escape($_POST['mod'], 'string'); $_POST['game'] = escape($_POST['game'], 'string'); $_POST['mtyp'] = escape($_POST['mtyp'], 'string'); $_POST['land'] = escape($_POST['land'], 'string'); $_POST['txt'] = escape($_POST['txt'], 'string'); $_POST['tag'] = escape($_POST['tag'], 'string'); $_POST['email'] = escape($_POST['email'], 'string'); $_POST['icq'] = escape($_POST['icq'], 'string'); $_POST['wo'] = escape($_POST['wo'], 'string'); if ( empty ($_POST['pkey']) ) { db_query("INSERT INTO prefix_wars (`datime`,`status`,wlp,`owp`,`opp`,gegner,tag,page,mail,icq,wo,tid,`mod`,game,mtyp,land,txt) VALUES ('".get_datime()."',3,'".$_POST['wlp']."','".$_POST['sumowp']."','".$_POST['sumopp']."','".$_POST['gegner']."','".$_POST['tag']."','".$_POST['page']."','".$_POST['email']."','".$_POST['icq']."','".$_POST['wo']."','".$_POST['tid']."','".$_POST['mod']."','".$_POST['game']."','".$_POST['mtyp']."','".$_POST['land']."','".$_POST['txt']."')"); $wid = db_last_id(); for($i=1;$i<=5;$i++) { if ( $_POST['map'][$i] != '' AND $_POST['opp'][$i] != '' AND $_POST['owp'][$i] != '' ) { db_query("INSERT INTO prefix_warmaps (wid,mnr,map,opp,owp) VALUES (".$wid.",".$i.",'".escape($_POST['map'][$i], 'string')."',".escape($_POST['opp'][$i], 'string').",".escape($_POST['owp'][$i], 'string').")"); } } # in den kalender eintragen wenn gewuenscht if (isset($_POST['kalender']) AND $_POST['kalender'] == 'yes') { $timestamp = strtotime(get_datime()); $page = str_replace('admin.php','index.php',$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]); db_query("INSERT INTO prefix_kalender (time, title, text, recht) VALUES (".$timestamp.",'Lastwar gegen ".$_POST['gegner']."', '".$_POST['mtyp']." ".$_POST['mod']." in ".$_POST['game']." gegen [url=".$_POST['page']."]".$_POST['gegner']."[/url]\n\n[url=http://".$page."?wars-more-".$wid."]details des Wars[/url]', 0)"); } $msg = '<tr class="Cmite"><td colspan="2">Erfolgreich eingetragen</td></tr>'; } else { db_query("UPDATE prefix_wars SET datime = '".get_datime()."', status = 3,wlp = '".$_POST['wlp']."',owp = '".$_POST['sumowp']."',opp = '".$_POST['sumopp']."',gegner = '".$_POST['gegner']."',tag = '".$_POST['tag']."',page = '".$_POST['page']."',mail = '".$_POST['email']."',icq = '".$_POST['icq']."',wo = '".$_POST['wo']."',tid = '".$_POST['tid']."',`mod` = '".$_POST['mod']."',game = '".$_POST['game']."',mtyp = '".$_POST['mtyp']."',land = '".$_POST['land']."',txt = '".$_POST['txt']."' WHERE id = '".$_POST['pkey']."'"); $wid = $_POST['pkey']; for($i=1;$i<=5;$i++) { $a = db_count_query("SELECT COUNT(*) FROM prefix_warmaps WHERE mnr = ".$i." AND wid = ".$wid); if ( $a == 0 AND $_POST['map'][$i] != '' AND $_POST['opp'][$i] != '' AND $_POST['owp'][$i] != '' ) { db_query("INSERT INTO prefix_warmaps (wid,mnr,map,opp,owp) VALUES (".$wid.",".$i.",'".$_POST['map'][$i]."',".$_POST['opp'][$i].",".$_POST['owp'][$i].")"); } elseif ( $a == 1 AND ( $_POST['map'][$i] == '' OR $_POST['opp'][$i] == '' AND $_POST['owp'][$i] == '') ) { db_query("DELETE FROM prefix_warmaps WHERE wid = ".$wid." AND mnr = ".$i); if ( file_exists('include/images/wars/'.$wid.'_'.$i.'.gif') ) { unlink ('include/images/wars/'.$wid.'_'.$i.'.gif'); } if ( file_exists('include/images/wars/'.$wid.'_'.$i.'.png') ) { unlink ('include/images/wars/'.$wid.'_'.$i.'.png'); } if ( file_exists('include/images/wars/'.$wid.'_'.$i.'.jpg') ) { unlink ('include/images/wars/'.$wid.'_'.$i.'.jpg'); } if ( file_exists('include/images/wars/'.$wid.'_'.$i.'.jpeg') ) { unlink ('include/images/wars/'.$wid.'_'.$i.'.jpeg'); } } elseif ( $a == 1 AND $_POST['map'][$i] != '' AND $_POST['opp'][$i] != '' AND $_POST['owp'][$i] != '' ) { db_query("UPDATE prefix_warmaps SET map = '".escape($_POST['map'][$i], 'string')."', opp = ".escape($_POST['opp'][$i], 'string').", owp = ".escape($_POST['owp'][$i], 'string')." WHERE wid = ".$wid." AND mnr = ".$i); } } # in den kalender eintragen wenn gewuenscht if (isset($_POST['kalender']) AND $_POST['kalender'] == 'yes') { $timestamp = strtotime(get_datime()); $page = str_replace('admin.php','index.php',$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]); if (1 == db_result(db_query("SELECT COUNT(*) FROM prefix_kalender WHERE text like '%more-".$wid."]%'"),0)) { db_query("UPDATE prefix_kalender SET time = ".$timestamp.", title = 'Lastwar gegen ".$_POST['gegner']."', text = '".$_POST['mtyp']." ".$_POST['mod']." in ".$_POST['game']." gegen [url=".$_POST['page']."]".$_POST['gegner']."[/url]\n\n[url=http://".$page."?wars-more-".$wid."]details des Wars[/url]' WHERE text like '%more-".$wid."]%'"); } else { db_query("INSERT INTO prefix_kalender (time, title, text, recht) VALUES (".$timestamp.",'Lastwar gegen ".$_POST['gegner']."', '".$_POST['mtyp']." ".$_POST['mod']." in ".$_POST['game']." gegen [url=".$_POST['page']."]".$_POST['gegner']."[/url]\n\n[url=http://".$page."?wars-more-".$wid."]details des Wars[/url]', 0)"); } } $msg = '<tr class="Cmite"><td colspan="2">Erfolgreich verändert</td></tr>'; } } if ( !empty ($_GET['pkey']) ) { $erg = db_query("SELECT DATE_FORMAT(datime,'%d.%m.%Y.%H.%i.%s') as datime, id,status,wlp,owp,opp,gegner,tag,page,mail,icq,tid,wo,`mod`,game,mtyp,land,txt FROM prefix_wars WHERE id = '".$_GET['pkey']."'"); $_ilch = db_fetch_assoc($erg); $_ilch['pkey'] = $_GET['pkey']; list($_ilch['day'],$_ilch['mon'],$_ilch['jahr'],$_ilch['stu'],$_ilch['min'],$_ilch['sek']) = explode('.',$_ilch['datime']); $_ilch['kalck'] = (db_result(db_query("SELECT COUNT(*) FROM prefix_kalender WHERE text like '%more-".$_GET['pkey']."]%'"),0,0) == 1 ? ' checked' : ''); $wid = $_GET['pkey']; for($i=1;$i<=5;$i++) { $erg = db_query("SELECT map,opp,owp FROM prefix_warmaps WHERE mnr = ".$i." AND wid = ".$wid); if ( db_num_rows($erg) == 0 ) { $_ilch['map'.$i] = ''; $_ilch['opp'.$i] = ''; $_ilch['owp'.$i] = ''; } else { $mpr = db_fetch_assoc($erg); $_ilch['map'.$i] = $mpr['map']; $_ilch['opp'.$i] = $mpr['opp']; $_ilch['owp'.$i] = $mpr['owp']; } } } else { $_ilch = array ('tag'=>'','mail'=>'','icq'=>'','wo'=>'','pkey' => 0, 'wlp' => '', 'opp' => '', 'owp' => '', 'gegner' => '', 'page' => 'http://', 'mtyp' => '', 'tid' => 0, 'land' => '', 'txt' => '', 'mod' => '', 'game' => '', 'day' => date('d'), 'mon' => date('m'), 'jahr' => date('Y'), 'stu' => date('H'), 'min' => date('i'), 'sek' => date('s'), 'kalck' => '' ); for($i=1;$i<=5;$i++) { $_ilch['map'.$i] = ''; $_ilch['opp'.$i] = ''; $_ilch['owp'.$i] = ''; } } $_ilch['msg'] = ( isset ($msg) ? $msg : '' ); $_ilch['tid'] = dblistee ( $_ilch['tid'], "SELECT id, name FROM prefix_groups ORDER BY name"); $_ilch['mod'] = dblistee ( $_ilch['mod'], "SELECT DISTINCT `mod`,`mod` FROM prefix_wars ORDER BY `mod`" ); $_ilch['game'] = dblistee ( $_ilch['game'], "SELECT DISTINCT `game`,`game` FROM prefix_wars ORDER BY `game`" ); $_ilch['mtyp'] = dblistee ( $_ilch['mtyp'], "SELECT DISTINCT `mtyp`,`mtyp` FROM prefix_wars ORDER BY `mtyp`" ); $_ilch['land'] = arlistee ( $_ilch['land'] , get_nationality_array() ); $_ilch['wlp'] = arlistee ( $_ilch['wlp'] , get_wlp_array() ); $tpl->set_ar_out($_ilch,0); $page = ( $menu->getA(2) == 'p' ? $menu->getE(2) : 1 ); $limit = 20; $class = ''; $MPL = db_make_sites ($page , 'WHERE status = 3' , $limit , '?wars-last' , 'wars' ); $anfang = ($page - 1) * $limit; $abf = "SELECT id,gegner,game FROM prefix_wars WHERE status = 3 ORDER BY id DESC LIMIT ".$anfang.",".$limit; $erg = db_query($abf); while ($row = db_fetch_assoc($erg) ) { $class = ($class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $row['class'] = $class; $row['game'] = get_wargameimg($row['game']); $tpl->set_ar ( $row ); $tpl->out(1); } $tpl->set ( 'MPL', $MPL ); $tpl->out(2); $design->footer(); break; # last wars MW3 case 'last_MW3' : # image upload if ( $menu->get(2) == 'upload' ) { $tpl = new tpl ( 'wars_MW3/upload', 1 ); $msg = ''; # aktion if ( isset ($_FILES['f']['name']) ) { $tmp = explode('.',$_FILES['f']['name']); if ( $tmp[1] == 'gif' OR $tmp[1] == 'png' OR $tmp[1] == 'jpg' OR $tmp[1] == 'jpeg') { $nname = $_REQUEST['wid'].'_'.$_REQUEST['mid'].'.'.$tmp[1]; if ( move_uploaded_file ( $_FILES['f']['tmp_name'], 'include/images/wars/'.$nname) ) { @chmod('include/images/wars/'.$nname, 0777); $ar = array ( 'gif'=>'gif','png'=>'png','jpg'=>'jpg','jpeg'=>'jpeg' ); unset($ar[$tmp[1]]); foreach($ar as $v) { @unlink ( 'include/images/wars/'.$_REQUEST['wid'].'_'.$_REQUEST['mid'].'.'.$v ); } $msg = 'Datei ('.$_FILES['f']['name'].' ) <font color="#00FF00">erfolgreich hochgeladen</font><br />'; } else { $msg = 'Datei ( '.$_FILES['f']['name'].' ) <font color="#FF0000">nicht erfolgreich hochgeladen</font><br />'; } } else { $msg = 'Bitte nur Bilder mit der Endung: .gif, .png, .jpg oder .jpeg!'; } } if ( isset($_GET['d']) ) { if ( @unlink ( 'include/images/wars/'.$_GET['d'] ) ) { $msg = 'Datei <font color="#00FF00">erfolgreich gelöscht</font><br />'; } else { $msg = 'Datei <font color="#FF0000">konnte nicht gelöscht werden</font><br />'; } } # anzeigen if ( !is_writeable ( 'include/images/wars' ) ) { $msg = 'Bitte erst dem Ordner "images/wars" Schreibrechte (chmod 777) geben.'; } $mid = $_REQUEST['mid']; $wid = $_REQUEST['wid']; $file = 'Noch kein Bild hochgeladen... '; $ar = array ( 'gif','png','jpg','jpeg' ); foreach($ar as $v) { if ( file_exists ( 'include/images/wars/'.$wid.'_'.$mid.'.'.$v ) ) { $size=getimagesize('include/images/wars/'.$wid.'_'.$mid.'.'.$v); $breite=$size[0]; $hoehe=$size[1]; $file = '<a href="javascript:openImgWindow(\''.$v.'\','.$hoehe.','.$breite.')">include/images/wars/'.$wid.'_'.$mid.'.'.$v.'</a>'; $file .= ' <a href="javascript:deleteMap(\''.$v.'\')"><img src="include/images/icons/del.gif" border="0" title="löschen" /></a>'; break; } } $tpl->set('wid' ,$wid); $tpl->set('mid' ,$mid); $tpl->set('file', $file ); $tpl->set('msg' ,$msg); $tpl->out(0); exit (); } # manag member for war... if ( $menu->get(2) == 'members' ) { $tpl = new tpl ( 'wars_MW3/last_member', 1 ); $msg = ''; # aktion if (isset($_POST['add_uid']) AND !empty($_POST['add_uid'])) { db_query("INSERT INTO prefix_warmember (wid,uid,aktion) VALUES (".$_REQUEST['wid'].",".$_POST['add_uid'].",1)"); } if (isset($_GET['delete_uid']) AND !empty($_GET['delete_uid'])) { db_query("DELETE FROM prefix_warmember WHERE wid = ".$_REQUEST['wid']." AND uid = ".$_GET['delete_uid']); } # anzeigen $tpl->set('msg',$msg); $tpl->set('wid',$_REQUEST['wid']); $tpl->set('liste', dblistee ( 0, "SELECT prefix_user.id,name FROM prefix_user LEFT JOIN prefix_warmember ON prefix_warmember.uid = prefix_user.id AND prefix_warmember.wid = ".$_REQUEST['wid']." WHERE prefix_warmember.aktion is NULL AND recht <= -2 ORDER BY `name`" ) ); $tpl->out(0); $class = ''; $erg = db_query("SELECT prefix_user.id, prefix_user.name FROM prefix_warmember LEFT JOIN prefix_user ON prefix_user.id = prefix_warmember.uid WHERE wid = ".$_REQUEST['wid']." ORDER BY prefix_user.name ASC"); while($r = db_fetch_assoc($erg)) { $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $r['class'] = $class; $tpl->set_ar_out($r,1); } $tpl->out(2); exit(); } # last wars MW3 $design = new design ( 'Admins Area', 'Admins Area', 2 ); $design->header(); $show = true; $tpl = new tpl ( 'wars_MW3/last_MW3', 1); if ( !empty ( $_GET['delete'] ) ) { # aus kalender loeschen fals vorhanden db_query("DELETE FROM prefix_kalender WHERE text like '%more-".$_GET['delete']."]%'"); db_query("DELETE FROM prefix_wars WHERE id = '".$_GET['delete']."'"); $wid = $_GET['delete']; $imgar = array ('gif','png','jpg','jpeg'); for($i=1;$i<=5;$i++) { db_query("DELETE FROM prefix_warmaps WHERE wid = ".$wid." AND mnr = ".$i); foreach ($imgar as $v) { if ( file_exists('include/images/wars/'.$wid.'_'.$i.'.'.$v) ) { unlink ('include/images/wars/'.$wid.'_'.$i.'.'.$v); } } } $msg = '<tr class="Cmite"><td colspan="2">Erfolgreich gelöscht</td></tr>'; } if ( !empty($_POST['sub']) ) { if ( !empty($_POST['newmod']) ) { $_POST['mod'] = $_POST['newmod']; } if ( !empty($_POST['newgame']) ) { $_POST['game'] = $_POST['newgame']; } if ( !empty($_POST['newmtyp']) ) { $_POST['mtyp'] = $_POST['newmtyp']; } if ( empty($_POST['tid']) ) {
Zuletzt modifiziert von daroflor am 18.08.2014 - 23:1