forked from TheGameSpider/TechnicSolder
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move mp.php to functions/mp_latest_recommended.php
- Loading branch information
Showing
2 changed files
with
25 additions
and
28 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
// global $db; | ||
// require_once("db.php"); | ||
// if (!isset($db)){ | ||
// $db=new Db; | ||
// $db->connect(); | ||
// } | ||
|
||
function mp_latest_recommended($db) { | ||
$mp_modpack = $db->query("SELECT latest,recommended FROM modpacks WHERE name = '".$db->sanitize($_GET['name'])."'"); | ||
|
||
if ($mp_modpack && sizeof($mp_modpack)==1) { | ||
$mp_modpack=$mp_modpack[0]; | ||
|
||
// this doesn't appear to be used anywhere?? | ||
// $builds = $db->query("SELECT * FROM `builds` WHERE `modpack` = ".$mp_modpack['id']); | ||
// } else { | ||
// $builds=[]; | ||
} | ||
|
||
// error_log(json_encode($mp_response)); | ||
return json_encode([ | ||
"recommended" => !empty($mp_modpack['recommended']) ? $mp_modpack['recommended'] : null, | ||
"latest" => !empty($mp_modpack['latest']) ? $mp_modpack['latest'] : null]); | ||
} |