mudzakkir

2newfunction

Feb 9th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. /**
  2. * count Online User. user_status 0 is offline user, user_status 1 is online user
  3. * @return Integer The return value shows how many Online User of the time
  4. *
  5. */
  6. function counterOnline() {
  7. $sql_count_visitor = "SELECT Count(DISTINCT users.uniq) from users
  8. where user_status='1'
  9. ORDER BY
  10. users.first_name ASC";
  11. $exec_count_visit = mysql_query($sql_count_visitor);
  12. $count_visit = mysql_num_rows($exec_count_visit);
  13. list($count_visit) = mysql_fetch_row($exec_count_visit);
  14. return $count_visit;
  15. }
  16.  
  17. /**
  18. * count visitors of current user
  19. * @return Integer The return value shows how many Visitors of current User of the time
  20. */
  21. function counterVisitor() {
  22.  
  23. $sql_count_visitor = "SELECT count(DISTINCT who_visit_myprofile.visiter_id) from who_visit_myprofile
  24. where user_id='" . $_SESSION['user'] . "' AND visiter_id!='" . $_SESSION['user'] . "'
  25. ORDER BY who_visit_myprofile.`timestamp` DESC";
  26. $exec_count_visit = mysql_query($sql_count_visitor);
  27. $count_visit = mysql_num_rows($exec_count_visit);
  28. list($count_visit) = mysql_fetch_row($exec_count_visit);
  29. return $count_visit;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment