hab schon jetzt ein bischen rumprobiert aber mir will es nicht gelingen aus der memb_list heraus User in die Freundeliste zu adden.
Kann mir wer dabei behilflich sein ?
Vielleicht kennt ja auch wer die Profi Lösung das sich der Link / Bild ändert bei Usern die bereits geaddet wurden ?
Freund hinzufügen / Freund entfernen (oder Bild dafür)
ich nutze das erweiterte Freundemodul abgeändert von She.
contents/freunde.php
<?php defined('main') or die('no direct access'); $title = $allgAr['title'].' :: Freunde'; $hmenu = 'Freunde'; $design = new design ( $title , $hmenu ); $design->header(); if (loggedin()) { if (isset($_POST['sub'])) { $name = escape($_POST['name'],'string'); $fid = db_result(db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name."'"),0); $uid = @db_result(db_query("SELECT uid FROM prefix_friends WHERE fid = ".$fid."")); if ($uid) { $msg = '<b>Der Freund hast du schon hinzugefügt</b>'; } if ($fid > 0 AND $fid != $_SESSION['authid']) { db_query('INSERT INTO prefix_friends (uid,fid) VALUES ('.$_SESSION['authid'].','.$fid.')'); $msg = '<b>Erfolgreich eingetragen.</font></b><br><br>'; } else { $msg = '<b>Es ist Fehler beim Eintragen aufgetreten.</font></b><br><br>'; } } if (is_numeric($menu->get(1))) { $uid = @db_result(db_query("SELECT uid FROM prefix_friends WHERE fid = ".$fid."")); if ($uid) { $msg = '<b>Der Freund hast du schon hinzugefügt</b>'; } if ($fid > 0 AND $fid != $_SESSION['authid']) { db_query('INSERT INTO prefix_friends (uid,fid) VALUES ('.$_SESSION['authid'].','.$fid.')'); $msg = '<b>Erfolgreich eingetragen.</b></font><br><br>'; } else { $msg = '<b>Es ist Fehler beim Eintragen aufgetreten.</b></font><br><br>'; } } echo $msg; if ($menu->getA(1) == 'd') { db_query("DELETE FROM prefix_friends WHERE uid = ".$_SESSION['authid']." AND fid = ".$menu->getE(1)); } $tpl = new tpl('freunde'); $tpl->out(0); $abf = db_query("SELECT fid FROM prefix_friends WHERE uid = ".$_SESSION['authid'].""); while ($row = db_fetch_assoc($abf)) { $r['class'] = ($class=='Cmite'?'Cnorm':'Cmite'); $sql = db_query("SELECT id,name FROM prefix_user WHERE id = '".$row['fid']."'"); $rr = db_fetch_assoc($sql); $r['name'] = '<a href="index.php?user-details-'.$rr['id'].'">'.$rr['name'].'</a>'; $r['aktfid'] = $row['fid']; $tpl->set_ar_out($r,1); } $tpl->out(2); $abf = db_query("SELECT uid FROM prefix_friends WHERE fid = ".$_SESSION['authid'].""); while ($row = db_fetch_assoc($abf)) { $r['class'] = ($class=='Cmite'?'Cnorm':'Cmite'); $sql = db_query("SELECT id,name FROM prefix_user WHERE id = '".$row['uid']."'"); $rr = db_fetch_assoc($sql); $r['name'] = '<a href="index.php?user-details-'.$rr['id'].'">'.$rr['name'].'</a>'; $r['aktfid'] = $row['fid']; $tpl->set_ar_out($r,3); } $tpl->out(4); } else { echo ''; } $design->footer(); ?>
contents/user/memb_list.php
<?php # Copyright by: Manuel Staechele # Support: www.ilch.de defined ('main') or die ( 'no direct access' ); $title = $allgAr['title'].' :: User :: '.$lang['listofmembers']; $hmenu = $extented_forum_menu.'User <b> » </b> '.$lang['listofmembers'].$extented_forum_menu_sufix; $design = new design ( $title , $hmenu, 1 ); $design->header(); if (( $menu->get(2) ? escape($menu->get(2), 'textarea') : 0 ) == asc ){ $name = '<a href="?user-name-desc">'.$lang['name'].'</a>'; }else{ $name = '<a href="?user-name-asc">'.$lang['name'].'</a>'; } if (( $menu->get(2) ? escape($menu->get(2), 'textarea') : 0 ) == asc ){ $rang = '<a href="?user-spezrank-desc">'.$lang['rank'].'</a>'; }else{ $rang = '<a href="?user-spezrank-asc">'.$lang['rank'].'</a>'; } if (( $menu->get(2) ? escape($menu->get(2), 'textarea') : 0 ) == asc){ $gruppe = '<a href="?user-recht1-desc">'.$lang['group'].'</a>'; }else{ $gruppe = '<a href="?user-recht1-asc">'.$lang['group'].'</a>'; } if (( $menu->get(2) ? escape($menu->get(2), 'textarea') : 0 ) == asc){ $reg = '<a href="?user-regist1-desc">Dabei seit</a>'; }else{ $reg = '<a href="?user-regist1-asc">Dabei seit</a>'; } if (( $menu->get(2) ? escape($menu->get(2), 'textarea') : 0 ) == asc){ $icq = '<a href="?user-icq-asc">'.$lang['icq'].'</a>'; }else{ $icq = '<a href="?user-icq-desc">'.$lang['icq'].'</a>'; } if (( $menu->get(2) ? escape($menu->get(2), 'textarea') : 0 ) == asc){ $a = '<a href="?user-e-desc">Posts</a>'; }else{ $a = '<a href="?user-e-asc">Posts</a>'; } $rei = escape($menu->get(1), 'textarea'); $nach =escape($menu->get(2), 'textarea'); $anz = @db_result(db_query("SELECT count(ID) FROM prefix_user"),0); $limit = 50; // Limit $page = ($menu->getA(3) == 'p' ? $menu->getE(3) : 1 ); $MPL = db_make_sites ($page , "" , $limit , '?user-'.$rei.'-'.$nach.'' , 'user' ); $anfang = ($page - 1) * $limit; $tpl = new tpl ( 'user/memb_list.htm' ); $ar = array ( 'oname' => $name, 'orank' => $rang, 'ogroup' => $gruppe, 'oicq' => $icq, 'oposts' => $a, 'oregtime' => $reg, 'anz' =>$anz, 'SITELINK' => $MPL ); $tpl->set_ar_out($ar,0); $aufab = ( $menu->get(2) ? escape($menu->get(2), 'textarea') : desc ); $sort1 = ( $menu->get(1) ? escape($menu->get(1), 'textarea') : "recht , posts" ); if ($sort1 == 'recht1'){ $sort2 = 'recht'; }else{ $sort2 = $sort1; } if ($sort2 == 'regist1'){ $sort3 = 'regist'; }else{ $sort3 = $sort2; } if ($sort3 == 'e'){ $sort = 'posts'; }else{ $sort = $sort3; } $class = ''; $erg = db_query("SELECT llogin, prefix_user.posts, prefix_user.id, prefix_grundrechte.name as recht_name, regist, prefix_user.staat, prefix_user.icq, prefix_user.geschlecht, prefix_user.gebdatum, prefix_user.name, prefix_user.avatar, prefix_user.status, uf1.val AS feld1, uf2.val AS feld2, uf3.val AS feld3 FROM prefix_user LEFT JOIN prefix_grundrechte ON prefix_user.recht = prefix_grundrechte.id LEFT JOIN prefix_userfields uf1 ON prefix_user.id = uf1.uid AND uf1.fid = 21 LEFT JOIN prefix_userfields uf2 ON prefix_user.id = uf2.uid AND uf2.fid = 29 LEFT JOIN prefix_userfields uf3 ON prefix_user.id = uf3.uid AND uf3.fid = 30 ORDER by $sort $aufab LIMIT ".$anfang.",".$limit); while ($row = db_fetch_object($erg)) { $abf1 = "SELECT * FROM prefix_online WHERE uid = '".$row->id."'"; $erg1 = db_query($abf1); $row1 = db_fetch_assoc($erg1); if(isset($row1['uid'])){ $online = '<img src="include/images/icons/on1.png" alt="online" border="0"/>'; }else{ $online = '<img src="include/images/icons/off2.png" alt="offline" border="0" />'; } $icq1 = str_replace("-","",$row->icq); $icq2 = str_replace(" ","",$icq1); if (is_numeric($icq2) ){ $icq= '<a href="http://www.icq.com/whitepages/cmd.php?uin='.$icq2.'&action=add"><img src="http://web.icq.com/whitepages/online?icq='.$icq2.'&img=5" border="0"></a>'; }else{ $icq = ''; } $ga = ''; $t1 = 0; $t2 = 0; $t3 = 0; $age1=explode("-",$row->gebdatum); $age2 = date("Y",time())-$age1[0]; $a=explode("-",$row->gebdatum); $tag = $a[2]; $mon = $a[1]; $jah = $a[0]; if ($mon > date("m")){$t1 = 2;} if ($mon == date("m")){$t1 = 1;} if ($tag > date("d")){$t2 = 1;} $t3 = ($t1 + $t2); if ($t3 > 1){ $age = ($age2 -1); }else{ $age = $age2; } if ($row->geschlecht == 0){ if ($row->gebdatum != 0000-00-00 ){ $ga.= $age; }else{ $ga.= ''; } } elseif ($row->geschlecht == 1){ if ($row->gebdatum != 0000-00-00 ){ $ga.='<img src="include/images/icons/user.png" border="0"> - '.$age.''; }else{ $ga.='<img src="include/images/icons/user.png" border="0"> - 00'; } } elseif ($row->geschlecht == 2){ if ($row->gebdatum != 0000-00-00 ){ $ga.='<img src="include/images/icons/user_female.png" border="0"> - '.$age.''; }else{ $ga.='<img src="include/images/icons/user_female.png" border="0"> - 00'; } } if ($row->staat){ $flagg = '<img src="include/images/flags/'.$row->staat.'" alt="" border="0"> '; }else{ $flagg = ''; } $state['0']='<font size="-2"><font color="#CC0000">Inaktiv</font></font>'; $state['1']='<font size="-2"><font color="#008000">Aktiv</font></font>'; $state['2']='<font size="-2"><font color="#0000FF">Gesperrt</font></font>'; $anzna = round((time()-$row->llogin)/(24*60*60),0); if ($anzna < 9) { $aktiv = ' <img src="Bilder/kurz.gif" alt="Oft hier" border="0" width="16" height="16"> - '; }elseif ($anzna < 20) { $aktiv = '<img src="Bilder/mittel.gif" alt="Selten hier" border="0" width="16" height="16"> - '; } else { $aktiv = ' <img src="Bilder/lang.gif" alt="Sehr selten hier" border="0" width="16" height="16"> - '; } if (!empty($row->avatar) AND file_exists($row->avatar)) { $row->avatar = $row->avatar; } elseif ($row->geschlecht == 1) {$row->avatar = 'include/images/avatars/male.png';} elseif ($row->geschlecht == 2) {$row->avatar = 'include/images/avatars/female.png';} else {$row->avatar = 'include/images/avatars/wurstegal.png';} if ($class == 'Cmite') { $class = 'Cnorm'; } else { $class = 'Cmite'; } $ar = array ( 'NAME' => $row->name, 'RANG' => userrang($row->posts,$row->id), 'AKTIV' => $aktiv, 'FLAGG' => $flagg, 'ICQ' => $icq, 'GA' => $ga, 'CLASS' => $class, 'POSTS' => $row->posts, 'UID' => $row->id, 'DATE' => date('<b>d.m.Y</b>- H:i',$row->llogin), 'ONLINE' => $online, 'STATUS' => $state[$row->status], 'FELD1' => $row->feld1, 'FELD2' => $row->feld2, 'FELD3' => $row->feld3, 'AVATA' => $row->avatar, 'GRUPE' => $row->recht_name ); $tpl->set_ar_out($ar,1); } $tpl->set_out('filtername',$filtername ? $filtername : '',2); $design->footer(); ?>
templates/user/memb_list.htm
<style type="text/css"> #dhtmltooltip{ position: absolute; /* Avatargröße breite angeben. Wie im admin eingestellt. */ width: 80px; /* Avatargröße breite angeben. Wie im admin eingestellt. */ border: 1px solid black; padding: 1px; background-color: #E2D6B0; visibility: hidden; z-index: 100; /*Remove below line to remove shadow. Below line should always appear last within this CSS*/ filter: progid:DXImageTransform.Microsoft.Shadow(color=gray,direction=135); } </style> <div id="dhtmltooltip"></div> <script type="text/javascript"> /*********************************************** * Cool DHTML tooltip script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ var offsetxpoint=-60 //Customize x offset of tooltip var offsetypoint=20 //Customize y offset of tooltip var ie=document.all var ns6=document.getElementById && !document.all var enabletip=false if (ie||ns6) var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : "" function ietruebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function ddrivetip(thetext, thecolor, thewidth){ if (ns6||ie){ if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px" if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor tipobj.innerHTML=thetext enabletip=true return false } } function positiontip(e){ if (enabletip){ var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft; var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop; //Find out how close the mouse is to the corner of the window var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20 var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20 var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000 //if the horizontal distance isn't enough to accomodate the width of the context menu if (rightedge<tipobj.offsetWidth) //move the horizontal position of the menu to the left by it's width tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px" else if (curX<leftedge) tipobj.style.left="5px" else //position the horizontal position of the menu where the mouse is positioned tipobj.style.left=curX+offsetxpoint+"px" //same concept with the vertical position if (bottomedge<tipobj.offsetHeight) tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px" else tipobj.style.top=curY+offsetypoint+"px" tipobj.style.visibility="visible" } } function hideddrivetip(){ if (ns6||ie){ enabletip=false tipobj.style.visibility="hidden" tipobj.style.left="-1000px" tipobj.style.backgroundColor='' tipobj.style.width='' } } document.onmousemove=positiontip </script> <table width="100%" border="0" cellpadding="3" cellspacing="1" class="border"> <tr class="Chead" > <th height="30" width="20%">Nickname</th> <th align="center" width="17%">Forenstatus</th> <th align="center" width="10%">Status</th> <th align="center" width="10%">Klasse</th> <th align="center" width="3%">Lvl</th> <th align="center" width="10%">Charakter</th> <th width="17%">Zuletzt Online</th> <th align="center" width="5%">Quicky</th> </tr>{EXPLODE}<tr class="{CLASS}"> <td><a href="index.php?user-details-{UID}" onMouseover="ddrivetip('<img border=0 src={AVATA}')"; onMouseout="hideddrivetip()"><b>{AKTIV} {NAME} <a href="index.php?freunde" onclick="{NAME}"><i><font size="-2"><img src="Bilder/plus_small_circle.png" alt="A" border="0"></font></i></a></b></a></td> <td align="center"><font style="font-size: 13px"><b><font color="#623100"><font size="1">{RANG}</font></font></b></font></td><td align="center"><font size="-2">{GRUPE}</font></td><td align="center"><font size="-2">{FELD1} </font></td><td align="center"><font size="-2"><font color="#CA0000">{FELD3}</font> </font></td><td align="center"><a href="http://eu.battle.net/wow/de/character/ulduar/{FELD2}/simple" target="_blank"><font size="-2">{FELD2}</font></a></td> <td><p align="center"><font size="-2">{DATE}</font></p></td> <td align="center"><a href="javascript:void(0)" onclick="javascript:chatWith({UID},'{NAME}')">{ONLINE}</a></font></td> </tr>{EXPLODE} </table> <br /> <font size="-2">User gesamt: <b>{anz}</b> {SITELINK}</font><br><br><br>