Zitat geschrieben von
Mairu
In der jeweils aufgerufenen Datei also wars.php oder user/details.php (in include/contents) mal nach db_num_rows suchen, dort ist der Aufruf, der fehlerhaft ist, da ihm kein gültiges SQL Ergebnis übergeben wird, ich nehme mal an, dass ein Parameter einer Abfrage nicht gesetzt ist.
Hier mal die wars.php mit der Stelle wo db_num_rows steht:
$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 = 'Cnorm'; } 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);
Hier mal die user_details.php. Hier sind mehrere Stellen mit der Abfrage:
<?php
# Copyright Original Dateien und Einträge by: Manuel Staechele
# Support: www.ilch.de
# Profil Mod by: orsnipe
# Profil Mod Code by: orsnipe, IRvD, Lord|Schirmer & www.ilch.de/forum
# Profil Mod Copyright by: www.capfx.de
defined ('main') or die ( 'no direct access' );
$uid = $menu->get(2);
######### Zufalls Gallerybild
$randbild = '';
$res = db_query('SELECT id, endung FROM `prefix_usergallery` WHERE `uid` = "'.$uid.'" ORDER BY rand() LIMIT 5');
if (db_num_rows($res))
{
while ($row = db_fetch_assoc($res))
{
$randbild .= '<a target="_new" href="/include/images/usergallery/img_'.$row['id'].'.'.$row['endung'].'"><img class="bilderrahmen" src="include/images/usergallery/img_thumb_'.$row['id'].'.'.$row['endung'].'" border="2" width="80" height="60"></a> ';
}
}
else
{
$randbild = '<img src="include/images/profilmod/no_usergallery.jpg" border="0">';
}
########## Ende
#Hits hochzählen
if ($_SESSION['authid'] != $uid and !isset($_SESSION['visited_profils'][$uid])) {
$_SESSION['visited_profils'][$uid] = true;
db_query("UPDATE prefix_user SET hits = hits + 1 WHERE id = ".$uid);
}
#Ende
#Squadanzeige im Profil
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 == '') { $class = ''; } else { $class = ''; }
$l .= '
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="derrand">
<tr>
<td class="inhalthintergrund" width="70%" style="padding-left:15px;">'.$r['name'].'</td>
<td class="inhalthintergrund" width="30%" height="25" style="text-align:center;">'.$r['posi'].'</td>
</tr>
</table>
';
}
} else {
$l .= '<table width="100%" border="0" cellspacing="1" cellpadding="0" class="derrand">
<tr>
<td class="inhalthintergrund" height="25" style="padding-left:15px;">Ist in keinem Team</td>
</tr>
</table>
';
}
return ($l);
}
########## Ende
#letzte Besucher
$lastbes_anz = 3; //Bei höhere Anzahl muss ggf. in der Datenbank die Größe der Felder bzw der Typ geändert werden
if ($_SESSION['authid'] != $uid AND $_SESSION['authid'] != 0) {
$lb = db_fetch_object(db_query('SELECT last_bes, last_user_time FROM prefix_user WHERE id = '.$uid));
$lba = explode('#',$lb->last_bes);
$lbt = explode('#',$lb->last_user_time);
$i = array_search($_SESSION['authid'],$lba);
if ($i !== false) {
unset($lba[$i]); unset($lbt[$i]);
} elseif (count($lba) >= $lastbes_anz) {
$lba = array_slice($lba,0,$lastbes_anz-1);
$lbt = array_slice($lbt,0,$lastbes_anz-1);
}
array_unshift($lba,$_SESSION['authid']);
array_unshift($lbt,time());
$i_lb = implode('#',$lba);
$i_lbt = implode('#',$lbt);
db_query("UPDATE prefix_user SET last_bes = '$i_lb', last_user_time = '$i_lbt' WHERE id = $uid");
}
#Ende
#### punkte
if ( $row['posts'] != 0 AND userbwpoints($row['erstid']) > 0 ) {
$row['USERPOINTS'] = 'Punkte: '.userbwpoints($row['erstid']).'<br />';
} else {
$row['USERPOINTS'] = '';
}
#### ENDE
############### Gameicons Ausgabe #######################
$ausgabe = '';
$str = @db_result ( db_query ("SELECT `games` FROM prefix_user WHERE id = ".$uid) , 0 );
$gamesarr = explode("#", $str);
$style = 'float:left;width:px;height:100px;border:1px;border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
border-bottom-right-radius: 5px;
border-top-right-radius: 5px;padding: 1px;-moz-box-shadow: 0px 2px 3px #000;
-webkit-box-shadow: 0px 1px 3px #000;
box-shadow: 0px 1px 3px #000;margin:1px;padding:0';
foreach($gamesarr as $value)
{
if (file_exists('include/images/wargames/'.$value) and !empty($value) )
{
$ausgabe .= '<img style="'.$style.'" onmouseover="Tip(\'<div align="center"><img style="width:180px;height:254px;border:none" src="include/images/spiele/'.$value.'"><br>'.substr($value,0,-4).'</div>\')" onmouseout="UnTip()" src="include/images/spiele/'.$value.'" alt="'.substr($value,0,-4).'" /> ';
} else {
$ausgabe .= '';
}
}
##################################################
############### Auszeichnung Ausgabe #######################
$ausgaben = '';
$str = @db_result ( db_query ("SELECT `auszeichnung` FROM prefix_user WHERE id = ".$uid) , 0 );
$auszeichnungarr = explode("#", $str);
$style = 'float:left;width:px;height:100px;border:1px;border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
border-bottom-right-radius: 5px;
border-top-right-radius: 5px;padding: 1px;-moz-box-shadow: 0px 2px 3px #000;
-webkit-box-shadow: 0px 1px 3px #000;
box-shadow: 0px 1px 3px #000;margin:1px;padding:0';
foreach($auszeichnungarr as $value)
{
if (file_exists('include/images/profilmod/auszeichnung/'.$value) and !empty($value) )
{
$ausgaben .= '<img style="'.$style.'" onmouseover="Tip(\'<div align="center"><img style="width:180px;height:px;border:none" src="include/images/profilmod/auszeichnung/'.$value.'"><br>'.substr($value,0,-4).'</div>\')" onmouseout="UnTip()" src="include/images/profilmod/auszeichnung/'.$value.'" alt="'.substr($value,0,-4).'" /> ';
} else {
$ausgaben .= '';
}
}
##################################################
include('user_infos.php');
$abf8 = "SELECT * FROM prefix_online WHERE uid = '".$uid."'";
$erg8 = db_query($abf8);
$row8 = db_fetch_assoc($erg8);
if(isset($row8['uid'])){
$online = '<font color="#009900">online</font>';
}else{
$online = '<b>offline</b>';
}
### Skillausgabe
$row['SKILLS'] = '';
$ergS = db_query('SELECT * FROM `prefix_skill` ORDER BY pos, name DESC');
while ($rowS = db_fetch_object($ergS)) {
if ($rowS->cat == 1) {
$row['SKILLS'] .= '
<tr>
<td colspan="2" class="hintergrund" height="20"></td>
</tr>
<tr>
<td colspan="2" class="hintergrundhead" height="20">' . $rowS->name . ' von ' . $row['name'] . '</td>
</tr>';
} else {
$insert = @db_result(db_query("SELECT `insert` FROM prefix_skill_daten WHERE `skill_id` = '". $rowS->id ."' AND `user_id` = '".$uid."'"),0);
if (empty($insert) or $insert == '') { $insert = '0'; }
$row['SKILLS'] .= '
<tr class="inhalthintergrund">
<td height="25"> <img src="include/images/profilmod/skill.png" border="0" alt="skill" /> ' . $rowS->name . '</td>
<td width="200" valign="bottom" background="include/images/profilmod/skala.png">
<table border="0" cellpadding="0" cellspacing="0" width="200" height="12" align="left">
<tr class="balkenhintergrund">
<td height="10" valign="middle"><div style="min-width: 1px; width:'.$insert.'%; height:10px; background:#000 url(include/images/profilmod/skill_balken.png) repeat scroll 0% 0% ; text-align: center">
<div style="width:200px; height:8px; text-align:center"><span class="skillangabe">'.$insert.'%</span></div>
</td>
</tr>
</table>
</td>
</tr>';
}
}
### Skillausgabe Ende
$ar = array (
'NAME' => $row['name'],
'HITS' => $row['hits'],
'JOINED' => date('d.m.Y',$row['regist']),
'LASTAK' => date('d.m.Y - H:i',$row['llogin']),
'POSTS' => $row['posts'],
'postpday' => $postpday,
'AUSGABE' => $ausgabe,
'AUSGABEN' => $ausgaben,
'RANDBILD' => $randbild,
'STATUSTEXT' => $statustext,
'UID' => $uid,
'RANG' => userrang ($row['posts'],$uid),
'RANGGRAFIK' => $row['rang'],
'AVATA' => $avatar,
'ONLINE' => $online,
'USERTITEL' => $usertitel,
'HOMEPAGE' => $homepage,
'GESCHLECHT' => $geschlecht,
'GEBDATUM' => $gebdatum,
'ALTER' => $alter,
'WOHNORT' => $wohnort,
'LASTUSER' => last_user($uid),
'MICH' => bbcode($row['mich']),
'CLANLOGO' => $clanlogo,
'CNAME' => $cname,
'CTAG' => $ctag,
'CSEITE' => $cseite,
'STEAMPRO' => $steampro,
'SYSTEM' => $system,
'SOUND' => $sound,
'HDD' => $hdd,
'MONITOR' => $monitor,
'INET' => $inet,
'HEADSET' => $headset,
'BOARD' => $board,
'PROZESOR' => $prozesor,
'RAM' => $ram,
'GRAFIK' => $grafik,
'TASTA' => $tasta,
'MAUS' => $maus,
'CPUBILD' => $cpubild,
'GPUBILD' => $gpubild,
'POSTEN' => $posten,
'LOGINS' => $row['logins'],
### Skills ###
'SKILLS' => $row['SKILLS'],
'POSTS' => $row['posts'],
'NEWSPOSTS' => $row6['newsposts'],
'POSTPDAY' => $postpday,
'FORUMTOPICS' => $row4['forumtopics'],
'NEWSTOPICS' => $row5['newstopics'],
'FORUMPOSTS' => $row7['forumposts'],
'KOMS' =>$row['koms'],
'PMGESENDET' => @db_result(db_query("SELECT COUNT(id) FROM `prefix_pm` WHERE `sid` = '".$uid."'"),0),
'PMGE' => @db_result(db_query("SELECT COUNT(ID) FROM `prefix_pm`"),0),
'POSTSGE' => @db_result(db_query("SELECT COUNT(ID) FROM `prefix_posts`"),0),
'POSTSU' => @db_result(db_query("SELECT COUNT(id) FROM `prefix_posts` WHERE `erst` = '".$row['name']."'"),0),
'NEWS' => @db_result(db_query("SELECT COUNT(news_id) FROM `prefix_news` WHERE `user_id` = '".$uid."'"),0),
'NEWSGE' => db_result(db_query("SELECT COUNT(news_id) FROM `prefix_news`"),0),
'TOPICS' => @db_result(db_query("SELECT COUNT(id) FROM `prefix_topics` WHERE `erst` = '".$row['name']."'"),0),
'TOPICSGE' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_topics`"),0),
'KOMGE' => db_result(db_query("SELECT COUNT(ID) FROM `prefix_koms`"),0),
'KOMU' => db_result(db_query("SELECT COUNT(id) FROM prefix_koms WHERE name='".$row['name']."'"),0),
'POLLGE' => db_result(db_query("SELECT COUNT(poll_id) FROM prefix_poll WHERE recht = '2' "),0),
'POLLU' => db_result(db_query("SELECT COUNT(*) FROM prefix_poll WHERE recht = '2' AND text REGEXP '#".$uid."(#|$)'"),0),
'SHOUTGE' => db_result(db_query("SELECT COUNT(id) FROM prefix_shoutbox"),0),
'SHOUTU' => db_result(db_query("SELECT COUNT(id) FROM prefix_shoutbox WHERE nickname = '".$row['name']."'"),0),
'PMGES' => @db_result($pmGes,0),
'ANZBAL' => '<img src="/include/images/vote/votebalkenbox.gif" height="5" width="'.@round($pmGes/$pmGes *267).'" align="left" alt="">',
##############################
'NEXT' => $next,
'NEXTRANK' => $nextrank,
'POINTSLEFT' => $pointsleft,
'ERFAHRUNG' => $erfahrung,
'SIGNATUR' => bbcode($row['sig']),
'STAAT' => $staat,
'STERNZEICHEN' => $sternzeichen,
'GALLERIE_EINTRAEGE' => $gallery_eintraege,
'EMAIL' => $email,
'ICQ' => $icq,
'FACEBOOK' => $facebook,
'YOUTUBE' => $youtube,
'CD' => $cd,
'TWITTER' => $twitter,
'BATTLELOG' => $battlelog,
'GOOGLE' => $google,
'STEAM' => $steam,
'XFIRE' => $xfire,
'TEAMSPEAK' => $teamspeak,
'TEAMS' => user_get_teams ($uid),
);
$title = $allgAr['title'].' :: Users :: Details von '.$row['name'];
$hmenu = $extented_forum_menu.'<a class="smalfont" href="?user">Users</a><b> » </b> <a href=index.php?user-details-'.$uid.'>Details von '.$row['name']."</a>".$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);
/*Freunde*/
$ges_ar = array ('wurstegal', 'maennlich', 'weiblich');
$dif = date('Y-m-d H:i:s', time() - 60);
$sql = db_query("SELECT a.fid as aktfid, b.id, b.name, IF(c.uptime > '$dif','online','offline') as status, b.avatar, b.geschlecht
FROM `prefix_friends` a
LEFT JOIN `prefix_user` b ON a.fid = b.id
LEFT JOIN `prefix_online` c ON a.fid = c.uid
WHERE a.uid = {$uid} ORDER BY b.recht ASC, c.uptime DESC");
if (db_num_rows($sql) > 0 ) {
while ($r = db_fetch_assoc($sql)) {
if (!is_numeric($r['geschlecht'])) { $r['geschlecht'] = 0; }
if (file_exists($r['avatar'])) { $r['AVATAR'] = '<img src="'.$r['avatar'].'" alt="User Pic" border="0" width="100" height="100" />'; }
elseif ($allgAr['forum_default_avatar']) { $r['AVATAR'] = '<img src="include/images/avatars/'.$ges_ar[$r['geschlecht']].'.jpg" alt="User Pic" width="100" height="100" border="0" />'; }
else { $r['avatar'] = ''; }
$r['FREUNDNAME'] = $r['name'];
$r['FREUNDID'] = $r['id'];
$tpl->set_ar_out($r,1);
}
} else {
echo '<tr><td class="Cmite">keine Freunde</td></tr>';
}
$tpl->out(2);
/*Freunde Ende*/
$design->footer();
?>