2021-08-07 13:37:01 +03:00
|
|
|
<?php
|
|
|
|
|
2022-05-06 23:55:49 +03:00
|
|
|
require_once('../config.php');
|
2021-08-07 13:37:01 +03:00
|
|
|
require_once('../library/icon.php');
|
|
|
|
|
|
|
|
if (isset($_GET['hash'])) {
|
|
|
|
|
|
|
|
header("Content-Type: image/jpeg");
|
2022-05-06 22:45:46 +03:00
|
|
|
|
2022-05-06 23:55:49 +03:00
|
|
|
if (CACHE_ENABLED) {
|
2022-05-06 22:45:46 +03:00
|
|
|
|
2022-05-06 23:55:49 +03:00
|
|
|
$filename = dirname(__FILE__) . '/../cache/' . $_GET['hash'] . '.jpeg';
|
|
|
|
|
|
|
|
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 {
|
2022-05-06 22:45:46 +03:00
|
|
|
|
|
|
|
$icon = new Icon();
|
|
|
|
|
2022-05-06 23:55:49 +03:00
|
|
|
echo $icon->generateImageResource(md5($_GET['hash']), 60, 60, false);
|
2022-05-06 22:45:46 +03:00
|
|
|
}
|
2021-08-07 13:37:01 +03:00
|
|
|
}
|