Ich lass das mal wieder erblühen hier x]
Hat einer eine Idee, wie ich das unschreiben kann, damit der nur die 5 letzten wars von {lolwars} anzeigt? :s
hab so die selbe .php wie olox sie gemacht hat
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
[u]{EXPLODE} <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2">Last Counter-Strike Wars vom {NAME}</b></th></tr><tr> {csswars} </tr></table>[/u] {EXPLODE} <br /> <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2">Last Warrock Wars vom {NAME}</b></th></tr><tr> {warrockwars} </tr></table>
<a href="javascript:history.back(1)"><b>«</b> {_lang_back}</a>
$tpl->set_out('teams', user_get_teams($uid),1); $tpl->out(2); $tpl->set_out('cs', get_last_user_wars($uid,'CS'),1); $tpl->out(3);
$tpl->set_out('teams', user_get_teams($uid),1); $tpl->set_out('cs', get_last_user_wars($uid,'CS'),2); $tpl->out(3);
<br /> <script language="javascript" type="text/javascript"> function details() { if(document.getElementById('more_details').style.display=='block'){ document.getElementById('more_details').style.display='none'; }else{ document.getElementById('more_details').style.display='block'; } } </script> <table border="0" width="100%"> <tr> <td colspan="2" style="padding-left:8px;" width="300" height="25"><u><b>• Personal Info</b></u></td> <td colspan="2" style="padding-left:8px;" width="270" height="25"><u><b>• Userpic</b></u></td> </tr><tr> <td width="15%" height="25">Nickname</td> <td height="25">{NAME}</td> <td colspan="2" valign="top" align="center" rowspan="13" style="vertical-align:middle">{AVATA}</td> </tr><tr> <td height="25">Status</td> <td height="25">{ONLINE}</td> </tr><tr> <td height="25">Titel</td> <td height="25">{USERTITEL}</td> </tr><tr> <td height="25">Kontakt</td> <td height="25">{EMAIL}</td> </tr><tr> <td height="25">ICQ</td> <td height="25">{ICQ}</td> </tr><tr> <td height="25">Homepage</td> <td height="25">{HOMEPAGE}</td> </tr> <tr> <td height="25">Geschlecht</td> <td height="25">{GESCHLECHT}</td> </tr><tr> <td height="25">Geburtstag</td> <td height="25">{GEBDATUM} {ALTER}</td> </tr><tr> <td height="25">Sternzeichen</td> <td height="25">{STERNZEICHEN}</td> </tr><tr> <td height="25">Wohnort</td> <td height="25">{WOHNORT} {STAAT}</td> </tr><tr> <td height="25">Registriert</td> <td height="25">{JOINED}</td> </tr><tr> <td height="25">Last Login</td> <td height="25">{LASTAK} Uhr</td> <tr> <td height="25">IM Messanger</td> <td height="25"><a href="javascript:void(0)" onclick="javascript:chatWith({UID},'{NAME}')">IM Fenster öffnen</a></td> </tr><tr><td colspan="4"> </td></tr><tr> <td colspan="2" style="padding-left:8px;" width="320" height="25"><u><b>• More Infos</b></u></td> <td colspan="2" style="padding-left:8px;" width="250" height="25"><u><b>• Statistic</b></u></td> </tr><tr> <td height="25">Usergallerie</td> <td height="25">{GALLERIE_EINTRAEGE} (<a href="index.php?user-usergallery-{UID}">ansehen)</a></td> <td height="25" width="20%">Forumtopics</td> <td height="25">{FORUMTOPICS}</td> </tr><tr> <td height="25">Gästebuch</td> <td height="25">{GB_EINTRAEGE}</td> <td height="25">Newstopics</td> <td height="25">{NEWSTOPICS}</td> </tr><tr> <td height="25">Private Mail</td> <td height="25"><a href="index.php?forum-privmsg-new=0&empfid={UID}">schreiben</a></td> <td height="25">Newsposts</td> <td height="25">{NEWSPOSTS}</td> </tr><tr> <td height="25">More Details</td> <td height="25"><div id="nav"><a href="javascript:onClick=details()">anzeigen</a></div></td> <td height="25">Forumposts</td> <td height="25">{POSTS}</td> </tr><tr><td colspan="4"> </td></tr><tr> <td colspan="4" style="padding-left:8px;" width="320" height="25"><u><b>• Signatur</b></u></td> </tr><tr> <td height="25" colspan="4" valign="top">{SIGNATUR}</td> </tr><tr><td colspan="4"> </td></tr><tr> <td colspan="4"><div id="more_details" style="display:none"><table>{profilefields}</table></div></td> </tr> </table> <br /> {EXPLODE} <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2">Mitglied folgender Squads</b></th></tr><tr> {teams} </tr></table> {EXPLODE} <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2">Last Counter-Strike Wars vom {NAME}</b></th></tr><tr> {cs} </tr></table> {EXPLODE} <br /> <a href="javascript:history.back(1)"><b>«</b> {_lang_back}</a>
function get_last_user_wars($userid,$game,$limit = 5){ global $lang; $s = ''; $q = db_query("SELECT `wid` FROM `prefix_warmember` WHERE `uid` = '".$userid."' AND `aktion` = '1' ORDER BY `wid` DESC LIMIT ".$limit); if (db_num_rows($q) > 0 ) { $wids = array(); while ($row = db_fetch_object($q)) { $wids[] = $row->wid; } $wids = implode(', ',$wids); } if( !empty($wids) ) { $erg = db_query("SELECT `id`, `oid`, `land`, `owp`, `opp` FROM `prefix_wars` WHERE `id` IN ($wids) AND `status` = '3' AND `game` = '".$game."'"); if (db_num_rows($erg) > 0 ) { while ($r = db_fetch_assoc($erg)) { if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $r['tag'] = get_opponent_details('tag', $r['oid']); $r['land'] = get_opponent_details('land', $r['oid']); if ( $r['opp'] == $r['owp'] ) { $bild = 'include/images/icons/pad.gif'; $color = '#f0770d'; } elseif ( $r['opp'] < $r['owp'] ) { $bild = 'include/images/icons/win.gif'; $color = '#558e3d'; } elseif ( $r['opp'] > $r['owp'] ) { $bild = 'include/images/icons/los.gif'; $color = '#a91d1d'; } $s .= '<td class="'.$class.'" width="1%"><img src="'.$bild.'" alt="" / ></td><td class="'.$class.'" width="99%"><div style="width:60%; float:left"><img src="include/images/flags/'.$r['land'].'" alt="'.$r['land'].'"/> <a href="index.php?wars-more-'.$r['id'].'">'.$r['tag'].'</a></div><div style="float:left; text-align:center; color:'.$color.'; width:20%;">'.$r['owp'].':'.$r['opp'].'</div></div><div style="float:left; text-align:right; width:20%;"><a href="index.php?wars-more-'.$r['id'].'">'.$lang['more'].'</a></div></td></tr>'; } } else { $s .= '<td class="Cmite" width="10%">Keine Wars</td>'; } } else { $s .= '<td class="Cmite" width="10%">Keine Wars</td>'; } return ($s); }
MySQL Error: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''5'' at line 1 in Query: SELECT `wid` FROM `ic1_warmember` WHERE `uid` = '1' AND `aktion` = '1' ORDER BY `wid` DESC LIMIT '5' Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:51 -- db_check_error(...) @ user_details.php:27 -- db_query(...) @ user_details.php:183 -- get_last_user_wars(...) @ user.php:26 -- require_once(...) @ index.php:31 -- require_once(...) Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/vhosts/5000157536/next-tactical-fighters.de/atf-zone.de/htdocs/include/includes/func/db/mysql.php on line 72
<?php # Copyright by: Manuel Staechele # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); function user_get_teams ($uid) { $erg = db_query("SELECT b.name, c.name as posi FROM prefix_groupusers a LEFT JOIN prefix_groups b ON b.id = a.gid LEFT JOIN prefix_groupfuncs c ON a.fid = c.id WHERE a.uid = ".$uid); if (db_num_rows($erg) > 0 ) { while ($r = db_fetch_assoc($erg)) { if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $l .= '<td class="'.$class.'" width="70%">'.$r['name'].'</td><td class="'.$class.'" width="30%">'.$r['posi'].'</td></tr>'; } } else { $l .= '<td class="Cmite" width="10%">Keine Teams</td>'; } return ($l); } function get_last_user_wars($userid,$game,$limit = 5){ $s = ''; $q = db_query("SELECT `wid` FROM `prefix_warmember` WHERE `uid` = '".$userid."' AND `aktion` = '1' ORDER BY `wid` DESC LIMIT '".$limit."'"); if (db_num_rows($q) > 0 ) { $wids = array(); while ($row = db_fetch_object($q)) { $wids[] = $row->wid; } $wids = implode(', ',$wids); } if( !empty($wids) ) { $erg = db_query("SELECT `id`, `oid`, `wlp`, `land`, `owp`, `opp` FROM `prefix_wars` WHERE `id` IN ($wids) AND `status` = '3' AND `game` = '".$game."'"); if (db_num_rows($erg) > 0 ) { while ($r = db_fetch_assoc($erg)) { if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $r['tag'] = get_opponent_details('tag', $r['oid']); $r['land'] = get_opponent_details('land', $r['oid']); if ($r['wlp'] == 1) { $bild = 'include/images/icons/win.gif'; $color = '#558e3d'; } elseif ($r['wlp'] == 2) { $bild = 'include/images/icons/los.gif'; $color = '#a91d1d'; } elseif ($r['wlp'] == 3) { $bild = 'include/images/icons/pad.gif'; $color = '#f0770d'; } $s .= '<td class="'.$class.'" width="1%"><img src="'.$bild.'" alt="" / ></td><td class="'.$class.'" width="99%"><div style="width:60%; float:left"><img src="include/images/flags/'.$r['land'].'" alt="'.$r['land'].'"/> <a href="index.php?wars-more-'.$r['id'].'">'.$r['tag'].'</a></div><div style="float:left; text-align:center; color:'.$color.'; width:20%;">'.$r['owp'].':'.$r['opp'].'</div></div><div style="float:left; text-align:right; width:20%;"><a href="index.php?wars-more-'.$r['id'].'">'.$lang['more'].'</a></div></td></tr>'; } } else { $s .= '<td class="Cmite" width="10%">Keine Wars</td>'; } } else { $s .= '<td class="Cmite" width="10%">Keine Wars</td>'; } return ($s); } $ar['profilefields'] = $l; $tpl->set_ar_out($ar,0); $tpl->set_out('teams', user_get_teams($uid),1); $tpl->set_out('cod7wars', get_last_user_wars($uid,'CoD7'),2); $tpl->out(3);
{EXPLODE} <table width="100%" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead"> <th colspan="2">Last Black Ops Wars von {NAME}</b></th></tr><tr> {cod7wars} </tr></table>
if (db_num_rows($erg) > 0 ) { while ($r = db_fetch_assoc($erg)) { if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $r['tag'] = get_opponent_details('tag', $r['oid']); $r['land'] = get_opponent_details('land', $r['oid']); if ($r['wlp'] == 1) { $bild = 'include/images/icons/win.gif'; $color = '#558e3d'; } elseif ($r['wlp'] == 2) { $bild = 'include/images/icons/los.gif'; $color = '#a91d1d'; } elseif ($r['wlp'] == 3) { $bild = 'include/images/icons/pad.gif'; $color = '#f0770d'; }
'cs' => get_last_user_wars($uid,'CS'),
SELECT mtyp FROM prefix_wars GROUP BY mtyp
function get_last_user_wars($userid,$game){ $s = ''; $q = db_query("SELECT `wid` FROM `xic_warmember` WHERE uid = '".$userid."' AND aktion = '1' ORDER BY wid DESC LIMIT 5"); if (db_num_rows($q) > 0 ) { $wids = array(); while ($row = db_fetch_object($q)) { $wids[] = $row->wid; } $wids = implode(', ',$wids); } if( !empty($wids) ) { $erg = db_query("SELECT id, gegner, tag, wlp, land, owp, opp, gegner, game, mtyp FROM xic_wars WHERE id IN ($wids) AND status = '3' AND game = '".$game."'"); if (db_num_rows($erg) > 0 ) { while ($r = db_fetch_assoc($erg)) { if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $r['tag'] = ( empty($r['tag']) ? $r['gegner'] : $r['tag'] ); if ($r['wlp'] == 1) { $bild = 'include/images/icons/win.gif'; $color = '#558e3d'; } elseif ($r['wlp'] == 2) { $bild = 'include/images/icons/los.gif'; $color = '#a91d1d'; } elseif ($r['wlp'] == 3) { $bild = 'include/images/icons/pad.gif'; $color = '#f0770d'; } $s .= '<tr class="Cmite"> <td align="left" valign="bottom"><img src="include/images/flags/'.$r['land'].'" alt="'.$r['land'].'"/> <a href="index.php?wars-more-'.$r['id'].'">'.((strlen($r['gegner'])<20) ? $r['gegner'] : substr($r['gegner'],0,20).'...').'</a></td> <td>'.$r['mtyp'].'</td> </tr>'; } } else { $s .= ''; } } else { $s .= '<td class="Cmite" align="left" colspan="2">Keine Wars</td>'; } return ($s); }
function get_last_user_wars($userid,$game){ $s = ''; $q = db_query("SELECT `wid` FROM `xic_warmember` WHERE uid = '".$userid."' AND aktion = '1' ORDER BY wid DESC LIMIT 5"); if (db_num_rows($q) > 0 ) { $wids = array(); while ($row = db_fetch_object($q)) { $wids[] = $row->wid; } $wids = implode(', ',$wids); } if( !empty($wids) ) { $erg = db_query("SELECT id, gegner, tag, wlp, land, owp, opp, gegner, game, mtyp FROM xic_wars GROUP BY mtyp"); if (db_num_rows($erg) > 0 ) { while ($r = db_fetch_assoc($erg)) { if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $r['tag'] = ( empty($r['tag']) ? $r['gegner'] : $r['tag'] ); if ($r['wlp'] == 1) { $bild = 'include/images/icons/win.gif'; $color = '#558e3d'; } elseif ($r['wlp'] == 2) { $bild = 'include/images/icons/los.gif'; $color = '#a91d1d'; } elseif ($r['wlp'] == 3) { $bild = 'include/images/icons/pad.gif'; $color = '#f0770d'; } $s .= '<tr class="Cmite"> <td align="left" valign="bottom"><img src="include/images/flags/'.$r['land'].'" alt="'.$r['land'].'"/> <a href="index.php?wars-more-'.$r['id'].'">'.((strlen($r['gegner'])<20) ? $r['gegner'] : substr($r['gegner'],0,20).'...').'</a></td> <td>'.$r['mtyp'].'</td> </tr>'; } } else { $s .= ''; } } else { $s .= '<td class="Cmite" align="left" colspan="2">Keine Wars</td>'; } return ($s); }
'Matches' => get_last_user_wars($uid,'League of Legends'),
Geschlossen | ||
Zurück zu Allgemein |