public static function record($T1 = '', $JR = '')
{
global $wpdb;
$Ya = $wpdb->get_charset_collate();
$CN = "CREATE TABLE if not exists`{$wpdb->base_prefix}moul_mg_users_online` (
\xa \x9\x9\x9 \x9\x9\x9 timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
\xa \x9\x9 \x9 \x9\x9\x9user_type varchar( 20 ) NOT NULL default 'guest',
\xa\x9 \x9\x9 \x9 user_id bigint( ) NOT NULL default 0,
\xa\x9\x9 \x9\x9 \x9\x9 user_name varchar(50 ) NOT NULL default '',
\x9\x9\x9\x9\x9\x9\x9 user_ip varchar(9 ) NOT NULL default '',\xd
\x9 \x9\x9 \x9 page_title text NOT NULL,\xd\xa \x9\x9\x9\x9\x9\x9page_url varchar( 255 ) NOT NULL default '',
\x9\x9 \x9\x9UNIQUE KEY useronline_id ( timestamp, user_type, user_ip )
\xa\x9 \x9\x9 \x9 ) {$Ya};";
if (!function_exists("dbDelta")) {
include_once ABSPATH . "wp-admin" . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "upgrade.php";
}
dbDelta($CN);
global $wpdb;
$current_user = wp_get_current_user();
if (!is_user_logged_in()) {
goto cR;
}
$Cg = self::moul_mg_get_ip();
if (!$current_user->ID) {
goto pX;
}
$ki = $current_user->ID;
$Li = $current_user->display_name;
$jK = "member";
$Jf = $wpdb->prepare("WHERE user_id = %d", $ki);
pX:
$j0 = current_time("mysql");
$wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->base_prefix}moul_mg_users_online` WHERE (user_id <> 0 AND user_id = %d) OR (user_id = AND user_ip = %s) OR (timestamp < DATE_SUB(%s, INTERVAL %d SECOND))", $ki, $Cg, $j0, 300));
$MF = compact("timestamp", "user_type", "user_id", "user_name", "user_ip", "page_title", "page_url");
$MF = stripslashes_deep($MF);
$wpdb->replace($wpdb->base_prefix . "moul_mg_users_online", $MF);
cR:
}
© 2023 Quttera Ltd. All rights reserved.