Файловый менеджер - Редактировать - C:/wwwroot/theladygames.com/admin/functions/api.php
�азад
<?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); // print("############# 欢迎使用日志系统 ############## " . $xsize . "\n\n"); 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_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); // print("############# 欢迎使用日志系统 " . $key . " " .$game_width . " " . $game_height . " " . $game_played . " " . $game_name . "\n\n"); $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')"; // print("XXX:" . $sql); $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 (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_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['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 = ''; 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 = 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']; $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: ../"); } } 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']; 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: ../"); } }
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Генераци� �траницы: 0.01 |
proxy
|
phpinfo
|
�а�тройка