PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/includes/core/online.php

http://viet-group.googlecode.com/
PHP | 42 lines | 26 code | 5 blank | 11 comment | 2 complexity | 13b92f956fb6cca5641d2091bd6f86c4 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /**
  3. * @Project NUKEVIET 3.0
  4. * @Author VINADES.,JSC (contact@vinades.vn)
  5. * @copyright 2009
  6. * @createdate 12/29/2009 15:33
  7. */
  8. if ( ! defined( 'NV_MAINFILE' ) ) die( 'Stop!!!' );
  9. /**
  10. * nv_online_upd()
  11. *
  12. * @return void
  13. */
  14. function nv_online_upd ( )
  15. {
  16. global $db, $client_info, $user_info;
  17. $userid = 0;
  18. $username = "guest";
  19. if ( isset( $user_info['userid'] ) and $user_info['userid'] > 0 )
  20. {
  21. $userid = $user_info['userid'];
  22. $username = $user_info['username'];
  23. }
  24. elseif ( $client_info['is_bot'] )
  25. {
  26. $username = 'bot:' . $client_info['bot_info']['name'];
  27. }
  28. $query = "REPLACE INTO `" . NV_SESSIONS_GLOBALTABLE . "` VALUES (
  29. " . $db->dbescape( $client_info['session_id'] ) . ",
  30. " . $userid . ",
  31. " . $db->dbescape( $username ) . ",
  32. " . NV_CURRENTTIME . "
  33. )";
  34. $db->sql_query( $query );
  35. }
  36. nv_online_upd();
  37. ?>