Файл: modules/albums/get_file.php
Строк: 30
<?php
/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) 2013, Taras Chornyi, Sergiy Mazurenko, Ivan Kotliar
* @link http://perf-engine.net
* @package PerfEngine
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
$file_id = abs(intval($_GET['id']));
if(isset($_GET['id']) && $db->query("SELECT * FROM `albums_photo` WHERE `id` = '". $file_id ."'")->rowCount() !=0)
{
$afile = $db->query("SELECT * FROM `albums_photo` WHERE `id` = '". $file_id ."'")->fetch();
$db->query("UPDATE `albums_photo` SET `dl_times` = '". ($afile['dl_times']+1) ."' WHERE `id` = '". $file_id ."'");
header('location: /files/albums/'.$afile['server_name'].'.'.$afile['ext']);
exit;
}
else
{
header('location: /albums/');
exit;
}
?>