mirror of
https://github.com/kvazar-network/webapp.git
synced 2025-01-08 22:27:59 +00:00
add cache enabled optional
This commit is contained in:
parent
d60fa45866
commit
5de0a77ccc
@ -9,6 +9,7 @@ error_reporting(E_ALL);
|
||||
define('BASE_URL', 'https://kvazar.today');
|
||||
define('PAGE_LIMIT', 10);
|
||||
define('SEF_MODE', true);
|
||||
define('CACHE_ENABLED', false);
|
||||
|
||||
// Database
|
||||
define('DB_HOST', 'localhost');
|
||||
|
@ -1,19 +1,29 @@
|
||||
<?php
|
||||
|
||||
require_once('../config.php');
|
||||
require_once('../library/icon.php');
|
||||
|
||||
if (isset($_GET['hash'])) {
|
||||
|
||||
header("Content-Type: image/jpeg");
|
||||
|
||||
$filename = dirname(__FILE__) . '/../cache/' . $_GET['hash'] . '.jpeg';
|
||||
if (CACHE_ENABLED) {
|
||||
|
||||
if (!file_exists($filename)) {
|
||||
$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 {
|
||||
|
||||
$icon = new Icon();
|
||||
|
||||
file_put_contents($filename, $icon->generateImageResource(md5($_GET['hash']), 60, 60, false));
|
||||
echo $icon->generateImageResource(md5($_GET['hash']), 60, 60, false);
|
||||
}
|
||||
|
||||
echo file_get_contents($filename);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user