1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
|
/* Config */
$chan = 'oldgames'; //Euer Channel (ohne #)
$prefix = '[EF]'; //Falls ihr wie ich jedem User automatisch ein forenbezogenes Prefix zuweist, dieses hier eintragen
/* Usernamen */
ob_start();
@include('http://www.insiderz.de/modules.php?name=Chaninfo&file=nicks&chan='.$chan);
$chat_nicks = ob_get_clean();
/* Anzahl */
ob_start();
@include('http://www.insiderz.de/modules.php?name=Chaninfo&file=count&chan='.$chan);
$chat_count = ob_get_clean();
/* Kommentar entfernen */
$chat_nicks = str_replace("<!-- SELECT nick FROM user,ison,chan WHERE user.nickid = ison.nickid AND chan.chanid = ison.chanid AND lower(chan.channel) LIKE '#derrest' AND chan.mode_lp='N' AND chan.mode_ls='N' AND user.mode_ub='N' AND user.mode_us='N' -->",'',$chat_nicks);
/* Arrays generieren - Iss so 'umständlich' wegen des Prefixes */
$chat_nicks_short = '';
$chat_nicks_array = '';
foreach(explode('<br>',$chat_nicks) as $nick) {
$nick_short = strtolower(str_replace($prefix,'',$nick));
$chat_nicks_array_short[$nick_short] = $nick_short;
$chat_nicks_array[$nick_short] = $nick;
$chat_nicks_short .= '\''.$nick_short.'\',';
}
/* userids auslesem */
$chat_userids = array();
$result = $db->query("SELECT u.userid,u.username,g.useronlinemarking FROM bb".$n."_users u LEFT JOIN bb".$n."_groups g ON(u.useronlinegroupid = g.groupid)WHERE username IN(".$chat_nicks_short."'')");
while($row = $db->fetch_array($result)) {
$chat_userids[strtolower($row['username'])] = $row;
}
/* Array Version */
/*
$chat_nicks = array();
foreach($chat_nicks_array_short as $nick) {
if($nick != '') {
if($chat_userids[strtolower($nick)]['userid'] != '') $chat_nicks[] = '<a href="profile.php?userid='.$chat_userids[strtolower($nick)]['userid'].'">'.str_replace('%s',$chat_nicks_array[strtolower($nick)],$chat_userids[strtolower($nick)]['useronlinemarking']).'</a>, ';
else $chat_nicks[] = $chat_nicks_array[strtolower($nick)].', ';
}
}
/**/
/* String Version */
$chat_nicks = '';
foreach($chat_nicks_array_short as $nick) {
if($nick != '') {
if($chat_userids[strtolower($nick)]['userid'] != '') $chat_nicks .= '<a href="profile.php?userid='.$chat_userids[strtolower($nick)]['userid'].'">'.str_replace('%s',$chat_nicks_array[strtolower($nick)],$chat_userids[strtolower($nick)]['useronlinemarking']).'</a>, ';
else $chat_nicks .= $chat_nicks_array[strtolower($nick)].', ';
}
}
/**/
/* Verfügbare Variablen
* $chat_count -> Useranzahl
* $chat_nicks -> Nicks inkl. Link zum Profil und Useronlinemarkierung
*/ |