Ich möchte die FreundesListe Modifizieren mit einer User Ignorelist.
Ich habe das in Ilch Community Edition 1.2.6 gefunden sorry, der Name ist glaube nicht so erwünscht.
Ich habe die Freundesliste v1.0 installiert und auch schon Modifiziert.
Die PHP und HTM sind aus denn Ilch Community Edition 1.2.6 CMS. sorry der Name
Das habe ich aus denn ordner: include/contents/freunde.php
<?php defined('main') or die('no direct access'); $title = $allgAr['title'].' :: Freunde'; $hmenu = 'Freunde'; $design = new design ( $title , $hmenu ); $design->header(); $gb = ($allgAr['forum_usergb']); $gallery = ($allgAr['forum_usergallery']); $pm = ($allgAr['Fpmf']); if (loggedin()) { //Eintragen if (isset($_POST['sub'])) { $name = escape($_POST['name'],'string'); $fid = @db_result(db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name."'"),0); $msg = 'Fehler beim Eintragen aufgetreten.<br />'; $user = @db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),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 ($fid > 0) { if ($user != $name) { if (db_query("INSERT INTO `prefix_friends` (uid,fid) VALUES ({$_SESSION['authid']}, $fid)")) { sendpm(1, $fid, $bet, $txt); $msg = 'Erfolgreich eingetragen.<br />'; } } else { $msg = "Du kannst dich nicht selbst adden!<br />"; } } echo $msg; } //Eintragen if (isset($_POST['sub1'])) { $name = escape($_POST['name1'],'string'); $fid = @db_result(db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name."'"),0); $msg = 'Fehler beim Eintragen aufgetreten.<br />'; $recht = @db_result(db_query("SELECT recht FROM prefix_user WHERE name = BINARY '".$name."'"),0); $user = @db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),0); $recht1 = @db_result(db_query("SELECT recht FROM prefix_user WHERE name = BINARY '".$user."'"),0); if ($fid > 0) { if ($user == $name) { $msg = "Du kannst dich nicht selbst adden!<br />"; } elseif (($recht <= -5) AND ($recht1 >= -5)) { $msg = "Dieser User hat einen zu hochen Rang um ihn auf die Ignorelist zu setzten!"; } else { if (db_query("INSERT INTO `prefix_friends` VALUES ({$_SESSION['authid']}, $fid, '1', '')")) { $msg = 'Erfolgreich eingetragen.<br />'; } } } echo $msg; } //Löschen if ($menu->getA(1) == 'd') { db_query("DELETE FROM `prefix_friends` WHERE uid = {$_SESSION['authid']} AND fid = ".$menu->getE(1)); echo mysql_error(); } //Freischalten User Ihre Erlaubnisanfrage wurd abgelehnt if ($menu->getA(1) == 'n') { db_query("DELETE FROM `prefix_friends` WHERE fid = {$_SESSION['authid']} AND uid = ".$menu->getE(1)); echo mysql_error(); $user=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$menu->getE(1)),0); $user1=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),0); $bet = "Ihre Erlaubnisanfrage wurd abgelehnt!"; $txt = "Hallo ".$user.", sie wurden vom User ".$user1." abgelehnt."; sendpm(1, $menu->getE(1), $bet, $txt); } //Freischalten User wurden akzeptiert if ($menu->getA(1) == 'f') { db_query("UPDATE `prefix_friends` SET buddy = '1' WHERE fid = {$_SESSION['authid']} AND uid = ".$menu->getE(1)); $user=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$menu->getE(1)),0); $user1=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),0); $bet = "Sie wurden akzeptiert!"; $txt = "Hallo ".$user.", der User ".$user1." hat sie akzeptiert."; sendpm(1, $menu->getE(1), $bet, $txt); echo mysql_error(); } //Ignorelist if ($menu->getA(1) == 'i') { $recht = @db_result(db_query("SELECT recht FROM prefix_user WHERE id = '".$menu->getE(1)."'"),0); $user = @db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),0); $recht1 = @db_result(db_query("SELECT recht FROM prefix_user WHERE name = BINARY '".$user."'"),0); if (($recht <= -5) AND ($recht1 >= -5)) { $msg = "Dieser User hat einen zu hochen Rang um ihn auf die Ignorelist zu setzten!"; } else { db_query("DELETE FROM `prefix_friends` WHERE uid = {$_SESSION['authid']} AND fid = ".$menu->getE(1)); db_query("INSERT INTO `prefix_friends` VALUES ('".$_SESSION['authid']."', '".$menu->getE(1)."', '1', '')"); echo mysql_error(); } echo $msg; } //Freunde Erlaubnisanfrage if ($menu->getA(1) == 'j') { $user=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$menu->getE(1)),0); $user1=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$_SESSION['authid']),0); $bet = "Erlaubnisanfrage!"; $txt = "Hallo ".$user.", der User ".$user1." wartet auf ihre Freischaltung. Hier können sie den User sofort Freischalten: [url=index.php?freunde-f".$_SESSION['authid']."]Link[/url]"; db_query("DELETE FROM `prefix_friends` WHERE uid = {$_SESSION['authid']} AND fid = ".$menu->getE(1)); db_query("INSERT INTO `prefix_friends` VALUES ('".$_SESSION['authid']."', '".$menu->getE(1)."', '', '')"); sendpm(1, $menu->getE(1), $bet, $txt); echo mysql_error(); } //Ausgabe $tpl = new tpl('freunde'); $tpl->out(0); $dif = date('Y-m-d H:i:s', time() - 60); $sql = db_query("SELECT a.fid as aktfid, b.name, 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 = aktfid 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, opt_pm FROM prefix_user WHERE id='.$r['aktfid']),0); //User Gallery if ($gallery == '1'){ $gallery1 = '<a href="index.php?user-usergallery-'.$r['aktfid'].'"> <img src="include/images/icons/usergallery.gif" alt="Gallery" border="0" title="Gallery von '.$name.' ansehen"></a> '; } else { $gallery1 = ""; } //User Gästebuch if ($gb == '1'){ $gb1 = '<a href="index.php?user-usergb-view-'.$r['aktfid'].'"> <img src="include/images/icons/usergb.gif" alt="User GB" border="0" title="User GB von '.$name.' ansehen"></a> '; } else { $gb1 = ""; } //User PM Schreiben $pmon=@db_result(db_query('SELECT opt_pm FROM prefix_user WHERE id='.$r['aktfid']),0); if ($pm == '1'){ if ($pmon == '1') { $pm1 = '<a href="index.php?forum-privmsg-new=0&empfid='.$r['aktfid'].'"><img src="include/images/icons/pm.gif" alt="P.M Schreiben" border="0" title="P.M an '.$name.' Schreiben"></a> '; } else { $pm1 = ''; } } else { $pm1 = ""; } //User Email Schreiben $emailon=@db_result(db_query('SELECT opt_mail FROM prefix_user WHERE id='.$r['aktfid']),0); $email2=@db_result(db_query('SELECT email FROM prefix_user WHERE id='.$r['aktfid']),0); if ($emailon == '1'){ $email1 = '<a class="freunde" href="index.php?user-mail-'.$r['aktfid'].'"><img src="include/images/icons/mail.gif" alt="Email Schreiben" border="0" title="Email an '.$name.' Schreiben"><span>'.$email2.'</span></a> '; } else { $email1 = ""; } //User ICQ $icq=@db_result(db_query('SELECT icq FROM prefix_user WHERE id='.$r['aktfid']),0); if ($icq == ''){ $icq1 = ''; } else { $icq1 = '<a class="freunde" href="http://www.icq.com/whitepages/cmd.php?uin='.$icq.'&action=add"><img src="include/images/icons/icq.gif" alt="Icq" border="0" title="Icq"><span>'.$icq.'</span></a> '; } //User MSN $msn=@db_result(db_query('SELECT msn FROM prefix_user WHERE id='.$r['aktfid']),0); if ($msn == ''){ $msn1 = ''; } else { $msn1 = '<a class="freunde" href="#INFO"><img src="include/images/icons/msn.gif" alt="Msn" border="0" title="Msn"><span>'.$msn.'</span></a> '; } //User AIM $aim=@db_result(db_query('SELECT aim FROM prefix_user WHERE id='.$r['aktfid']),0); if ($aim == ''){ $aim1 = ''; } else { $aim1 = '<a class="freunde" href="aim:goim?screenname='.$aim.'&message=Hello+Are+you+there?"><img src="include/images/icons/aim.gif" alt="Aim" border="0" title="Aim"><span>'.$aim.'</span></a> '; } //User Yahoo $yahoo=@db_result(db_query('SELECT yahoo FROM prefix_user WHERE id='.$r['aktfid']),0); if ($yahoo == ''){ $yahoo1 = ''; } else { $yahoo1 = '<a class="freunde" href="http://edit.yahoo.com/config/send_webmesg?.target='.$yahoo.'&.src=pg"><img src="include/images/icons/yahoo.gif" alt="Yahoo" border="0" title="Yahoo"><span>'.$yahoo.'</span></a> '; } //User Homepage $hp=@db_result(db_query('SELECT homepage FROM prefix_user WHERE id='.$r['aktfid']),0); if ($hp == ''){ $hp1 = ''; } else { $hp1 = '<a class="freunde" href="'.$hp.'"><img src="include/images/icons/page.gif" alt="Homepage" border="0" title="Homepage"><span>'.$hp.'</span></a> '; } $r['class'] = $class; $r['color'] = $color; $r['icq'] = $icq1; $r['msn'] = $msn1; $r['aim'] = $aim1; $r['hp'] = $hp1; $r['yahoo'] = $yahoo1; $r['email'] = $email1; $r['pm'] = $pm1; $r['gb'] = $gb1; $r['gallery'] = $gallery1; $tpl->set_ar_out($r,1); } $tpl->out(2); $sql1 = db_query("SELECT a.fid as aktfid, b.name, 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 = aktfid ORDER BY uptime DESC LIMIT 1) WHERE a.uid = {$_SESSION['authid']} AND a.ignoren = 1 ORDER BY status DESC"); while ($r1 = db_fetch_assoc($sql1)) { $class1 = ($class1=='Cnorm'?'Cmite':'Cnorm'); $r1['class1'] = $class1; $tpl->set_ar_out($r1,3); } $tpl->out(4); $sql2 = db_query("SELECT a.fid as aktfid, b.name, 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 = aktfid ORDER BY uptime DESC LIMIT 1) WHERE a.uid = {$_SESSION['authid']} AND a.ignoren = 0 AND a.buddy = 0 ORDER BY status DESC"); while ($r2 = db_fetch_assoc($sql2)) { $class2 = ($class2=='Cnorm'?'Cmite':'Cnorm'); $r2['class2'] = $class2; $tpl->set_ar_out($r2,5); } $tpl->out(6); $sql3 = db_query("SELECT a.uid as aktfid, b.name, IF(c.uptime > '$dif','online','offline') as status FROM `prefix_friends` a LEFT JOIN `prefix_user` b ON a.uid = b.id LEFT JOIN `prefix_online` c ON a.fid = c.uid AND c.sid = (SELECT sid FROM `prefix_online` WHERE uid = aktfid ORDER BY uptime DESC LIMIT 1) WHERE a.fid = {$_SESSION['authid']} AND a.ignoren = 0 AND a.buddy = 0 ORDER BY status DESC"); while ($r3 = db_fetch_assoc($sql3)) { $class3 = ($class3=='Cnorm'?'Cmite':'Cnorm'); $r3['class3'] = $class3; $tpl->set_ar_out($r3,7); } $tpl->out(8); } else { echo 'Nur für angemeldete User.<br />'; } $design->footer(); ?>
Das habe ich aus denn ordner: include/templates/freunde.htm
<script language="JavaScript" type="text/javascript"> <!-- function finduser () { var Fenster = window.open ('index.php?search-finduser', 'finduser', 'status=no,scrollbars=yes,height=165,width=465'); Fenster.focus(); return (false); } function finduser1 () { var Fenster = window.open ('index.php?search-finduser1', 'finduser1', 'status=no,scrollbars=yes,height=165,width=465'); Fenster.focus(); return (false); } //--> </script> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top"> <form action="index.php?freunde" method="POST" name="form"> <table border="0" cellspacing="1" class="border" cellpadding="5"> <tr class="Chead"> <td>Buddy hinzufügen</td> </tr> <tr class="Cmite"> <td><input type="text" name="name" size="25" /> <input type="button" value="suchen..." onclick="return finduser();" /></td> </tr> <tr class="Cnorm"> <td><input type="submit" value="eintragen" name="sub" /></td> </tr> </table> </form> </td> <td align="right" valign="top"> <form action="index.php?freunde" method="POST" name="form1"> <table border="0" cellspacing="1" class="border" cellpadding="5"> <tr class="Chead"> <td>Ignore hinzufügen</td> </tr> <tr class="Cmite"> <td><input type="text" name="name1" size="25" /> <input type="button" value="suchen..." onclick="return finduser1();" /></td> </tr> <tr class="Cnorm"> <td><input type="submit" value="eintragen" name="sub1" /></td> </tr> </table> </form> </td> </tr> </table> <br /> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="45%" align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="91%" align="left" valign="top"> <tr class="Chead"> <td colspan="3" align="center">Freundeliste</td> </tr> {EXPLODE} <tr class="{class}"> <td align="left" valign="middle" width="17"><img src="include/images/icons/{status}.gif" border="0" /></td> <td align="left" valign="middle"><a href="index.php?user-details-{aktfid}">{name}</a></td> <td align="right" valign="middle"> <div style="margin-right:2px;"> <a href="index.php?freunde-i{aktfid}"><img src="include/images/icons/buddyigno_mini.gif" border="0" alt="User auf Ignore setzten" title="User auf Ignore setzten" /></a> <a href="index.php?freunde-d{aktfid}"><img src="include/images/icons/del.gif" border="0" /></a> </div> </td> </tr> <tr> <td colspan="3" height="22" valign="top" style="border-bottom:1px solid {color}; border-right:1px solid {color}; border-left:1px solid {color};"> <div style="margin-top:5px;">{gallery}{gb}{pm}{email}{icq}{msn}{yahoo}{aim}{hp}</div> </td> </tr> <tr> <td height="2" colspan="3"></td> </tr> {EXPLODE} </table> </td> <td width="45%" align="right" valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="91%" align="right" valign="top"> <tr class="Chead"> <td colspan="3" align="center">Ignoreliste</td> </tr> {EXPLODE} <tr class="{class1}"> <td align="left" valign="middle" width="17"><img src="include/images/icons/{status}.gif" border="0" /></td> <td align="left" valign="middle"><a href="index.php?user-details-{aktfid}">{name}</a></td> <td align="right" valign="middle"> <div style="margin-right:2px;"> <a href="index.php?freunde-j{aktfid}"><img src="include/images/icons/buddyadd_mini.gif" border="0" alt="Als Freund hinzufügen" title="Als Freund hinzufügen" /></a> <a href="index.php?forum-privmsg-new=0&empfid={aktfid}"><img src="include/images/icons/pm.gif" alt="P.M Schreiben" border="0" title="P.M an {name} Schreiben"></a> <a href="index.php?freunde-d{aktfid}"><img src="include/images/icons/del.gif" border="0" /></a> </div> </td> </tr> {EXPLODE} </table> </td> </tr> </table> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="45%" align="left" valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="91%" align="left" valign="top"> <tr class="Chead"> <td colspan="3" align="center">Sie haben noch keine Erlaubnis</td> </tr> {EXPLODE} <tr class="{class2}"> <td align="left" valign="middle" width="17"><img src="include/images/icons/{status}.gif" border="0" /></td> <td align="left" valign="middle"><a href="index.php?user-details-{aktfid}">{name}</a></td> <td align="right" valign="middle"> <div style="margin-right:2px;"> <a href="index.php?forum-privmsg-new=0&empfid={aktfid}"><img src="include/images/icons/pm.gif" alt="P.M Schreiben" border="0" title="P.M an {name} Schreiben"></a> <a href="index.php?freunde-d{aktfid}"><img src="include/images/icons/del.gif" border="0" /></a> </div> </td> </tr> {EXPLODE} </table> </td> <td width="45%" align="right" valign="top"> <table border="0" cellspacing="0" cellpadding="0" width="91%" align="right" valign="top"> <tr class="Chead"> <td colspan="3" align="center">Warten auf ihre Erlaubnis</td> </tr> {EXPLODE} <tr class="{class3}"> <td align="left" valign="middle" width="17"><img src="include/images/icons/{status}.gif" border="0" /></td> <td align="left" valign="middle"><a href="index.php?user-details-{aktfid}">{name}</a></td> <td align="right" valign="middle"> <div style="margin-right:2px;"> <a href="index.php?freunde-f{aktfid}"><img src="include/images/icons/yes.gif" border="0" /></a> <a href="index.php?freunde-n{aktfid}"><img src="include/images/icons/del.gif" border="0" /></a> </div> </td> </tr> {EXPLODE} </table> </td> </tr> </table>
Das habe ich aus denn ordner: include/images/icons/Alle Icons
buddyadd.gif buddyadd_mini.gif buddyigno.gif buddyigno_mini.gif pm.gif usergb.gif yes.gif
Das habe ich aus der: install.sql
-- -------------------------------------------------------- -- -- Tabellenstruktur für Tabelle `prefix_friends` -- CREATE TABLE `prefix_friends` ( `uid` mediumint(9) NOT NULL default '0', `fid` mediumint(9) NOT NULL default '0', `ignoren` mediumint(9) NOT NULL default '0', `buddy` mediumint(9) NOT NULL default '0', PRIMARY KEY (`uid`,`fid`) ) ENGINE=MyISAM COMMENT='powered by ilch-community.de'; -- --------------------------------------------------------
MFG BennY
Zuletzt modifiziert von FightClub am 09.03.2014 - 19:12:32