Your-pMF
     registrieren     benutzer     suche     team     kalender     hilfe     index    
Chat     downloads     link us     gästebuch     supportforum    
 

Sortierte Onlineliste

original Thema anzeigen

04.11.04, 15:15:30

the-tester

Dieser Hack sorgt dafür, dass die Onlineliste (das Ding am Ende der Indexseite) Namensrichtig sortiert ist... Suche in der index.php: [php] # # ### Online Liste $online_list = ''; if (!empty($_config['INDEX_ONLINE'])) { $liste = array(); $time = PMF_TIME-$_config['ONLINE_TIMEOUT']; $online_users = 0; $online_guests = $_online['guest']; if (is_array($_online['member'])) { foreach ($_online['member'] AS $id => $val) { if ($_online['member'][$id]['last_action'] >= $time) { $online_users++; $liste[] = ''.(($val['wio_color']) ? ''.$val['name'].'' : $val['name']).''; } } $online_list = (count($liste) > 0) ? implode(', ', $liste) : ''; } } [/php] ersetze es mit: [php] # # ### Online Liste $online_list = ''; if (!empty($_config['INDEX_ONLINE'])) { $liste = array(); $tmpliste = array(); $time = PMF_TIME-$_config['ONLINE_TIMEOUT']; $online_users = 0; $online_guests = $_online['guest']; if (is_array($_online['member'])) { foreach ($_online['member'] AS $id => $val) { if ($_online['member'][$id]['last_action'] >= $time) { $online_users++; $tmpliste[strtoupper($val['name'])] = ''.(($val['wio_color']) ? ''.$val['name'].'' : $val['name']).''; } } ksort($tmpliste); $tmpliste=array_values($tmpliste); $lstelmnt=1; while ($lstelmnt<=$online_users) { $liste[$lstelmnt]=$tmpliste[$lstelmnt-1]; $lstelmnt++; } $online_list = (count($liste) > 0) ? implode(', ', $liste) : ''; } } [/php] Desweiteren das hier: [php] # # ### heute bereits Online $today_online_list = ''; if (!empty($_config['INDEX_TODAY_ONLINE'])) { $liste = array(); $result = $_db->query('SELECT u.`id`, u.`name`, g.`wio_color` FROM `'.$_cfg['DB_PREFIX'].'user` AS u, `'.$_cfg['DB_PREFIX'].'group` AS g WHERE u.`last_action` > '.mktime(0, 0, 0, date('m'), date('d'), date('Y')).' AND u.`group_id` = g.`id` GROUP BY u.`id`'); [/php] ersetzen mit: [php] # # ### heute bereits Online $today_online_list = ''; if (!empty($_config['INDEX_TODAY_ONLINE'])) { $liste = array(); $result = $_db->query('SELECT u.`id`, u.`name`, g.`wio_color` FROM `'.$_cfg['DB_PREFIX'].'user` AS u, `'.$_cfg['DB_PREFIX'].'group` AS g WHERE u.`last_action` > '.mktime(0, 0, 0, date('m'), date('d'), date('Y')).' AND u.`group_id` = g.`id` GROUP BY u.`id` ORDER BY u.`name`'); [/php] Viel Spaß damit...
04.11.04, 16:15:59

Biker

Sehr schön!!!:kaffe: Funzt in allen Foren :laugh:
 
Powered by: phpMyForum 4.2.1 © Christoph Roeder
SQL Error