summaryrefslogtreecommitdiff
path: root/includes/funktion_activeUser.php
diff options
context:
space:
mode:
authorichdasich <ichdasich@29ba0400-6e00-0410-a75a-ca02368028f8>2008-09-10 03:42:44 +0000
committerichdasich <ichdasich@29ba0400-6e00-0410-a75a-ca02368028f8>2008-09-10 03:42:44 +0000
commitb00d5b96c6d33572b6d7c68688d6d1c4fbd0f0f4 (patch)
treecf02da8b2839bea3b6a966b575f2ba84966676bb /includes/funktion_activeUser.php
parent34aff10f383fe963cd3f8fd7f096321302e1efb6 (diff)
moved /inc to ../includes
git-svn-id: svn://svn.cccv.de/engel-system@281 29ba0400-6e00-0410-a75a-ca02368028f8
Diffstat (limited to 'includes/funktion_activeUser.php')
-rwxr-xr-xincludes/funktion_activeUser.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/includes/funktion_activeUser.php b/includes/funktion_activeUser.php
new file mode 100755
index 00000000..946af304
--- /dev/null
+++ b/includes/funktion_activeUser.php
@@ -0,0 +1,61 @@
+<?PHP
+
+// Functionen gibt es nicht auf ellen rechern
+if( !function_exists("bcdiv"))
+{
+ function bcdiv( $param1, $param2)
+ {
+ return floor( $param1 / $param2);
+ }
+}
+
+if( !function_exists("bcmod"))
+{
+ function bcmod( $param1, $param2)
+ {
+ return $param1 - ( $param2 * bcdiv( $param1, $param2));
+ }
+}
+
+
+echo "<h4 class=\"menu\">Engel online</h4>";
+
+$SQL = "SELECT UID, Nick, lastLogIn ".
+ "FROM User ".
+ "WHERE (`lastLogIn` > '". gmdate("YmdHis", time()-(60*60)). "' AND NOT (UID=". $_SESSION['UID']. ")) ".
+ "ORDER BY lastLogIn DESC;";
+
+$Erg = mysql_query( $SQL, $con);
+
+
+$Tist = (gmdate("d", time()) * 60 * 60 * 24) + // Tag
+ (gmdate("H", time()) * 60 * 60) + // Stunde
+ (gmdate("i", time()) * 60) + // Minute
+ (gmdate("s", time()) ); // Sekunde
+
+for( $i=0; $i<mysql_num_rows($Erg); $i++)
+{
+ echo "\t\t\t<li>";
+ if( $_SESSION['UID']>0 )
+ echo DisplayAvatar( mysql_result( $Erg, $i, "UID"));
+ // Schow Admin Page
+ if( $_SESSION['CVS'][ "admin/user.php" ] == "Y" )
+ echo " <a href=\"./../admin/user.php?enterUID=". mysql_result( $Erg, $i, "UID"). "&Type=Normal\">".
+ mysql_result( $Erg, $i, "Nick"). "</a>";
+ else
+ echo mysql_result( $Erg, $i, "Nick");
+
+ $Tlog = (substr( mysql_result( $Erg, $i, "lastLogIn"), 8, 2) * 60 * 60 * 24) + // Tag
+ (substr( mysql_result( $Erg, $i, "lastLogIn"), 11, 2) * 60 * 60) + // Stunde
+ (substr( mysql_result( $Erg, $i, "lastLogIn"), 14, 2) * 60) + // Minute
+ (substr( mysql_result( $Erg, $i, "lastLogIn"), 17, 2) ); // Sekunde
+
+ $Tlog = $Tist-$Tlog;
+ echo " ". bcdiv( $Tlog, 60). ":";
+ if( strlen(bcmod( $Tlog, 60))==1)
+ echo "0";
+ echo bcmod( $Tlog, 60);
+ echo "</li>\n";
+}
+
+?>