Пример #1
0
<?php

/**
 * Display Edit Form for Downloads
 *
 * @package   LM_Downloads
 * @since     5.7.19
 * @version   10.5.20 
 */
/**
 * Include Download Module class
 */
$pathToIndex = '../../..';
require_once $pathToIndex . '/modules/downloads/lib/LM_Downloads.php';
$app = new LM_Downloads();
$app->getModuleLanguage('downloads');
$sessionState = $app->getSessionState();
$config = $app->getConfigArray();
if ($sessionState == 'on') {
    if (isset($_GET['id'])) {
        $id = $_GET['id'];
        $sql = 'SELECT * FROM ' . DOWNLOADS_META_TABLE . " WHERE id = {$id}";
        $res = $app->db->query($sql);
        if ($item = $res->fetch()) {
            $item['id'] = $item['id'];
            $item['time'] = $app->setDateArray($item['file_date']);
            $item['title'] = stripslashes(htmlspecialchars($item['file_title']));
            $item['comment'] = stripslashes(htmlspecialchars($item['file_comment']));
            $item['file_type'] = stripslashes($item['file_type']);
            $item['file_name'] = stripslashes($item['file_name']);
            $item['file_size'] = $app->toMegaByte($item['file_size']);