This is a web app project for GameBanana which displays on user profiles as a custom module. It shows a favorite game including total hours on record from your Steam profile. It uses the built-in CustomConfig API to store user data directly on GameBanana, and the GetOwnedGames method from the Steam Web API to retrieve game data.
- Go to the app page and click "Install App".
- Add the module in your Profile WYSIWYG Editor, or include
<?= $d["_aThirdPartyModules"]["_sFavoriteGame"] ?>
in your Profile Template. - If using Steam features, set your Steam profile and games library to public.
Set CORS-related HTTP headers to allow GET requests.
Access-Control-Allow-Origin "https://gamebanana.com"
Access-Control-Allow-Methods "GET"
Access-Control-Allow-Headers "Content-Type"
In module.php
set your own domain for the absolute path to steam-api-handler.php
, it must be used because the app is embedded directly into GameBanana.
function getSteamData(steamId64, appId, displayHours) {
return fetch("https://lebdan.zumesite.com/favorite-game/steam-api-handler.php
In steam-api-handler.php
set the include to the corresponding file with your API key.
require_once("/home2/lebdanzu/config/config.php"); //STEAM_API_KEY
The API key is declared in config.php
.
<?php
const STEAM_API_KEY = "00000000000000000000000000000000";
?>
The name and preview banner are displayed with a similar design to the favorite game showcase on Steam profiles. Hours played are optional and will be visible if you've linked with a Steam ID.
Detailed control panel accessible with a button that's only displayed for the profile owner.