devtools less hacky

This commit is contained in:
olebeck 2022-09-19 17:10:17 +02:00
parent af0fb3d719
commit bd7fa4620e
2 changed files with 259 additions and 308 deletions

View File

@ -150,7 +150,6 @@ function getIcon(string $file)
return "/img/logo.png"; return "/img/logo.png";
} }
} }
?> ?>
<div class="devtoollist"> <div class="devtoollist">
@ -171,211 +170,171 @@ function getIcon(string $file)
echo "<h1>What are you looking for?</h1>"; echo "<h1>What are you looking for?</h1>";
} }
if($type == "") if($type == "") { ?>
{ <a href="?type=unity" class="devtool" id="unity">
echo'<div class="devtool" id="unity" onclick="open_url(\'?type=unity\')"> <img src="/img/unity_icon.png" width="128" height="128" class="bubble">
<a href="?type=unity" class="image"> <span id="textContent">
<img src="/img/unity_icon.png" width="128" height="128" class="bubble"> PSM Unity
<span id="textContent"> </span>
PSM Unity </a>
</span>
</a>
</div>
<div class="devtool" id="psm" onclick="open_url(\'?type=psm\')"> <a href="?type=psm" class="devtool" id="psm">
<a href="?type=psm" class="image"> <img src="/img/psm_icon.png" width="128" height="128" class="bubble">
<img src="/img/psm_icon.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSM
PSM </span>
</span> </a>
</a>
</div>
<div class="devtool" id="android" onclick="open_url(\'?type=psm-android\')"> <a href="?type=psm-android" class="devtool" id="android" >
<a href="?type=psm-android" class="image"> <img src="/img/androiddev.png" width="128" height="128" class="bubble">
<img src="/img/androiddev.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSM Android
PSM Android </span>
</span> </a>
</a>
</div>
<div class="devtool" id="tools" onclick="open_url(\'?type=psm-tools\')"> <a href="?type=psm-tools" class="devtool" id="tools">
<a href="?type=psm-tools" class="image"> <img src="/img/tools.png" width="128" height="128" class="bubble">
<img src="/img/tools.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Unofficial Tools
Unofficial Tools </span>
</span> </a>
</a> <?php
</div>';
} }
elseif($type == "psm") elseif($type == "psm")
{ {
echo'<div class="devtool" id="psmsdk" onclick="open_url(\'?type=psm-sdk\')"> ?>
<a href="?type=psm-sdk" class="image"> <a href="?type=psm-sdk" class="devtool" id="psmsdk">
<img src="/img/sdk.png" width="128" height="128" class="bubble"> <img src="/img/sdk.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM SDK PSM SDK
</span> </span>
</a> </a>
</div>
<div class="devtool" id="psmruntime" onclick="open_url(\'?type=psm-runtime\')"> <a href="?type=psm-runtime" class="devtool" id="psmruntime">
<a href="?type=psm-runtime" class="image"> <img src="/img/psmruntime.png" width="128" height="128" class="bubble">
<img src="/img/psmruntime.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSM Runtime
PSM Runtime </span>
</span> </a>
</a>
</div>
<div class="devtool" id="psmdev" onclick="open_url(\'?type=psm-dev\')"> <a href="?type=psm-dev" class="devtool" id="psmdev">
<a href="?type=psm-dev" class="image"> <img src="/img/psmdev.png" width="128" height="128" class="bubble">
<img src="/img/psmdev.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Dev Assistant
Dev Assistant </span>
</span> </a>
</a>
</div>
<div class="devtool" id="psdp" onclick="open_url(\'?type=psm-psdp\')"> <a href="?type=psm-psdp" class="devtool" id="psdp">
<a href="?type=psm-psdp" class="image"> <img src="/img/psdp.png" width="128" height="128" class="bubble">
<img src="/img/psdp.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSDP Packages
PSDP Packages </span>
</span> </a>
</a>
</div>
<div class="devtool" id="docs" onclick="open_url(\'?type=psm-docs\')"> <a href="?type=psm-docs" class="devtool" id="docs">
<a href="?type=psm-docs" class="image"> <img src="/img/docs.png" width="128" height="128" class="bubble">
<img src="/img/docs.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Documentation
Documentation </span>
</span> </a>
</a>
</div>
<div class="devtool" id="sources" onclick="open_url(\'?type=psm-sources\')"> <a href="?type=psm-sources" class="devtool" id="sources">
<a href="?type=psm-sources" class="image"> <img src="/img/sources.png" width="128" height="128" class="bubble">
<img src="/img/sources.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSM Sources
PSM Sources </span>
</span> </a>
</a>
</div>
<div class="devtool" id="keys" onclick="open_url(\'?type=psm-offical-keys\')"> <a href="?type=psm-offical-keys" class="devtool" id="keys">
<a href="?type=psm-offical-keys" class="image"> <img src="/img/psmda_keys.png" width="128" height="128" class="bubble">
<img src="/img/psmda_keys.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Publisher Keys
Publisher Keys </span>
</span> </a>
</a>
</div>
<a href="?type=psm-drivers" class="devtool" id="drivers">
<div class="devtool" id="drivers" onclick="open_url(\'?type=psm-drivers\')"> <img src="/img/psm-drivers.png" width="128" height="128" class="bubble">
<a href="?type=psm-drivers" class="image"> <span id="textContent">
<img src="/img/psm-drivers.png" width="128" height="128" class="bubble"> PSM Drivers
<span id="textContent"> </span>
PSM Drivers </a>
</span> <?php
</a>
</div>
';
} }
elseif($type == "psm-sources") elseif($type == "psm-sources")
{ {
echo'<div class="devtool" id="monosrc" onclick="open_url(\'?type=psm-mono-src\')"> ?>
<a href="?type=psm-mono-src" class="image"> <a href="?type=psm-mono-src" class="devtool" id="monosrc">
<img src="/img/mono.png" width="128" height="128" class="bubble"> <img src="/img/mono.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
PSM Mono Src PSM Mono Src
</span> </span>
</a> </a>
</div>
<div class="devtool" id="gamessrc" onclick="open_url(\'?type=psm-games-src\')"> <a href="?type=psm-games-src" class="devtool" id="gamessrc">
<a href="?type=psm-games-src" class="image"> <img src="/img/games.png" width="128" height="128" class="bubble">
<img src="/img/games.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSM Games Src
PSM Games Src </span>
</span> </a>
</a> <?php
</div>
';
} }
elseif($type == "unity") elseif($type == "unity")
{ {
echo'<div class="devtool" id="unityexport" onclick="open_url(\'?type=unity-support\')"> ?>
<a href="?type=unity-support" class="image"> <a href="?type=unity-support" class="devtool" id="unityexport">
<img src="/img/export.png" width="128" height="128" class="bubble"> <img src="/img/export.png" width="128" height="128" class="bubble">
<span id="textContent"> <span id="textContent">
Unity Exports Unity Exports
</span> </span>
</a> </a>
</div>
<div class="devtool" id="unitydev" onclick="open_url(\'?type=unity-dev\')"> <a href="?type=unity-dev" class="devtool" id="unitydev">
<a href="?type=unity-dev" class="image"> <img src="/img/unitydev.png" width="128" height="128" class="bubble">
<img src="/img/unitydev.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Dev Assistant
Dev Assistant </span>
</span> </a>
</a>
</div>
<div class="devtool" id="unitydocs" onclick="open_url(\'?type=unity-docs\')"> <a href="?type=unity-docs" class="devtool" id="unitydocs">
<a href="?type=unity-docs" class="image"> <img src="/img/docs.png" width="128" height="128" class="bubble">
<img src="/img/docs.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Documentation
Documentation </span>
</span> </a>
</a>
</div>
<div class="devtool" id="unityassets" onclick="open_url(\'?type=unity-assets\')"> <a href="?type=unity-assets" class="devtool" id="unityassets">
<a href="?type=unity-assets" class="image"> <img src="/img/psm-drivers.png" width="128" height="128" class="bubble">
<img src="/img/psm-drivers.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Assets
Assets </span>
</span> </a>
</a>
</div>
<div class="devtool" id="unitytools" onclick="open_url(\'?type=unity-tools\')"> <a href="?type=unity-tools" class="devtool" id="unitytools">
<a href="?type=unity-tools" class="image"> <img src="/img/tools.png" width="128" height="128" class="bubble">
<img src="/img/tools.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> Tools for Unity
Tools for Unity </span>
</span> </a>
</a>
</div>
<div class="devtool" id="unity-psdp" onclick="open_url(\'?type=unity-psdp\')"> <a href="?type=unity-psdp" class="devtool" id="unity-psdp">
<a href="?type=unity-psdp" class="image"> <img src="/img/psdp.png" width="128" height="128" class="bubble">
<img src="/img/psdp.png" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> PSDP Packages
PSDP Packages </span>
</span> </a>
</a> <?php
</div>
';
} }
else else
{ {
$dirlist = glob($type.'/*'); $dirlist = glob($type.'/*');
foreach ($dirlist as &$path) { foreach ($dirlist as &$path) { ?>
echo '<div class="devtool" onclick="open_url(\''.$path.'\')"> <a href="'.$path.'" class="devtool" title="<?php echo basename($path) ?>">
<a href="'.$path.'" class="image" title="'.basename($path).'"> <img src="<?php echo getIcon($path) ?>" width="128" height="128" class="bubble">
<img src="'.getIcon($path).'" width="128" height="128" class="bubble"> <span id="textContent">
<span id="textContent"> <?php echo getName(pathinfo(basename($path), PATHINFO_FILENAME)) ?>
'.getName(pathinfo(basename($path), PATHINFO_FILENAME)).' </span>
</span> </a>
</a> <?php }
</div>';
}
} }
?> ?>
</div> </div>

View File

@ -1,126 +1,118 @@
<?php include("common.php"); ?> <?php include("common.php"); ?>
<?php
$title = "";
$description = "";
$image = "";
$url = $_SERVER['REQUEST_URI'];
if(strpos($url, 'libary.php') !== false)
{
if(isset($_GET["game"]))
{
$game = htmlspecialchars($_GET["game"], ENT_QUOTES);
$game = str_replace("/", "",$game);
$game = str_replace(".", "",$game);
$game = str_replace("*", "",$game);
$title = getTitle($game);
$title.= " - ";
}
else
{
$title .= "PSM Game Library - ";
}
}
else if(strpos($url, 'devtools.php') !== false)
{
$title .= "PlayStation Mobile Development Tools - ";
if(isset($_GET["type"]))
{
$type = htmlspecialchars($_GET["type"], ENT_QUOTES);
$type = str_replace("/", "",$type);
$type = str_replace(".", "",$type);
$type = str_replace("*", "",$type);
$title .= $type."/ - ";
}
}
$title .= "PSM Reborn";
if(strpos($url, 'libary.php') !== false)
{
if(isset($_GET["game"]))
{
$game = htmlspecialchars($_GET["game"], ENT_QUOTES);
$game = str_replace("/", "",$game);
$game = str_replace(".", "",$game);
$game = str_replace("*", "",$game);
$title = getTitle($game);
$description = $title . " - ";
$description .= getDesc($game);
$description .= " - PSMReborn #1 place for all PSM Content";
$image .= 'http://'.$_SERVER['HTTP_HOST'].'/gameinfo/'.$game.'/icon_512x512.png';
}
else
{
$description .= "PlayStation Mobile Game/App Library - PSMReborn #1 place for all PSM Content";
}
}
else if(strpos($url, 'devtools.php') !== false)
{
$description .= "PlayStation Mobile Development Tools";
if(isset($_GET["type"]))
{
$type = htmlspecialchars($_GET["type"], ENT_QUOTES);
$type = str_replace("/", "",$type);
$type = str_replace(".", "",$type);
$type = str_replace("*", "",$type);
$description .= " - ".$type."/";
}
$description .= " - PSMReborn #1 place for all PSM Content";
}
else
{
$description = "PSMReborn is the largest archive of PlayStation Mobile content on the internet containing Games, SDK's, Source Code, and Unity for PSM exporters.";
}
$descsocial = str_replace("<BR>", PHP_EOL, $description);
$descsocial = str_replace("<bR>", PHP_EOL, $descsocial);
$descsocial = str_replace("<Br>", PHP_EOL, $descsocial);
$descsocial = str_replace("<br>", PHP_EOL, $descsocial);
$descsocial = str_replace('"', '', $descsocial);
$descsocial = str_replace("'", "", $descsocial);
/*
* Default Image
*/
if($image == "")
{
$image .= 'http://'.$_SERVER['HTTP_HOST'].'/img/logo.png';
}
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
<script src="common.js"></script> <script src="common.js"></script>
<?php
$title = "";
$description = "";
$image = "";
$url = $_SERVER['REQUEST_URI']; <title><?php echo $title ?></title>
if(strpos($url, 'libary.php') !== false)
{
if(isset($_GET["game"]))
{
$game = htmlspecialchars($_GET["game"], ENT_QUOTES);
$game = str_replace("/", "",$game); <meta charset="utf-8">
$game = str_replace(".", "",$game); <meta name="robots" content="all">
$game = str_replace("*", "",$game); <meta name="viewport" content="width=1000; user-scalable=0;"/>
<meta name="Description" content="<?php echo $descsocial?>"/>
$title = getTitle($game); <meta property="og:image" content="<?php echo $image ?>"/>
$title.= " - "; <meta property="og:title" content="<?php echo $title ?>"/>
} <meta property="og:description" content="<?php echo $descsocial ?>"/>
else
{
$title .= "PSM Game Library - ";
}
}
else if(strpos($url, 'devtools.php') !== false)
{
$title .= "PlayStation Mobile Development Tools - ";
if(isset($_GET["type"]))
{
$type = htmlspecialchars($_GET["type"], ENT_QUOTES);
$type = str_replace("/", "",$type);
$type = str_replace(".", "",$type);
$type = str_replace("*", "",$type);
$title .= $type."/ - ";
}
} <meta property="twitter:image" content="<?php echo $image ?>"/>
<meta property="twitter:title" content="<?php echo $title ?>"/>
$title .= "PSM Reborn"; <meta property="twitter:description" content="<?php echo $descsocial ?>"/>
/*
* Write title
*/
echo("<title>".$title."</title>\n");
if(strpos($url, 'libary.php') !== false)
{
if(isset($_GET["game"]))
{
$game = htmlspecialchars($_GET["game"], ENT_QUOTES);
$game = str_replace("/", "",$game);
$game = str_replace(".", "",$game);
$game = str_replace("*", "",$game);
$title = getTitle($game);
$description = $title . " - ";
$description .= getDesc($game);
$description .= " - PSMReborn #1 place for all PSM Content";
$image .= 'http://'.$_SERVER['HTTP_HOST'].'/gameinfo/'.$game.'/icon_512x512.png';
}
else
{
$description .= "PlayStation Mobile Game/App Library - PSMReborn #1 place for all PSM Content";
}
}
else if(strpos($url, 'devtools.php') !== false)
{
$description .= "PlayStation Mobile Development Tools";
if(isset($_GET["type"]))
{
$type = htmlspecialchars($_GET["type"], ENT_QUOTES);
$type = str_replace("/", "",$type);
$type = str_replace(".", "",$type);
$type = str_replace("*", "",$type);
$description .= " - ".$type."/";
}
$description .= " - PSMReborn #1 place for all PSM Content";
}
else
{
$description = "PSMReborn is the largest archive of PlayStation Mobile content on the internet containing Games, SDK's, Source Code, and Unity for PSM exporters.";
}
$descsocial = str_replace("<BR>", PHP_EOL, $description);
$descsocial = str_replace("<bR>", PHP_EOL, $descsocial);
$descsocial = str_replace("<Br>", PHP_EOL, $descsocial);
$descsocial = str_replace("<br>", PHP_EOL, $descsocial);
$descsocial = str_replace('"', '', $descsocial);
$descsocial = str_replace("'", "", $descsocial);
/*
* Write metadata
*/
echo('<meta charset="utf-8">');
echo('<meta name="robots" content="all">');
echo('<meta name="viewport" content="width=1000; user-scalable=0;"/>');
echo('<meta name="Description" content="'.$descsocial.'"/>');
/*
* Default Image
*/
if($image == "")
{
$image .= 'http://'.$_SERVER['HTTP_HOST'].'/img/logo.png';
}
/*
* Social Media
*/
echo('<meta property="og:image" content="'.$image.'"/>');
echo('<meta property="og:title" content="'.$title.'"/>');
echo('<meta property="og:description" content="'.$descsocial.'"/>');
echo('<meta property="twitter:image" content="'.$image.'"/>');
echo('<meta property="twitter:title" content="'.$title.'"/>');
echo('<meta property="twitter:description" content="'.$descsocial.'"/>');
?>
</head> </head>
<body> <body>
<div class="header"> <div class="header">