$url = @parse_url ( $row['onserver'] );
После нее вставить:////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$timer = 5; //обратный отсчет, секунды
$offline_time = 1; //Сколько минут ссылка будет рабочей
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if( !$_GET['hash'] OR !$_SESSION['download_timer'] OR $_GET['hash'] != md5( $id . $row['onserver'] . $_SESSION['download_timer'] ) OR $_SESSION['download_timer'] > time() OR $_SESSION['download_timer'] + $offline_time*60 < time() )
{
$_SESSION['download_timer'] = time() + $timer;
$cat_info = get_vars( "category" );
if( ! is_array( $cat_info ) ) {
$cat_info = array ();
$db->query( "SELECT * FROM " . PREFIX . "_category ORDER BY posi ASC" );
while ( $row = $db->get_row() ) $cat_info[$row['id']] = array_map("stripslashes",$row);
set_vars( "category", $cat_info );
$db->free();
}
$tpl = file_get_contents( ROOT_DIR . "/templates/{$config['skin']}/downpage.tpl" );
$row['category'] = intval( $row['category'] );
$tpl = str_ireplace( "{category}", $cat_info[$row['category']]['name'], $tpl );
$tpl = str_ireplace( "{category-link}", $config['http_home_url'] . get_url( $row['category'] ) . "/", $tpl );
$tpl = str_ireplace( "{author}", "<a href=\"" . $config['http_home_url'] . "user/" . urlencode( $row['author'] ) . "/" . "\">" . $row['author'] . "</a>", $tpl );
$tpl = str_ireplace( "{title}", stripslashes( $row['title'] ), $tpl );
if( $row['category'] and $config['seo_type'] == 2 ) $full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['news_id'] . "-" . $row['alt_name'] . ".html";
else $full_link = $config['http_home_url'] . $row['news_id'] . "-" . $row['alt_name'] . ".html";
$tpl = str_ireplace( "{full_link}", $full_link, $tpl );
$tpl = str_ireplace( "{filename}", stripslashes( $row['name'] ), $tpl );
$tpl = str_ireplace( "{size}", formatsize( @filesize( ROOT_DIR . '/uploads/files/' . $row['onserver'] ) ), $tpl );
$tpl = str_ireplace( "{date}", date( "d.m.Y, H:i", $row['date'] ), $tpl );
$tpl = str_ireplace( "{count}", $row['dcount'], $tpl );
$tpl = str_ireplace( "{timer}", $timer, $tpl );
$tpl = str_ireplace( "{downlink}", "/engine/download.php?id=$id&hash=" . md5( $id . $row['onserver'] . $_SESSION['download_timer'] ), $tpl );
$tpl = str_ireplace( "{charset}", $config['charset'], $tpl );
$tpl = str_ireplace( "{THEME}", $config['http_home_url'] . 'templates/' . $config['skin'], $tpl );
echo $tpl;
die();
}else $_SESSION['download_timer'] = time();
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Найти строку:$row = $db->super_query ( "SELECT name, onserver FROM " . PREFIX . "_files WHERE id ='{$id}'" );
Заменить на:$row = $db->super_query ( "SELECT f.*, p.title, p.category, p.alt_name FROM " . PREFIX . "_files f LEFT JOIN ".PREFIX."_post p ON p.id=f.news_id WHERE f.id = $id" );
Установка завершена!Отличный модуль интернет магазина для DLE 11.0-13.0. Kylshop - это такой себе небольшой модуль для продажи цифровых товаров на
Отличный модуль скачивание на отдельной странице для DLE 11.0-13.1 на ваш сайт на движке DataLife Engine. Downpage - модуль для
« Апрель 2024 » | ||||||
---|---|---|---|---|---|---|
Пн | Вт | Ср | Чт | Пт | Сб | Вс |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Комментарии
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.