Skip to content

Commit

Permalink
Misc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlamin committed Feb 14, 2021
1 parent b2192c8 commit 69bd2df
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions db/creature_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@
$query = "FROM wowdata.creatures ";

if (!empty($_GET['search']['value'])) {
$query .= " WHERE id LIKE :search1 OR name LIKE :search2";
$search = "%" . $_GET['search']['value'] . "%";
if (substr($_GET['search']['value'], 0, 8) == "addedin:"){
$searchBuild = str_replace("addedin:", "", $_GET['search']['value']);
if(is_numeric($searchBuild)){
$query .= " WHERE firstseenbuild = " . $searchBuild;
}
} else {
$query .= " WHERE id LIKE :search1 OR name LIKE :search2";
$search = "%" . $_GET['search']['value'] . "%";
}

}

$orderby = '';
Expand Down
2 changes: 1 addition & 1 deletion dbc/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ function fkDBResults(splitFK, results, searchVal) {
});

resultsHTML += "</tr></thead><tbody></tbody>";
var externalResultURL = "/dbc/?dbc=" + splitFK[0].toLowerCase() + "&build=9.0.2.36086#page=1&colFilter[" +
var externalResultURL = "/dbc/?dbc=" + splitFK[0].toLowerCase() + "&build=" + currentParams["build"] + "#page=1&colFilter[" +
targetCol + "]=exact:" + encodeURIComponent(searchVal);
resultsHTML += "</table><br><a class='btn btn-sm btn-primary' href='" + externalResultURL +
"' target='_BLANK'>View " + splitFK[0] + "::" + splitFK[1] + " results in new tab</a></div>";
Expand Down
4 changes: 2 additions & 2 deletions files/scripts/filedata_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@


if ($er['active'] == 1) {
echo "<tr><td>Encrypted with " . $keyAvailable . " key <span class='hash'>" . $er['keyname'] . " (" . $er['id'] . ")</span> </td><td>" . $er['description'] . "</td></tr>";
echo "<tr><td>Encrypted with " . $keyAvailable . " key <span class='hash'><a target='_BLANK' href='https://wow.tools/files/#search=encrypted%3A" . $er['keyname'] . "'>". $er['keyname'] . "</a> (" . $er['id'] . ")</span> </td><td>" . $er['description'] . "</td></tr>";
} else {
echo "<tr><td>Used to be encrypted with " . $keyAvailable . " key <span class='hash'>" . $er['keyname'] . " (" . $er['id'] . ")</span></td><td>" . $er['description'] . "</td></tr>";
echo "<tr><td>Used to be encrypted with " . $keyAvailable . " key <span class='hash'><a target='_BLANK' href='https://wow.tools/files/#search=encrypted%3A" . $er['keyname'] . "'>". $er['keyname'] . "</a> (" . $er['id'] . ")</span></td><td>" . $er['description'] . "</td></tr>";
}
}
echo "<tr><td colspan='2'><b>Known versions</b></td></tr>";
Expand Down
2 changes: 1 addition & 1 deletion mv/modelviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function loadModel(type, filedataid, buildconfig, cdnconfig){
updateURLs();

if (!embeddedMode){
history.pushState({id: 'modelviewer'}, 'Model Viewer', 'https://wow.tools/mv/?buildconfig=' + Current.buildConfig + '&cdnconfig=' + Current.cdnConfig + '&filedataid=' + Current.fileDataID + '&type=' + Current.type);
history.pushState({id: 'modelviewer'}, 'Model Viewer', '/mv/?buildconfig=' + Current.buildConfig + '&cdnconfig=' + Current.cdnConfig + '&filedataid=' + Current.fileDataID + '&type=' + Current.type);
}

$("#js-controls").addClass("closed");
Expand Down

0 comments on commit 69bd2df

Please sign in to comment.