ilch Forum » Ilch Clan 1.1 » Module und Modifikationen » Onlineanzeige umbauen

Geschlossen
  1. #1
    User Pic
    Timo Mitglied
    Registriert seit
    27.07.2006
    Beiträge
    44
    Beitragswertungen
    0 Beitragspunkte
    Hallo wie muss ich die Online anzeige umbauen das nur noch die online angezeigt werden. Danke


    verwendete ilchClan Version: 1.1
    Zündapp = Motorisierte Zweiräder und Rasenmäher
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Akira Mitglied
    Registriert seit
    25.01.2007
    Beiträge
    1.369
    Beitragswertungen
    1 Beitragspunkte
    nimmste einfach die offline und gäste raus lachen
    externer Link Visit Us zwinker
    Neue Scripte: JQuery Login usw... Turnier(externer Link Multi-Bewertung, Refferer, Forum Upload, E-Mail login
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    Timo Mitglied
    Registriert seit
    27.07.2006
    Beiträge
    44
    Beitragswertungen
    0 Beitragspunkte
    Aber wie sorry ich bin da nicht so fitt. Gäste sollten drinnen bleiben.

    <?php
    if (!defined('main')) {die("no direct access");}
    $dif = date('Y-m-d H:i:s', time() - 1000);
    $abf = "SELECT uid FROM `prefix_online` WHERE uptime > '". $dif."'";
    $resultID = db_query($abf);
    $brk='';
    $uid = array();
    $guests = 0;
    $guestn = $lang['guests'];
    $content='';
    
    while ($row = db_fetch_object($resultID)) {
    	if ($row->uid != 0 AND $brk!=$row->uid) {
    		$name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0);
    		$content.= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td>';
    		$content.='<td><a href="index.php?user-details-'.$row->uid.'">'.$name.'</a></td></tr>'."\n";
    		$uid[] = $row->uid;
    	}
    	if ($row->uid == 0) { $guests++; }
    	$brk=$row->uid;
    }
    if ($guests == 1) { $guestn = $lang['guest']; }
    if (empty($content)) { $content.='<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><font color="#003366">0 User </font></td></tr>'."\n"; }
    
    $content.='<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."\n";
    $where = (count($uid)>0) ? 'WHERE id NOT IN ('.implode(', ', $uid).')' : '';
    $abf2 = 'SELECT * FROM prefix_user '.$where.' ORDER BY llogin DESC LIMIT 0,7';
    $erg2 = db_query($abf2);
    
    while ($row2 = db_fetch_object($erg2)) {
    	$datum = date('H:i d.m.y',$row2->llogin);
    	$user = $row2->name;
    	$content.='<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><a href="index.php?user-details-'.$row2->id.'" title="'.$lang['lasttimeonline'].$datum.'">'.$user.'</a></td></tr>'."\n";
    }
    if ($guests == 0) {
    	$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px";></td></tr>'."\n".'
    		<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><font size="-1" color="#003366">0 '.$lang['guests'].'</td></tr>'."\n";
    } else {
    	$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."\n".'
    		<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td><td><font size=-1>'.$guests.' '.$guestn.'</font></td></tr>'."\n";
    }
    ?>
    <table align="center" border="0" cellpadding="0" cellspacing="0" >
     <?php echo $content; ?>
    </table>



    Zuletzt modifiziert von Timo am 07.01.2009 - 23:59:38
    Zündapp = Motorisierte Zweiräder und Rasenmäher
    0 Mitglieder finden den Beitrag gut.
  4. #4
    User Pic
    Parkuhr Mitglied
    Registriert seit
    30.09.2008
    Beiträge
    182
    Beitragswertungen
    0 Beitragspunkte
    Ich hätt jetzt einfach das Limit runtergesetzt....


    das ginge so:

    <?php
    if (!defined('main')) {die("no direct access");}
    $dif = date('Y-m-d H:i:s', time() - 60);
    $abf = "SELECT uid FROM `prefix_online` WHERE uptime > '". $dif."'";
    $resultID = db_query($abf);
    $brk='';
    $uid = array();
    $guests = 0;
    $guestn = $lang['guests'];
    $content='';
    
    while ($row = db_fetch_object($resultID)) {
    	if ($row->uid != 0 AND $brk!=$row->uid) {
    		$name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0);
    		$content.= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td>';
    		$content.='<td><a href="index.php?user-details-'.$row->uid.'">'.$name.'</a></td></tr>'."\n";
    		$uid[] = $row->uid;
    	}
    	if ($row->uid == 0) { $guests++; }
    	$brk=$row->uid;
    }
    if ($guests == 1) { $guestn = $lang['guest']; }
    if (empty($content)) { $content.='<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><font color="#003366">0 User </font></td></tr>'."\n"; }
    
    $content.='<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."\n";
    $where = (count($uid)>0) ? 'WHERE id NOT IN ('.implode(', ', $uid).')' : '';
    $abf2 = 'SELECT * FROM prefix_user '.$where.' ORDER BY llogin DESC LIMIT 0,0';
    $erg2 = db_query($abf2);
    
    while ($row2 = db_fetch_object($erg2)) {
    	$datum = date('H:i d.m.y',$row2->llogin);
    	$user = $row2->name;
    	$content.='<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><a href="index.php?user-details-'.$row2->id.'" title="'.$lang['lasttimeonline'].$datum.'">'.$user.'</a></td></tr>'."\n";
    }
    if ($guests == 0) {
    	$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px";></td></tr>'."\n".'
    		<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><font size="-1" color="#003366">0 '.$lang['guests'].'</td></tr>'."\n";
    } else {
    	$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."\n".'
    		<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td><td><font size=-1>'.$guests.' '.$guestn.'</font></td></tr>'."\n";
    }
    ?>
    <table align="center" border="0" cellpadding="0" cellspacing="0" >
     <?php echo $content; ?>
    </table>
    0 Mitglieder finden den Beitrag gut.
  5. #5
    User Pic
    MVN050 Mitglied
    Registriert seit
    20.09.2008
    Beiträge
    1.273
    Beitragswertungen
    29 Beitragspunkte
    ich hab ne eigene

    probier die mal aus

    <?php
    if (!defined('main')) {die("no direct access");}
    
    $dif = date('Y-m-d H:i:s', time() - 500);
    $dif2 = time()-500;
    $break = array();
    
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.recht = "-9" ORDER BY prefix_user.llogin DESC LIMIT 0,4');
    
    $content .= '<table align="center" border="0" cellpadding="2" cellspacing="2">';
    $content .= '<tr><td>Admin Online</td></tr>';
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></td></tr>';
    	$break[] = $erg['id'];
    }
    
    $content .= '<tr><td>Leader</td></tr>';
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-8" OR prefix_user.recht = "-7" ORDER BY prefix_user.llogin DESC ');
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><font color="#FF0000"><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></font></td></tr>';
    	$break[] = $erg['id'];
    }
    
    $content .= '<tr><td>Member Online</td></tr>';
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-6" OR prefix_user.recht = "-5" OR prefix_user.recht = "-4" ORDER BY prefix_user.llogin DESC ');
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></td></tr>';
    	$break[] = $erg['id'];
    }
    
    $content .= '<tr><td>User Online</td></tr>';
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-3" OR prefix_user.recht = "-2" OR prefix_user.recht = "-1" ORDER BY prefix_user.llogin DESC ');
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'"> '.$erg['name'].'</a></td></tr>';
    	$break[] = $erg['id'];
    }
    
    
    $content .= '<tr><td><hr style="border-style: dashed; border-color: rgb(154, 177, 200); border-width: 1px 0px 0px; height: 0px;"></td></tr>';
    $erg = mysql_fetch_assoc(db_query('SELECT COUNT(uid) FROM prefix_online WHERE uptime > "'. $dif.'" AND uid = "0" GROUP BY uid'));
    $content .= '<tr><td>';
    	if($erg['COUNT(uid)'] == "0" OR empty($erg) )
    	{
    		$content .= '<img src="include/images/icons/offline.gif" alt="offline" border="0"> Kein Gast ';
    	}
    	elseif($erg['COUNT(uid)'] == "1")
    	{
    		$content .= '<img src="include/images/icons/online.gif" alt="online" border="0"> 1 Gast';
    	}
    	else
    	{
    		$content .= '<img src="include/images/icons/online.gif" alt="online" border="0"> '.$erg['COUNT(uid)'].' G&auml;ste';
    	}
    $content .= '</td></tr>';
    $content .= '</table>';
    
    echo $content;


    werden

    admins
    leader
    member
    user
    gäste
    angezeigt mehr nit
    0 Mitglieder finden den Beitrag gut.
  6. #6
    User Pic
    Beatzler Mitglied
    Registriert seit
    17.04.2005
    Beiträge
    186
    Beitragswertungen
    0 Beitragspunkte
    ZitatZitat geschrieben von Parkuhr

    Ich hätt jetzt einfach das Limit runtergesetzt....


    das ginge so:

    <?php
    if (!defined('main')) {die("no direct access");}
    $dif = date('Y-m-d H:i:s', time() - 60);
    $abf = "SELECT uid FROM `prefix_online` WHERE uptime > '". $dif."'";
    $resultID = db_query($abf);
    $brk='';
    $uid = array();
    $guests = 0;
    $guestn = $lang['guests'];
    $content='';
    
    while ($row = db_fetch_object($resultID)) {
    	if ($row->uid != 0 AND $brk!=$row->uid) {
    		$name=@db_result(db_query('SELECT name FROM prefix_user WHERE id='.$row->uid),0);
    		$content.= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td>';
    		$content.='<td><a href="index.php?user-details-'.$row->uid.'">'.$name.'</a></td></tr>'."n";
    		$uid[] = $row->uid;
    	}
    	if ($row->uid == 0) { $guests++; }
    	$brk=$row->uid;
    }
    if ($guests == 1) { $guestn = $lang['guest']; }
    if (empty($content)) { $content.='<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><font color="#003366">0 User </font></td></tr>'."n"; }
    
    $content.='<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."n";
    $where = (count($uid)>0) ? 'WHERE id NOT IN ('.implode(', ', $uid).')' : '';
    $abf2 = 'SELECT * FROM prefix_user '.$where.' ORDER BY llogin DESC LIMIT 0,0';
    $erg2 = db_query($abf2);
    
    while ($row2 = db_fetch_object($erg2)) {
    	$datum = date('H:i d.m.y',$row2->llogin);
    	$user = $row2->name;
    	$content.='<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><a href="index.php?user-details-'.$row2->id.'" title="'.$lang['lasttimeonline'].$datum.'">'.$user.'</a></td></tr>'."n";
    }
    if ($guests == 0) {
    	$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px";></td></tr>'."n".'
    		<tr><td><img src="include/images/icons/offline.gif"  border="0" alt="offline"></td><td><font size="-1" color="#003366">0 '.$lang['guests'].'</td></tr>'."n";
    } else {
    	$content.= '<tr><td colspan="2"><hr style="height: 0px; border: dashed #9AB1C8 0px; border-top-width: 1px;"></td></tr>'."n".'
    		<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"></td><td><font size=-1>'.$guests.' '.$guestn.'</font></td></tr>'."n";
    }
    ?>
    <table align="center" border="0" cellpadding="0" cellspacing="0" >
     <?php echo $content; ?>
    </table>





    Klappt super ! Vielen Dank !
    0 Mitglieder finden den Beitrag gut.
  7. #7
    User Pic
    Der Bock Mitglied
    Registriert seit
    20.11.2008
    Beiträge
    53
    Beitragswertungen
    0 Beitragspunkte
    Habe die Box mal eingebaut!
    Leider wird dadurch meine Seite extrem verlangsamt!
    Woran könnte das liegen?
    0 Mitglieder finden den Beitrag gut.
  8. #8
    User Pic
    Halfbax Mitglied
    Registriert seit
    05.03.2009
    Beiträge
    92
    Beitragswertungen
    0 Beitragspunkte
    Was zu hochgesetzt vielleicht , was haste den genau umgestellt
    0 Mitglieder finden den Beitrag gut.
  9. #9
    User Pic
    Der Bock Mitglied
    Registriert seit
    20.11.2008
    Beiträge
    53
    Beitragswertungen
    0 Beitragspunkte
    Nichts umgestellt!
    Genau diese Version benutzt.
    Sobald sie eingefügt ist, reagiert die seite SEHR langsam.
    Wenn ich sie entferne geht alles wie gewohnt!
    Meine diese Box:
    <?php 
    if (!defined('main')) {die("no direct access");} 
    
    $dif = date('Y-m-d H:i:s', time() - 500); 
    $dif2 = time()-500; 
    $break = array(); 
    
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.recht = "-9" ORDER BY prefix_user.llogin DESC LIMIT 0,4'); 
    
    $content .= '<table align="center" border="0" cellpadding="2" cellspacing="2">'; 
    $content .= '<tr><td>Admin Online</td></tr>'; 
    while($erg = mysql_fetch_assoc($abf) ) 
    { 
        if(in_array($erg['id'],$break) ) 
        { 
            continue; 
        } 
        $test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" ')); 
        if($test['llogin'] < $dif2) 
        continue; 
         
        $content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></td></tr>'; 
        $break[] = $erg['id']; 
    } 
    
    $content .= '<tr><td>Leader</td></tr>'; 
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-8" OR prefix_user.recht = "-7" ORDER BY prefix_user.llogin DESC '); 
    while($erg = mysql_fetch_assoc($abf) ) 
    { 
        if(in_array($erg['id'],$break) ) 
        { 
            continue; 
        } 
        $test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" ')); 
        if($test['llogin'] < $dif2) 
        continue; 
         
        $content .= '<tr><td><font color="#FF0000"><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></font></td></tr>'; 
        $break[] = $erg['id']; 
    } 
    
    $content .= '<tr><td>Member Online</td></tr>'; 
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-6" OR prefix_user.recht = "-5" OR prefix_user.recht = "-4" ORDER BY prefix_user.llogin DESC '); 
    while($erg = mysql_fetch_assoc($abf) ) 
    { 
        if(in_array($erg['id'],$break) ) 
        { 
            continue; 
        } 
        $test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" ')); 
        if($test['llogin'] < $dif2) 
        continue; 
         
        $content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></td></tr>'; 
        $break[] = $erg['id']; 
    } 
    
    $content .= '<tr><td>User Online</td></tr>'; 
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-3" OR prefix_user.recht = "-2" OR prefix_user.recht = "-1" ORDER BY prefix_user.llogin DESC '); 
    while($erg = mysql_fetch_assoc($abf) ) 
    { 
        if(in_array($erg['id'],$break) ) 
        { 
            continue; 
        } 
        $test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" ')); 
        if($test['llogin'] < $dif2) 
        continue; 
         
        $content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'"> '.$erg['name'].'</a></td></tr>'; 
        $break[] = $erg['id']; 
    } 
    
    
    $content .= '<tr><td><hr style="border-style: dashed; border-color: rgb(154, 177, 200); border-width: 1px 0px 0px; height: 0px;"></td></tr>'; 
    $erg = mysql_fetch_assoc(db_query('SELECT COUNT(uid) FROM prefix_online WHERE uptime > "'. $dif.'" AND uid = "0" GROUP BY uid')); 
    $content .= '<tr><td>'; 
        if($erg['COUNT(uid)'] == "0" OR empty($erg) ) 
        { 
            $content .= '<img src="include/images/icons/offline.gif" alt="offline" border="0"> Kein Gast '; 
        } 
        elseif($erg['COUNT(uid)'] == "1") 
        { 
            $content .= '<img src="include/images/icons/online.gif" alt="online" border="0"> 1 Gast'; 
        } 
        else 
        { 
            $content .= '<img src="include/images/icons/online.gif" alt="online" border="0"> '.$erg['COUNT(uid)'].' G&auml;ste'; 
        } 
    $content .= '</td></tr>'; 
    $content .= '</table>'; 
    
    echo $content;



    Zuletzt modifiziert von Der Bock am 14.04.2009 - 00:02:04
    0 Mitglieder finden den Beitrag gut.
  10. #10
    User Pic
    Der Bock Mitglied
    Registriert seit
    20.11.2008
    Beiträge
    53
    Beitragswertungen
    0 Beitragspunkte
    Habe leider weiterhin ein massives "Geschwindigkeitsproblem"!
    Woran kann es liegen???
    0 Mitglieder finden den Beitrag gut.
  11. #11
    User Pic
    ASHP Mitglied
    Registriert seit
    07.03.2008
    Beiträge
    267
    Beitragswertungen
    1 Beitragspunkte
    wie wäre es denn erstmal mit einem link zu deiner seite? (:
    0 Mitglieder finden den Beitrag gut.
  12. #12
    User Pic
    Der Bock Mitglied
    Registriert seit
    20.11.2008
    Beiträge
    53
    Beitragswertungen
    0 Beitragspunkte
    Onlineanzeige ist aber nicht aktiv (diese)!
    Hier der Link zu meiner HP : externer Link
    Steht auch im Profil!:)
    0 Mitglieder finden den Beitrag gut.
  13. #13
    User Pic
    Der Bock Mitglied
    Registriert seit
    20.11.2008
    Beiträge
    53
    Beitragswertungen
    0 Beitragspunkte
    Mairu hat das "Original" mal schlanker gemacht!
    Jetzt läuft es super, die Gruppen werden immer angezeigt und die dazugehörigen "Rechteinhaber" darunter gelistet wenn sie online sind!
    Hier könnt ihr sehen wie es aussieht: externer Link
    Von mir wurde es noch mit Grafiken versehen.
    Hier der Code:
     <?php 
    if (!defined('main')) {die("no direct access");} 
    
    $dif = date('Y-m-d H:i:s', time() - 200); 
    $dif2 = time()-200; 
    $break = array(); 
    
    $lastUID = -1; 
    
    $headers = array(-9 => 'cleader', -7 => 'supporter', -6 => 'sleader', -5 => 'cmember', -2 =>'regist2'); 
    $contents = array(-9 => array(), -7 => array(), -6 => array(), -5 => array(), -2 => array()); 
    
    $content = '<table align="center" border="0" cellpadding="2" cellspacing="2">'; 
    
    $abf = db_query('SELECT u.id, u.llogin, u.name, u.recht FROM prefix_online o INNER JOIN prefix_user u ON u.id = o.uid WHERE o.uptime > "'. $dif.'" AND u.llogin > "'.dif2.'" AND u.recht < 0 ORDER BY u.recht, o.uid, u.llogin DESC '); 
    while($erg = mysql_fetch_assoc($abf)) { 
        $id = $erg['id']; 
        if ($lastUID == $id) { 
            continue; 
        } 
        $key = null; 
        switch($erg['recht']){ 
            case -9: case -8: 
                $key = -9; 
                break; 
            case -7: 
                $key = -7; 
                break; 
            case -6: case -5:
                $key = -6; 
                break; 
             case -4: case -3: 
                $key = -5; 
                break; 
            case -2: case -1: 
                $key = -2; 
                break; 
        } 
    
        $contents[$key][] = '<tr><td><center><a href="index.php?benutzercenter"><img src="include/images/icons/left.gif" border="0" alt="Benutzercenter"><a href="index.php?user-details-'.$id.'"> '.$erg['name'].'  <a href="index.php?forum-privmsg-new=0&empfid='.$id.'"><img src="include/images/icons/right.gif" border="0" alt="PN senden!"></center></a></td></tr>'; 
        $lastUID = $id; 
    } 
    
    foreach ($headers as $key => $head){ 
        $content .=  '<tr><td align="center"><img src="include/images/onlinebox/'.$head.'.jpg"></td></tr>'; 
        foreach ($contents[$key] as $line){ 
            $content .= $line; 
        } 
    } 
    
    //$content .= '<tr><td><hr style="border-style: dashed; border-color: rgb(154, 177, 200); border-width: 1px 0px 0px; height: 0px;"></td></tr>'; 
    $content .= '</table>'; 
    
    echo $content; 
    
    ?>

    Viel Spass damit und besten Dank an Mairu noch einmal!!!:)


    Zuletzt modifiziert von Der Bock am 16.04.2009 - 21:22:45
    0 Mitglieder finden den Beitrag gut.
  14. #14
    User Pic
    Fonsi1 Mitglied
    Registriert seit
    01.05.2010
    Beiträge
    455
    Beitragswertungen
    35 Beitragspunkte
    Hallo liebe Ilchler

    ZitatZitat geschrieben von MVN050

    ich hab ne eigene

    probier die mal aus

    <?php
    if (!defined('main')) {die("no direct access");}
    
    $dif = date('Y-m-d H:i:s', time() - 500);
    $dif2 = time()-500;
    $break = array();
    
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.recht = "-9" ORDER BY prefix_user.llogin DESC LIMIT 0,4');
    
    $content .= '<table align="center" border="0" cellpadding="2" cellspacing="2">';
    $content .= '<tr><td>Admin Online</td></tr>';
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></td></tr>';
    	$break[] = $erg['id'];
    }
    
    $content .= '<tr><td>Leader</td></tr>';
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-8" OR prefix_user.recht = "-7" ORDER BY prefix_user.llogin DESC ');
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><font color="#FF0000"><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></font></td></tr>';
    	$break[] = $erg['id'];
    }
    
    $content .= '<tr><td>Member Online</td></tr>';
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-6" OR prefix_user.recht = "-5" OR prefix_user.recht = "-4" ORDER BY prefix_user.llogin DESC ');
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'">STS_ '.$erg['name'].'</a></td></tr>';
    	$break[] = $erg['id'];
    }
    
    $content .= '<tr><td>User Online</td></tr>';
    $abf = db_query('SELECT * FROM prefix_online,prefix_user WHERE uptime > "'. $dif.'" AND prefix_user.llogin > "'.dif2.'" AND prefix_user.id = prefix_online.uid AND prefix_user.recht = "-3" OR prefix_user.recht = "-2" OR prefix_user.recht = "-1" ORDER BY prefix_user.llogin DESC ');
    while($erg = mysql_fetch_assoc($abf) )
    {
    	if(in_array($erg['id'],$break) )
    	{
    		continue;
    	}
    	$test = mysql_fetch_assoc(db_query('SELECT llogin FROM prefix_user WHERE id = "'.$erg['id'].'" '));
    	if($test['llogin'] < $dif2)
    	continue;
    	
    	$content .= '<tr><td><img src="include/images/icons/online.gif" border="0" alt="online"><a href="index.php?user-details-'.$erg['id'].'"> '.$erg['name'].'</a></td></tr>';
    	$break[] = $erg['id'];
    }
    
    
    $content .= '<tr><td><hr style="border-style: dashed; border-color: rgb(154, 177, 200); border-width: 1px 0px 0px; height: 0px;"></td></tr>';
    $erg = mysql_fetch_assoc(db_query('SELECT COUNT(uid) FROM prefix_online WHERE uptime > "'. $dif.'" AND uid = "0" GROUP BY uid'));
    $content .= '<tr><td>';
    	if($erg['COUNT(uid)'] == "0" OR empty($erg) )
    	{
    		$content .= '<img src="include/images/icons/offline.gif" alt="offline" border="0"> Kein Gast ';
    	}
    	elseif($erg['COUNT(uid)'] == "1")
    	{
    		$content .= '<img src="include/images/icons/online.gif" alt="online" border="0"> 1 Gast';
    	}
    	else
    	{
    		$content .= '<img src="include/images/icons/online.gif" alt="online" border="0"> '.$erg['COUNT(uid)'].' G&auml;ste';
    	}
    $content .= '</td></tr>';
    $content .= '</table>';
    
    echo $content;


    werden

    admins
    leader
    member
    user
    gäste
    angezeigt mehr nit


    Ein Kolege von mir hat sich das auch reingemacht, klapt soweit auch gut.
    Wenn er aber dann den Namen anklickt, um zum Profil zugelangen.
    Erscheint volgende Fehlermeldung
    Notice: Use of undefined constant dif2 - assumed 'dif2' in /var/www/web58/html/include/boxes/online.php on line 8

    Notice: Undefined variable: content in /var/www/web58/html/include/boxes/online.php on line 10

    Notice: Use of undefined constant dif2 - assumed 'dif2' in /var/www/web58/html/include/boxes/online.php on line 27

    Notice: Use of undefined constant dif2 - assumed 'dif2' in /var/www/web58/html/include/boxes/online.php on line 43

    Notice: Use of undefined constant dif2 - assumed 'dif2' in /var/www/web58/html/include/boxes/online.php on line 59

    Was muß er ändern??
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Module und Modifikationen

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten