Ich hab nun eine Box in mein forum intigiert die die letzten aktivitäten user mit zeit auflisten soll. Das funktioniert auch nur würde ich das gerne so haben der er mir nur noch die letzten 24 stunden anzeigt und nicht eine bestimmte anzahl wie es jetzt ist.
Hier mal code:
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 | <?php defined ( 'main' ) or die ( 'no direct access' ); $time = time(); $one_day = 86400; $one_hour = 3600; $one_minute = 60; $onlinequery = "SELECT id,name,llogin FROM `prefix_user` ORDER BY llogin DESC LIMIT 30 " ; $onlineres = @db_query( $onlinequery ); $showlastonline = NULL; while ( $onlinerow = db_fetch_assoc( $onlineres )) { $timeagosec = round ( $time - $onlinerow [ 'llogin' ]); $timeagomin = round ( $timeagosec / 60); $timeagohrs = round ( $timeagomin / 60); $timeagoday = round ( $timeagohrs / 24); if ( $timeagosec > $one_day ) { $showlastonline_ = 'vor ' . $timeagoday . ' Tagen' ; } else if ( $timeagosec > $one_hour ) { $showlastonline_ = 'vor ' . $timeagohrs . ' Stunden' ; } else if ( $timeagosec > $one_minute ) { $showlastonline_ = 'vor ' . $timeagomin . ' Minuten' ; } else { $showlastonline_ = 'online' ; } echo '<a href="index.php?user-details-' . $onlinerow [ 'id' ]. '" style="font-size:12px; color:#FFFFFF;">' . $onlinerow [ 'name' ]. '</a> <span style="font-size:10px; color:#999999;">(' . $showlastonline_ . ')</span> ' ; } ?> |
MFG swatch
betroffene Homepage: raisedfist.pytalhost.de/index.php?forum