ich versuche eine Statistik im Profil mit auszugeben, was auch funktioniert. Desweiteren würde ich gerne die Tuniere und dazugehörigen Spiele anzeigen. Das mit den Tunieren funktioniert auch.
Mein Prob. ist das für die Tuniere immer nur ein Spiel angezeigt wird.
hier mal die Dateien
user_details.php
<?php # Copyright by: Manuel # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); $uid = intval($menu->get(2)); $ges_ar = array ('wurstegal', 'maennlich', 'weiblich'); $abf = 'SELECT * FROM prefix_user WHERE id = "'.$uid.'"'; $erg = db_query($abf); if (db_num_rows($erg)) { $row = db_fetch_assoc($erg); if (!is_numeric($row['geschlecht'])) { $row['geschlecht'] = 0; } if (file_exists($row['avatar'])) { $row['avatar'] = '<br /><br /><img src="'.$row['avatar'].'" alt="User Pic" border="0" /><br />'; } elseif ($allgAr['forum_default_avatar']) { $row['avatar'] = '<br /><br /><img src="include/images/avatars/'.$ges_ar[$row['geschlecht']].'.png" alt="User Pic" border="0" /><br />'; } else { $row['avatar'] = ''; } $regsek = mktime ( 0,0,0, date('m'), date('d'), date('Y') ) - $row['regist']; $regday = round($regsek / 86400); $postpday = ( $regday == 0 ? 0 : round($row['posts'] / $regday, 2 ) ); $s = db_result(db_query("SELECT COUNT(name) FROM prefix_event_aus WHERE name ='".$row['spieler_name']."'"),0); $v = db_result(db_query("SELECT COUNT(xyz) FROM prefix_event_aus WHERE name ='".$row['spieler_name']."' AND xyz = 2"),0); $g = db_result(db_query("SELECT COUNT(xyz) FROM prefix_event_aus WHERE name ='".$row['spieler_name']."' AND xyz = 1"),0); $tu = db_result(db_query("SELECT COUNT(phase) FROM prefix_event_aus WHERE name ='".$row['spieler_name']."' AND phase LIKE 'Finale' AND xyz = 1"),0); if($s > 0){ $p = round(($g/$s)*100,2); }else{ $p ='-'; } $turnier = db_result(db_query("SELECT COUNT(DISTINCT(eventid)) from prefix_event_aus WHERE spid ='".$uid."'"),0); $points = db_result(db_query("SELECT SUM(points) FROM prefix_event_aus WHERE spid ='".$uid."'"),0); if($s > 0){ $pt = round(($points/$turnier),2); }else{ $pt ='-'; } $gws1 = db_result(db_query("SELECT COUNT(set1_1) FROM prefix_game WHERE id1 ='".$uid."'AND set1_1 > set1_2 AND id2 != 335 "),0); $gws2 = db_result(db_query("SELECT COUNT(set2_1) FROM prefix_game WHERE id1 ='".$uid."'AND set2_1 > set2_2 AND id2 != 335 "),0); $gws3 = db_result(db_query("SELECT COUNT(set3_1) FROM prefix_game WHERE id1 ='".$uid."'AND set3_1 > set3_2 AND id2 != 335 "),0); $gws4 = db_result(db_query("SELECT COUNT(set4_1) FROM prefix_game WHERE id1 ='".$uid."'AND set4_1 > set4_2 AND id2 != 335 "),0); $gws5 = db_result(db_query("SELECT COUNT(set5_1) FROM prefix_game WHERE id1 ='".$uid."'AND set5_1 > set5_2 AND id2 != 335 "),0); $gws = $gws1+$gws2+$gws3+$gws4+$gws5; $vrs1 = db_result(db_query("SELECT COUNT(set1_1) FROM prefix_game WHERE id2 ='".$uid."'AND set1_1 > set1_2 AND id1 != 335 "),0); $vrs2 = db_result(db_query("SELECT COUNT(set2_1) FROM prefix_game WHERE id2 ='".$uid."'AND set2_1 > set2_2 AND id1 != 335 "),0); $vrs3 = db_result(db_query("SELECT COUNT(set3_1) FROM prefix_game WHERE id2 ='".$uid."'AND set3_1 > set3_2 AND id1 != 335 "),0); $vrs4 = db_result(db_query("SELECT COUNT(set4_1) FROM prefix_game WHERE id2 ='".$uid."'AND set4_1 > set4_2 AND id1 != 335 "),0); $vrs5 = db_result(db_query("SELECT COUNT(set5_1) FROM prefix_game WHERE id2 ='".$uid."'AND set5_1 > set5_2 AND id1 != 335 "),0); $vrs = $vrs1+$vrs2+$vrs3+$vrs4+$vrs5; $smi1 = db_result(db_query("SELECT SUM(set1_1) FROM prefix_game WHERE id1 ='".$uid."' AND id2 != 335 "),0); $smi2 = db_result(db_query("SELECT SUM(set2_1) FROM prefix_game WHERE id1 ='".$uid."' AND id2 != 335 "),0); $smi3 = db_result(db_query("SELECT SUM(set3_1) FROM prefix_game WHERE id1 ='".$uid."'AND id2 != 335 "),0); $smi4 = db_result(db_query("SELECT SUM(set4_1) FROM prefix_game WHERE id1 ='".$uid."'AND id2 != 335"),0); $smi5 = db_result(db_query("SELECT SUM(set5_1) FROM prefix_game WHERE id1 ='".$uid."'AND id2 != 335 "),0); $smi = $smi1+$smi2+$smi3+$smi4+ $smi5; $spl1 = db_result(db_query("SELECT SUM(set1_1) FROM prefix_game WHERE id2 ='".$uid."'AND id1 != 335 "),0); $spl2 = db_result(db_query("SELECT SUM(set2_1) FROM prefix_game WHERE id2 ='".$uid."'AND id1 != 335 "),0); $spl3 = db_result(db_query("SELECT SUM(set3_1) FROM prefix_game WHERE id2 ='".$uid."'AND id1 != 335 "),0); $spl4 = db_result(db_query("SELECT SUM(set4_1) FROM prefix_game WHERE id2 ='".$uid."'AND id1 != 335 "),0); $spl5 = db_result(db_query("SELECT SUM(set5_1) FROM prefix_game WHERE id2 ='".$uid."'AND id1 != 335 "),0); $spl = $spl1+$spl2+$spl3+$spl4+$spl5; $ges = $gws + $vrs; if($s > 0){ $sp = round(($gws/$ges)*100,2); }else{ $sp ='-'; } if($s > 0){ $sq = round(($smi/$spl),2); }else{ $sq ='-'; } $ar = array ( 'id' => $uid, 'NAME' => $row['name'], 'JOINED' => date('d M Y',$row['regist']), 'LASTAK' => date('d M Y - H:i',$row['llogin']), 'POSTS' => $row['posts'], 'postpday' => $postpday, 'RANG' => userrang ($row['posts'],$uid), 'AVATA' => $row['avatar'], 'spname' => $row['spieler_name'], 'verein'=> $row['verein'], 'sig' => $row['sig'], 'sig1' => $row['sig1'], 'vname' => $row['vname'], 'nname' => $row['nname'], 'gebdatum' => $row['gebdatum'], 'anmeldung'=> $anmeldung, 'turniere' => $turnier, 'points' => $points, 'pt' => $pt, 't' => '', 's' => $s, 'g' => $g, 'v' => $v, 'p' =>$p, 'tu'=>$tu, 'ges'=>$ges, 'spl'=>$gws, 'pq'=>$sq, 'smi'=>$vrs, 'gws' =>$smi, 'vrs' =>$spl, 'sq' => $sp ); if ($ar['gebdatum'] != '0000-00-00'){ list($y,$m,$d) = explode('-',$ar['gebdatum']); $alter = date('Y') - $y; if (mktime(0,0,0) > mktime(0,0,0,$m,$d)) $alter-- ; $ar['AGE'] = $alter-1; } else { $ar['AGE'] = '-'; } if ( !loggedin() ) { $ar['anmeldung'] = ''; }else{ $ar['anmeldung'] = '<a class="userprofil" href="index.php?events">ZU TURNIEREN ANMELDEN</a>'; } $title = $allgAr['title'].' :: Users :: Details von '.$row['name']; $hmenu = $extented_forum_menu.'Spierler-Profil<b> » </b> '.$row['spieler_name'].$extented_forum_menu_sufix; $design = new design ( $title , $hmenu, 1); $design->header(); $tpl = new tpl ( 'user/userdetails' ); $l = profilefields_show ( $uid ); $ar['rowspan'] = 4 + substr_count($l, '<tr><td class="'); $ar['profilefields'] = $l; $tpl->set_ar_out($ar,0); $abe = db_query("SELECT DISTINCT(eventid) AS eventid,event,tpid,gid,sp1id,sp2id,set_1,set_2 FROM prefix_game WHERE id1 = '".$uid."' OR id2 ='".$uid."' GROUP BY eventid"); while($row1 = db_fetch_assoc($abe)){ $abb = db_query("SELECT DISTINCT(eventid) ,id,event,tpid,gid,sp1id,sp2id,set_1,set_2 FROM prefix_game WHERE id1 = '".$uid."' AND eventid ='".$row1['eventid']."' OR id2 ='".$uid."' AND eventid ='".$row1['eventid']."' GROUP BY eventid"); while($row2 = db_fetch_assoc($abb)){ $ar1=array ( 'tname' => $row1['event'], 'evid'=> $row1['eventid'], ); $tpl->set_ar_out($ar1,1); $ar2=array ( 'id' =>$row2['id'], 'phase'=> $row2['tpid'], 'gid'=> $row2['gid'], 'sp1id' => $row2['sp1id'], 'set_1' => $row2['set_1'], 'set_2' => $row2['set_2'], 'sp2id' => $row2['sp2id'], ); $tpl->set_ar_out($ar2,2); } $tpl->out(3); } echo $ar1['id']; $tpl->out(4); } else { $title = $allgAr['title'].' :: Users :: User nicht gefunden'; $hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a> '.$extented_forum_menu_sufix; $design = new design ( $title , $hmenu, 1); $design->header(); echo 'Der Benutzer wurde nicht gefunden bzw. die Seite wurde nicht richtig aufgerufen.<br />'; } $tpl->out(5); $design->footer(); ?>
userdetails.htm
<script type="text/javascript"> function klapp(Id) { var KlappText = document.getElementById('Lay'+Id); var KlappBild = document.getElementById('Pic'+Id); var jetec_Minus="inhalt/codeschnipsel/minus.gif", jetec_Plus="inhalt/codeschnipsel/plus.gif"; if (KlappText.style.display == 'none') { KlappText.style.display = 'block'; KlappBild.src = jetec_Minus; } else { KlappText.style.display = 'none'; KlappBild.src = jetec_Plus; }} </script> <style type="text/css"> <!-- .spname { font-size: xx-large; color: #FFF; font-style:italic; background:#000 ; } .border tr .Cnorm .spname strong { } .na { color: #000; font-size:18px; font-weight:bold; float:left; text-align:left; } .naa { color: #000; font-size:12px; text-align:left; } .n { color: #fff; font-size:11px; text-align: center; border-right:solid; border-right-width:1px; border-right-color:#FFF; border-top:solid; border-top-width:1px; border-top-color:#FFF; } .ooo { text-align: right; } .stat { background-color:#000; } a.men { color:#FFF; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none; float:left; text-align:left; vertical-align:middle; } a.men:hover { color:#e2002e; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-decoration: none; vertical-align:middle; font-style:italic; } --> </style> <table width="100%" cellpadding="0" cellspacing="0" class="border"> <tr> <td width="284" rowspan="108" class="Cnormu"align ="center" valign="middle">{AVATA} </td> <td width="11" rowspan="108" class="Cnormu" valign="top"> </td> <td width="10" bgcolor="#fff"><table width="597px" border="0"> <tr> <td><span class="spname"><strong> {spname} </strong></span></td> </tr> </table></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF"><hr color="#000000" /></td> </tr> <tr> <td colspan="2" class="Cnor"><strong>NAME:</strong> <p>{vname} {nname} </p></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF" ><hr color="#000000" /></td> </tr> <tr> <td colspan="2" class="Cnor"><strong>ALTER:</strong> <p>{AGE} JAHRE</p></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF" ><hr color="#000000" /></td> </tr> <tr> <td colspan="2" class="Cnor"><strong>VEREIN:</strong> <p>{verein}</p></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF" ><hr color="#000000" /></td> </tr> <tr> <td colspan="2" class="Cnor"><strong>MOTTO:</strong></p> <p>{sig}</p></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF"><hr color="#000000" /></td> </tr> <tr> <td colspan="2" class="Cnor"><strong>ZIEL FÜR 2011:</strong> <p>{sig1}</p></td> </tr> <tr> <td colspan="2" bgcolor="#FFFFFF"><hr color="#000000" /></td> </tr> </table> <br /> <table class="Cnor" width="890px" border="0" > <tr> <td class="stat"><a class="men" href="javascript:klapp('1')"> STATISTIK</a><div class="ans" id="Lay1" style="display: none;"><br /><table width="890px" border="0" > <tr> <td width="42" class="n">Punkte</td> <td width="82" class="n">Ges. Turniere</td> <td width="95" class="n">Pkt. pro Turnier</td> <td width="44" class="n">Spiele</td> <td width="59" class="n">Gew. Sp.</td> <td width="59" class="n">Verl. Sp.</td> <td width="74" class="n">Gew.quote</td> <td width="69" class="n">Gesp. Sätze</td> <td width="52" class="n">Gew. Sätze</td> <td width="51" class="n">Verl. Sätze</td> <td width="66" class="n">Satzquote</td> <td width="66" class="n">Satz Pkt. +</td> <td width="56" class="n">Satz Pkt. -</td> <td width="27" class="n">Pkt.</td> </tr> <tr> <td width="42" class="n">{points}</td> <td width="82" class="n">{turniere}</td> <td width="95" class="n">{pt}</td> <td width="44" class="n">{s}</td> <td width="59" class="n">{g}</td> <td width="59" class="n">{v}</td> <td width="74" class="n">{p}%</td> <td width="69" class="n">{ges}</td> <td width="52" class="n">{spl}</td> <td width="51" class="n">{smi}</td> <td width="66" class="n">{sq}%</td> <td width="66" class="n">{gws}</td> <td width="56" class="n">{vrs}</td> <td width="27" class="n">{pq}</td> </tr> </table> </div></td></tr></table> <br /><br />{EXPLODE} <table class="Cnor" width="890px" border="0" > <tr> <td class="stat"><a class="men" href="javascript:klapp('{evid}')"> {tname}</a><div class="ans" id="Lay{evid}" style="display: none;"><br /> {EXPLODE}<table width="890" border="0"> <tr> <td width="82" class="n">{phase}</td> <td width="38"align="center" class="n">{gid}</td> <td width="317" class="n">{sp1id}</td> <td width="48"align="center" class="n">{set_1}</td> <td width="9" align="center" class="n" >:</td> <td width="48"align="center" class="n">{set_2}</td> <td width="318" class="n">{sp2id}</td> </tr> </table> {EXPLODE} </div></td> </tr></table>{EXPLODE} <br /> <table width="100%" border="0" align="center"> <tr> <td align="right"><a href="javascript:history.back(1)"> <span class="ooo"><b>«</b>{_lang_back}</span></a> </td> </tr> </table>
vllt. könnt Ihr helfen?
thanx samo