Файловый менеджер - Редактировать - C:/wwwroot/gamegowins.com/static/img/logo/functions.tar
�азад
add-user.php 0000666 00000011007 15032122743 0006763 0 ustar 00 <?php session_start(); require_once '../../config.php'; require_once '../../app/includes/constant.php'; require_once '../../app/includes/app_start.php'; function ValidateFields($field, $var) { global $socket; $Validate = "select * from zon_users where $field='$var'"; return mysqli_num_rows(mysqli_query($socket, $Validate)); } // User Adding, Updating And Deleteing Action if (isset($_POST['add_user']) && isset($_POST)) { // $id = mysqli_real_escape_string($con, $_POST['id']); $name = mysqli_real_escape_string($con, $_POST['name']); $email = mysqli_real_escape_string($con, $_POST['email']); $username = mysqli_real_escape_string($con, $_POST['username']); $password = mysqli_real_escape_string($con, $_POST['password']); $user_status = mysqli_real_escape_string($con, $_POST['user_status']); $_SESSION['name'] = $name; $_SESSION['email'] = $email; $_SESSION['username'] = $username; $_SESSION['password'] = $password; $user_pic = "user_pic.png"; if ($_FILES['user_pic']['error'] == 0) { $file_name = rand(111111111, 99999999) . $_FILES['user_pic']['name']; $file_tmp = $_FILES['user_pic']['tmp_name']; if (move_uploaded_file($file_tmp, "../../static/img/" . $file_name)) { $user_pic = $file_name; } } if (ValidateFields('email', $email)) { @header("location: ../add-users.php?emailError=Email Already Exist"); // $bool = true; $emil = false; } else { $emil = true; } if (ValidateFields('username', $username)) { @header("location: ../add-users.php?usernameError=Username Already Exist"); $usern = false; } else { $usern = true; } $query = "INSERT INTO zon_users (`name`, `email`, `username`, `password`, `user_pic`, `status`, `is_admin`) VALUES ('$name', '$email', '$username', '$password', '$user_pic', $user_status, 0) "; if ($usern == true && $emil == true) { if (mysqli_query($con, $query)) { unset($_SESSION['name']); unset($_SESSION['email']); unset($_SESSION['username']); unset($_SESSION['password']); @header("location: ../users.php"); } } } if (isset($_POST['update_user']) && isset($_POST)) { $id = mysqli_real_escape_string($con, $_POST['user_id']); $name = mysqli_real_escape_string($con, $_POST['name']); $email = mysqli_real_escape_string($con, $_POST['email']); $username = mysqli_real_escape_string($con, $_POST['username']); $password = mysqli_real_escape_string($con, $_POST['password']); $user_status = mysqli_real_escape_string($con, $_POST['user_status']); // $user_pic = "user_pic.png"; if (ValidateFields('email', $email) == 2 && ValidateFields('username', $username) == 2) { @header("location: ../add-users.php?action=update&token_id=$id&emailError=Email Already Exist&usernameError=Username Already Exist"); $user = false; } else { $user = true; } if (ValidateFields('email', $email) == 2) { @header("location: ../add-users.php?action=update&token_id=$id&emailError=Email Already Exist"); $emil = false; } else { $emil = true; } if (ValidateFields('username', $username) == 2) { @header("location: ../add-users.php?action=update&token_id=$id&usernameError=Username Already Exist"); $usern = false; } else { $usern = true; } $query = "UPDATE zon_users SET `name`='$name', `email`='$email', `username`='$username', `password`='$password', `status`=$user_status where id=$id "; if ($_FILES['user_pic']['error'] == 0) { $file_name = rand(111111111, 99999999) . $_FILES['user_pic']['name']; $file_tmp = $_FILES['user_pic']['tmp_name']; if (move_uploaded_file($file_tmp, "../../static/img/" . $file_name)) { $user_pic = $file_name; $query = "UPDATE zon_users SET `name`='$name', `email`='$email', `username`='$username', `password`='$password', `user_pic`='$user_pic', `status`=$user_status where id=$id "; } } if ($usern == true && $emil == true && $user == true) { if (mysqli_query($con, $query)) { unset($_SESSION['name']); unset($_SESSION['email']); unset($_SESSION['username']); unset($_SESSION['password']); @header("location: ../users.php"); } } } api.php 0000666 00000041313 15032122743 0006033 0 ustar 00 <?php session_start(); require_once 'config.php'; require_once '../../app/includes/constant.php'; require_once '../../app/includes/app_start.php'; // Game Adding From Api's if (isset($_POST) && isset($_POST['add_games_from_api']) && isset($_POST['platform'])) { $platform = $_POST['platform']; if ($platform == "gamemonetize") { $category = $_POST['category']; // All 0-19 $type = $_POST['type']; // html5 mobile $popularity = $_POST['popularity']; // newest mostplayed hotgames bestgames exclusivegames editorpicks $company = $_POST['company']; // &company=All $amount = $_POST['amount']; // &amount=All &amount=10 20 30 40 100 $url = "https://gamemonetize.com/rssfeed.php?format=json&category=$category&type=$type&popularity=$popularity$company$amount"; $json_data = file_get_contents($url); // Decode JSON into PHP array $response_data = json_decode($json_data, true); // All user data exists in 'data' object $game_data = $response_data; $xsize = count($game_data); $batch_count = 200 ; // 批量处理数量 // print("############# 欢迎使用日志系统 ############## " . $xsize . "\n\n"); // $logMessage = "[### gamemonetize amount:" . $amount . " 拉取数量:" . $xsize . "\n\n" ; // $logFile = "X:\phpstudy_pro\Extensions\Apache2.4.39\logs\your_log_file.log"; // // 将日志信息追加到日志文件 // file_put_contents($logFile, $logMessage, FILE_APPEND); // 分类 $categorys = []; $sqls = array(); $sql = ""; foreach ($game_data as $key => $game) { $game_dev_type = $type; // html5 mobile $game_name = mysqli_real_escape_string($con, $game['title']); $game_desc = mysqli_real_escape_string($con, $game['description']); $game_instructions = mysqli_real_escape_string($con, $game['instructions']); $game_image_url = mysqli_real_escape_string($con, $game['thumb']); // $game_banner_url = ''; $game_banner_url = $game_image_url; $game_frame_url = mysqli_real_escape_string($con, $game['url']); $game_category = mysqli_real_escape_string($con, $game['category']); $game_status = 0; $game_tags = strtolower(mysqli_real_escape_string($con, $game['tags'])); $game_sort = random_int(100, 200); $game_repeats_load = 1; // 评分 $game_quality = round(random_int(80000000, 98000000)/100000000, 8); // 将小数四舍五入到8位小数 // 宽度 $game_width = intval($game['width']); // 高度 $game_height = intval($game['height']); $game_orientation = "landscape"; if ($game_height > $game_width) { $game_orientation = "portrait"; } $game_played = random_int(500, 2200); $cate_slug = strtolower($game_category); $batch_no = $key % $batch_count; // $logMessage = "正在解析[$batch_no] " . $game_name . ", game_image_url: " . $game_image_url; // file_put_contents($logFile, $logMessage . "\n\n", FILE_APPEND); // print("############# 欢迎使用日志系统 " . $key . " " .$game_width . " " . $game_height . " " . $game_played . " " . $game_name . "\n\n"); if (!empty($game_image_url)) { // 游戏处理 if ($key % $batch_count == 0){ $sql = "INSERT INTO `zon_games`(`game_name`, `game_platform`, `game_dev_type`, `game_description`,`game_instructions`, `game_image_url`, `game_banner_url`, `game_url`, `game_published`, `game_category`, `game_tags`, `game_width`, `game_height`, `game_orientation`, `game_sort`, `game_quality`, `game_status`, `game_played`, `game_repeats_load`) VALUES"; } $sql = $sql . " ('$game_name', '$platform', '$game_dev_type','$game_desc','$game_instructions', '$game_image_url', '$game_banner_url', '$game_frame_url', $game_status, '$game_category', '$game_tags', $game_width, $game_height, '$game_orientation', $game_sort, $game_quality, 0, $game_played, 1)"; if($key % $batch_count != ($batch_count -1) && $key != $xsize-1){ $sql = $sql . ", "; }else{ $sql = $sql . " ON DUPLICATE KEY UPDATE game_repeats_load = game_repeats_load + 1"; // array_push($sqls,$sql) ; // file_put_contents($logFile, $sql . "\n\n", FILE_APPEND); if (mysqli_query($con, $sql)) { } } // 分类处理 $categorys[$game_category] = $cate_slug; } } $cat_count = count($categorys); // $obj_json = json_encode($obj); // file_put_contents($logFile, $obj_json . ', cat_count:' . $cat_count . "\n\n", FILE_APPEND); if ($cat_count > 0) { $cate_sql = "INSERT INTO `zon_category`(`name`, `slug`) VALUES"; $i = 0; foreach ($categorys as $key2 => $cate_slug_2) { $cate_sql = $cate_sql . " ('$key2', '$cate_slug_2')"; $i = $i + 1; if($i!=$cat_count){ $cate_sql = $cate_sql . ", "; }else{ $cate_sql = $cate_sql . " ON DUPLICATE KEY UPDATE slug = slug"; } } // file_put_contents($logFile, $cate_sql . '' . $cat_count . "\n\n", FILE_APPEND); if (mysqli_query($con, $cate_sql)) { $query_run = true; } } @header("location: ../"); } } if (isset($_POST) && isset($_POST['add_games_from_api']) && isset($_POST['platform'])) { $platform = $_POST['platform']; if ($platform == "gamedistribution") { $category = $_POST['categories']; $collection = $_POST['collection']; $tags = $_POST['tags']; $type = $_POST['type']; $subType = $_POST['subType']; $mobile = $_POST['mobile']; $rewarded = $_POST['rewarded']; $page = $_POST['page']; $amount = $_POST['amount']; // 单页最多100个,最多200页面 $url = "https://catalog.api.gamedistribution.com/api/v2.0/rss/All/?collection=$collection&categories=$category&tags=$tags&subType=$subType&type=$type&mobile=$mobile&rewarded=$rewarded&amount=$amount&page=$page&format=json"; $json_data = file_get_contents($url); // Decode JSON into PHP array $response_data = json_decode($json_data, true); // All user data exists in 'data' object $game_data = $response_data; foreach ($game_data as $game) { $game_desc = $game['Description']; if(empty($game_desc)){ $game_desc = $game['Title']; } $game_name = mysqli_real_escape_string($con, $game['Title']); $game_desc = mysqli_real_escape_string($con, $game_desc); $game_image_url = mysqli_real_escape_string($con, $game['Asset'][0]); $game_frame_url = mysqli_real_escape_string($con, $game['Url']); $game_category = mysqli_real_escape_string($con, $game['Category'][0]); $game_banner_url = ''; if (empty($game_frame_url)){ $game_frame_url = $$game_frame_url . "?gd_sdk_referrer_url=https://www.1001games.com/"; } // update `zon_games` set game_url=CONCAT(game_url,"?gd_sdk_referrer_url=https://www.1001games.com/") where foreach ($game['Asset'] as $assert_url) { if (strpos($assert_url, "512x512") !== false) { $game_image_url = $assert_url; } else if (strpos($assert_url, "512x340") !== false) { $game_banner_url = $assert_url; } else if (strpos($assert_url, "512x384") !== false) { $game_banner_url = $assert_url; } else if (strpos($assert_url, "1280x720") !== false) { $game_banner_url = $assert_url; } } if (empty($game_banner_url)){ if (isset($game['Asset'][3])) { $game_banner_url = $game['Asset'][3]; }else if (isset($game['Asset'][4])) { $game_banner_url = $game['Asset'][4]; } if (empty($game_banner_url)) { $game_banner_url = $game_image_url; } } $game_status = 0; $cate_slug = strtolower($game_category); $game_dev_type = "html5"; // html5 mobile if ($game['Mobile'] == "true") { $game_dev_type = "mobile"; } $game_instructions = $game['Instructions']; if(empty($game_instructions)){ $game_instructions = $game['Title']; } $game_instructions = mysqli_real_escape_string($con, $game_instructions); $game_tags = mysqli_real_escape_string($con, strtolower(implode(', ', $game['Tag']))); $game_sort = random_int(100, 200); $game_played = random_int(500, 2200); // 评分 $game_quality = round(random_int(80000000, 98000000)/100000000, 8); // 将小数四舍五入到8位小数 // 宽度 $game_width = $game['Width']; // 高度 $game_height = $game['Height']; if (empty($game_width)){ $game_width = 500; } if (empty($game_height)){ $game_height = 500; } $game_orientation = "landscape"; if ($game_height > $game_width) { $game_orientation = "portrait"; } $sql = "INSERT INTO `zon_games`(`game_name`, `game_platform`, `game_dev_type`, `game_description`,`game_instructions`, `game_image_url`, `game_banner_url`, `game_url`, `game_published`, `game_category`, `game_tags`, `game_width`, `game_height`, `game_orientation`, `game_sort`, `game_quality`, `game_status`, `game_played`) VALUES ('$game_name', '$platform', '$game_dev_type','$game_desc','$game_instructions', '$game_image_url', '$game_banner_url', '$game_frame_url', $game_status, '$game_category', '$game_tags', $game_width, $game_height, '$game_orientation', $game_sort, $game_quality, 0, $game_played)"; $cate_sql = "INSERT INTO `zon_category`(`name`, `slug`) VALUES ('$game_category', '$cate_slug')"; $check_game_name = "select * from zon_games where game_name='$game_name'"; if (!empty($game_image_url) && !empty($game['Description']) ) { if (mysqli_num_rows(mysqli_query($con, $check_game_name)) !== 0) { } else { // echo "Width: ". $game['Width'] . ", Height:" . $game['Width'] . $sql; if (mysqli_query($con, $sql)) { } } $check_category_name = "select * from zon_category where name='$game_category'"; if (mysqli_num_rows(mysqli_query($con, $check_category_name)) !== 0) { } else { if ($game_category !== '') { if (mysqli_query($con, $cate_sql)) { $query_run = true; } } } } } @header("location: ../"); } } if (isset($_POST) && isset($_POST['add_games_from_api']) && isset($_POST['platform'])) { $platform = $_POST['platform']; if ($platform == "gamepix") { $category = $_POST['category']; $order = $_POST['order']; $amount = $_POST['items']; $page = $_POST['page']; // Initiate curl session in a variable (resource) // $curl_handle = curl_init(); $url = "https://feeds.gamepix.com/v1/json?page=$page&pagination=$amount&category=$category"; if (!empty($order)) { $url = "https://feeds.gamepix.com/v1/json?page=$page&pagination=$amount&category=$category&order=$order"; } $json_data = file_get_contents($url); // print("\033[21;32m ############# 欢迎使用gamepix系统 ##############\n") // Decode JSON into PHP array $response_data = json_decode($json_data, true); // All user data exists in 'data' object $game_data = $response_data['items']; $last_page_url = $response_data['last_page_url']; $xsize = count($game_data); // print("############# 欢迎使用日志系统 ############## " . $xsize . "\n\n"); // $logMessage = "[### 欢迎使用gamepix系统 page:" . $page . " 拉取数量:" . $xsize . " 最后界面:" . $last_page_url . "\n\n" ; // $logFile = "X:\phpstudy_pro\Extensions\Apache2.4.39\logs\your_log_file.log"; // 将日志信息追加到日志文件 // file_put_contents($logFile, $logMessage, FILE_APPEND); foreach ($game_data as $game) { $game_name = mysqli_real_escape_string($con, $game['title']); $game_desc = mysqli_real_escape_string($con, $game['description']); $game_image_url = mysqli_real_escape_string($con, $game['image']); $game_frame_url = mysqli_real_escape_string($con, $game['url']); $game_category = mysqli_real_escape_string($con, $game['category']); $game_banner_url = mysqli_real_escape_string($con, $game['banner_image']); $game_status = 0; $cate_slug = strtolower($game_category); if (!empty($game_image_url)) { $game_image_url = str_ireplace('?w=105', '?w=512', $game_image_url); } if (!empty($game_banner_url)) { $game_banner_url = str_ireplace('?w=320', '?w=640', $game_banner_url); } $game_dev_type = "html5"; // html5 mobile $game_instructions = ''; $game_tags = ''; $game_sort = random_int(100, 200); $game_played = random_int(500, 2200); // 评分 $game_quality = $game['quality_score']; // $game_quality = round(random_int(80000000, 98000000)/100000000, 8); // 将小数四舍五入到8位小数 // 宽度 $game_width = $game['width']; // 高度 $game_height = $game['height']; $game_orientation = "landscape"; if ($game_height > $game_width) { $game_orientation = "portrait"; } $sql = "INSERT INTO `zon_games`(`game_name`, `game_platform`, `game_dev_type`, `game_description`,`game_instructions`, `game_image_url`, `game_banner_url`, `game_url`, `game_published`, `game_category`, `game_tags`, `game_width`, `game_height`, `game_orientation`, `game_sort`, `game_quality`, `game_status`, `game_played`) VALUES ('$game_name', '$platform', '$game_dev_type','$game_desc','$game_instructions', '$game_image_url', '$game_banner_url', '$game_frame_url', $game_status, '$game_category', '$game_tags', $game_width, $game_height, '$game_orientation', $game_sort, $game_quality, 0, $game_played)"; $cate_sql = "INSERT INTO `zon_category`(`name`, `slug`) VALUES ('$game_category', '$cate_slug')"; $check_game_name = "select * from zon_games where game_name='$game_name'"; if (!empty($game_image_url)) { if (mysqli_num_rows(mysqli_query($con, $check_game_name)) !== 0) { } else { if (mysqli_query($con, $sql)) { } } $check_category_name = "select * from zon_category where name='$game_category'"; if (mysqli_num_rows(mysqli_query($con, $check_category_name)) !== 0) { } else { if ($game_category !== '') { if (mysqli_query($con, $cate_sql)) { $query_run = true; } } } } } @header("location: ../"); } } config.php 0000666 00000000054 15032122743 0006524 0 ustar 00 <?php require_once('../../config.php'); ?>