تثبيت رمز الهاتف والكمبيوتر للزائر

اضغط هنا لمعاينة كودي شات( Enter Codychat )

admin

Administrator
طاقم الإدارة
Today I will explain the mobile detection

first

go

db

and go boom_users

and create table name

user_mobile

example

مشاهدة المرفق 29
and go function.php

add this code last

PHP:
function Mobiledetection() {
    if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) {
       return 0;
    }
    elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false
        || strpos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false
        || strpos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false
        || strpos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false
        || strpos( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) !== false
        || strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false
        || strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) !== false ) {
        return 1;
    }
    else {
        return 0;
    }
}
and search this

PHP:
    function createUserlist($list, $type = 1){
and add this

PHP:
$mobile = '';
and add this also

PHP:
if($list['user_mobile']>= 1 && $list['user_mobile'] <= 1){
$mobile = '<div class="user_item_icon icrank"><img class="list_rank" src="default_images/icons/mobile.svg"title="Mobile"/></div>';
}
elseif ($list['user_mobile'] >= 0 && $list['user_mobile'] <= 0){
$mobile = '<div class="user_item_icon icrank"><img class="list_rank" src="default_images/icons/pc.svg"title="Desktop"/></div>';
}
and add this
search

PHP:
' . $muted . $icon . $flag . '
and replace
كود:
' . $mobile . $muted . $icon . $flag . '
and go system/chat_log.php add
PHP:
$mobile = Mobiledetection();
$mysqli->query("UPDATE boom_users SET join_msg = '1', last_action = '" . time() . "', user_ip = '$ip', user_mobile = '$mobile' WHERE user_id = '{$data['user_id']}'");
}
مشاهدة المرفق 30


download icon

upload this mobile.svg and pc.svg in path

default_images/icons/

and go /system/panel/user_list.php

and add user_mobile

like this


PHP:
$data_list = $mysqli->query("
    SELECT user_name, user_color, user_rank, user_dj, user_onair, user_join, user_tumb, user_status, user_sex,
    user_id, user_mobile,user_mute, room_mute, last_action, user_bot, user_role, user_mood, country
    FROM `boom_users`
    WHERE `user_roomid` = {$data["user_roomid"]}  AND last_action > '$check_action' AND user_status != 6 || user_bot = 1
    ORDER BY `user_rank` DESC, user_role DESC, `user_name` ASC
");

if($data['max_offcount'] > 0){
    $offline_list = $mysqli->query("
        SELECT user_mobile,user_name, user_color, user_rank, user_dj, user_onair, user_join, user_tumb, user_status, user_sex,
        user_id, user_mute, room_mute, last_action, user_bot, user_role, user_mood, country
        FROM `boom_users`
        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
        ORDER BY last_action DESC LIMIT {$data['max_offcount']}
    ");
}
Medo

 
أعلى