Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.62 KB | None | 0 0
  1. <?php
  2. require_once('../config_session.php');
  3.  
  4. $check_action = getDelay();
  5. $online_delay = time() - ( 86400 * 7 );
  6. $online_user = '';
  7. $offline_user = '';
  8. $onair_user = '';
  9. $offcount = 1;
  10.  
  11. if($data['last_action'] < getDelay()){
  12.     $mysqli->query("UPDATE boom_users SET last_action = '" . time() . "' WHERE user_id = '{$data['user_id']}'");
  13. }
  14.  
  15. $data_list = $mysqli->query("
  16.     SELECT user_name, user_color, user_rank, user_dj, user_onair, user_join, user_tumb, user_status, user_sex,
  17.     user_id, ureg_mute, user_mute, user_temp_mute, room_mute, last_action, user_bot, user_role, user_mood, country, userlist_seg
  18.     FROM `boom_users`
  19.     WHERE `user_roomid` = {$data["user_roomid"]}  AND last_action > '$check_action' AND user_status != 6 || user_bot = 1
  20.     ORDER BY `user_rank` DESC, `user_name` ASC
  21. ");
  22.  
  23. if($data['max_offcount'] > 0){
  24.     $offline_list = $mysqli->query("
  25.         SELECT user_name, user_color, user_rank, user_dj, user_onair, user_join, user_tumb, user_status, user_sex,
  26.         user_id, ureg_mute,user_mute, user_temp_mute, room_mute, last_action, user_bot, user_role, user_mood, country
  27.         FROM `boom_users`
  28.         WHERE `user_roomid` = {$data["user_roomid"]}  AND last_action > '$online_delay' AND last_action < '$check_action' AND user_status != 6 AND  user_rank != 0 AND user_bot = 0
  29.         ORDER BY last_action DESC LIMIT {$data['max_offcount']}
  30.     ");
  31. }
  32.  
  33. mysqli_close($mysqli);
  34.  
  35. if ($data_list->num_rows > 0){
  36.     $total_online_users = $total_birthday_users = $total_most_active_users = $total_chemical_users = $total_onair_users = 0;
  37.     while ($list = $data_list->fetch_assoc()){
  38.         if($list['user_dj'] == 1 && $list['user_onair'] == 1){
  39.             $onair_user .= createUserlist($list);
  40.             $total_onair_users++;
  41.         } else if($list['userlist_seg'] == 1) {
  42.             $birthday_user .= createUserlist($list);
  43.             $total_birthday_users++;
  44.         } else if($list['userlist_seg'] == 2) {
  45.             $most_active_user .= createUserlist($list);
  46.             $total_most_active_users++;
  47.         } else if($list['userlist_seg'] == 3) {
  48.             $chemical_user .= createUserlist($list);
  49.             $total_chemical_users++;
  50.         } else {
  51.             $online_user .= createUserlist($list);
  52.             $total_online_users++;
  53.         }
  54.     }
  55. }
  56. if($data['max_offcount'] > 0){
  57.     if($offline_list->num_rows > 0){
  58.         while($offlist = $offline_list->fetch_assoc()){
  59.             $offline_user .= createUserlist($offlist);
  60.         }
  61.     }
  62. }
  63.  
  64. ?>
  65. <div id="container_user">
  66.     <div class="pad10 boom_keep" id="friend_search_box">
  67.         <div class="search_bar">
  68.             <input id="search_elements" placeholder="&#xf002; Търсене на поребител..." class="full_input" type="text"/>
  69.             <div class="clear"></div>
  70.         </div>
  71.     </div>
  72.     <?php if($onair_user != ''){ ?>
  73.     <div class="user_count dj-onair-user-list">
  74.         <div class="bcell"><i class="ico_owner owner"></i>
  75.             Общо <?php echo ' <font color="red">(' . $total_onair_users . ')</font> собственик на линия'; ?>
  76.         </div>
  77.     </div>
  78.     <div class="dj_on_air_user"><?php echo $onair_user; ?></div>
  79.     <?php } ?>
  80.     <?php if($offline_user != '' || $onair_user != ''){ ?>
  81.     <div class="user_count online-user-list">
  82.         <div class="bcell"><i class="fa fa-check" aria-hidden="true" style="color:green"></i>
  83.             Общо <?php echo  ' <font color="green">(' . $total_online_users . ')</font> потр. на линия'; ?>
  84.         </div>
  85.     </div>
  86.     <?php } ?>
  87.     <div class="online_user"><?php echo $online_user; ?></div>
  88.     <?php if($offline_user != ''){ ?>
  89.     <div class="user_count">
  90.         <div class="bcell"><i class="fa fa-times" aria-hidden="true" style="color:red"></i>
  91.             <?php echo $lang['offline']; ?>
  92.         </div>
  93.     </div>
  94.     <div class="online_user"><?php echo $offline_user; ?></div>
  95.     <?php } ?>
  96.     <div class="clear"></div>
  97. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement