ich bräuchte mal Hilfe
ich weiß nicht wie ich das machen kann das bei der Freundes liste
wen man ein die Freundschaft anbieten tut das das bei beiden eingetragen wird
und nicht nur bei den einen
das wehre super wen mir einer helfen könnte
ich Poste hier mal die Eingabe und die Ausgabe
die Eingabe
if ($menu->getA(3) == 'a') { $eintrag = @db_result(db_query('SELECT uid FROM prefix_friends WHERE fid="'.$uid.'" AND uid="'.$_SESSION['authid'].'" AND buddy="1" '),0); $user = @db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),0); $name = @db_result(db_query('SELECT name FROM prefix_user WHERE id='.$uid),0); $bet = "Erlaubnisanfrage!"; $txt = "Hallo ".$name.", der User ".$user." wartet auf ihre Freischaltung. Hier können sie den User sofort Freischalten: [url=index.php?freunde-f".$_SESSION['authid']."]Link[/url]"; if ($eintrag == '') { if ($uid > 0) { if ($user != $name) { if (db_query("INSERT INTO `prefix_friends` (uid,fid,uuid,ffid) VALUES ({$_SESSION['authid']}, $uid, $uid, {$_SESSION['authid']})")) { sendpm(1, $uid, $bet, $txt); $msg = 'Erfolgreich eingetragen.<br />'; } } else { $msg = "Du kannst dich nicht selbst adden!<br />"; } } } else { $msg ='Dieser User ist schon geaddet!'; } echo $msg; }
und die Ausgabe
//Ausgabe $tpl = new tpl('freunde'); $tpl->out(0); $dif = date('Y-m-d H:i:s', time() - 900); $sql = db_query("SELECT a.fid as fid, b.name,avatar,geschlecht, IF(c.uptime > '$dif','online','offline') as status FROM `prefix_friends` a LEFT JOIN `prefix_user` b ON a.fid = b.id LEFT JOIN `prefix_online` c ON a.fid = c.uid AND c.sid = (SELECT sid FROM `prefix_online` WHERE uid = fid ORDER BY uptime DESC LIMIT 1) WHERE a.uid = {$_SESSION['authid']} AND a.buddy = 1 ORDER BY status DESC"); while ($r = db_fetch_assoc($sql)) { $class = ($class=='Cnorm'?'Cmite':'Cnorm'); $color = ($color=='#e5e5e5'?'#B4C6D8':'#e5e5e5'); $name=@db_result(db_query('SELECT name,avatar, opt_pm FROM prefix_user WHERE id='.$r['fid']),0); if (file_exists($r['avatar'])) { $avatar = '<span><img src="'.$r['avatar'].'" height="85" width="75" alt="" border="0" /></span>'; } elseif ($r['avatar'] == "" && $r['geschlecht'] == "1") { $avatar = '<span><img src="include/images/avatars/male.jpg" height="85" width="75" alt="" border="0" /></span>'; } elseif ($r['avatar'] == "" && $r['geschlecht'] == "2") { $avatar = '<span><img src="include/images/avatars/female.jpg" height="85" width="75" alt="" border="0" /></span>'; } elseif ($r['avatar'] == "" && $r['geschlecht'] == "0") { $avatar = '<span><img src="include/images/avatars/xxx.gif" height="85" width="75" alt="" border="0" /></span>'; } if($r['geschlecht'] == 1){ $geschlecht = "männlich"; }elseif($r['geschlecht'] == 2){ $geschlecht = "weiblich"; }else{ $geschlecht = "unentschlossen"; } if ($gallery == '1'){ $gallery1 = '<a href="index.php?user-usergallery-'.$r['fid'].'"> <img src="include/images/icons/usergallery.gif" alt="Gallery" border="0" title="Gallery von '.$name.' ansehen"></a> '; } else { $gallery1 = ""; } if ($gb == '1'){ $gb1 = '<a href="index.php?user-usergb-view-'.$r['fid'].'"> <img src="include/images/icons/usergb.gif" alt="User GB" border="0" title="User GB von '.$name.' ansehen"></a> '; } else { $gb1 = ""; } $pmon=@db_result(db_query('SELECT opt_pm FROM prefix_user WHERE id='.$r['fid']),0); if ($pm == '1'){ if ($pmon == '1') { $pm1 = '<a href="index.php?forum-privmsg-new=0&empfid='.$r['fid'].'"><img src="include/images/icons/pm1.gif" alt="P.M Schreiben" border="0" title="P.M an '.$name.' Schreiben"></a> '; } else { $pm1 = ''; } } else { $pm1 = ""; } $emailon=@db_result(db_query('SELECT opt_mail FROM prefix_user WHERE id='.$r['fid']),0); $email2=@db_result(db_query('SELECT email FROM prefix_user WHERE id='.$r['fid']),0); if ($emailon == '1'){ $email1 = '<a class="freunde" href="index.php?user-mail-'.$r['fid'].'"><img src="include/images/icons/mail.gif" alt="Email Schreiben" border="0" title="Email an '.$name.' Schreiben"><span>'.$email2.'</span></a> '; } else { $email1 = ""; } $r['class'] = $class; $r['color'] = $color; $r['email'] = $email1; $r['avatar'] = $avatar; $r['pm'] = $pm1; $r['gb'] = $gb1; $r['gallery'] = $gallery1; $tpl->set_ar_out($r,1); }