mirror of
https://github.com/kvazar-network/webapp.git
synced 2025-01-11 15:47:52 +00:00
30 lines
571 B
PHP
Executable File
30 lines
571 B
PHP
Executable File
<?php
|
|
|
|
require_once('../config.php');
|
|
require_once('../library/icon.php');
|
|
|
|
if (isset($_GET['hash'])) {
|
|
|
|
header("Content-Type: image/png");
|
|
|
|
if (CACHE_ENABLED) {
|
|
|
|
$filename = dirname(__FILE__) . '/../cache/' . $_GET['hash'] . '.png';
|
|
|
|
if (!file_exists($filename)) {
|
|
|
|
$icon = new Icon();
|
|
|
|
file_put_contents($filename, $icon->generateImageResource(md5($_GET['hash']), 60, 60, false));
|
|
}
|
|
|
|
echo file_get_contents($filename);
|
|
|
|
} else {
|
|
|
|
$icon = new Icon();
|
|
|
|
echo $icon->generateImageResource(md5($_GET['hash']), 60, 60, false);
|
|
}
|
|
}
|