kolyan22region Posted October 12, 2015 Report Share Posted October 12, 2015 (edited) Небольшое дополнение для модуля "Документы"Идём в system/modules/doc.php, ищем там следующий код: //################### Скачивание документа с сервера ###################// case "download"; NoAjaxQuery(); $did = intval($_GET['did']); $row = $db->super_query("SELECT duser_id, ddownload_name, dname FROM `".PREFIX."_doc` WHERE did = '{$did}'"); if($row){ $filename = str_replace(array('/', '\\', 'php', 'tpl'), '', $row['ddownload_name']); define('FILE_DIR', "uploads/doc/{$row['duser_id']}/"); include ENGINE_DIR . '/classes/download.php'; $config['files_max_speed'] = 0; $format = end(explode('.', $filename)); $row['dname'] = str_replace('.'.$format, '', $row['dname']).'.'.$format; if(file_exists(FILE_DIR.$filename) AND $filename){ $file = new download(FILE_DIR.$filename, $row['dname'], 1, $config['files_max_speed']); $file->download_file(); } } else header("Location: /index.php"); exit; break; И полностью заменяем его на: //################### Скачивание документа с сервера ###################// case "download"; //NoAjaxQuery(); $did = intval($_GET['did']); $row = $db->super_query("SELECT duser_id, ddownload_name, dname FROM `".PREFIX."_doc` WHERE did = '{$did}'"); $filenam = str_replace(array('/', '\\', 'php', 'tpl'), '', $row['ddownload_name']); $type = end(explode(".", $filenam)); // формат файла if($row){ if($type == "jpg" or $type == "png" or $type == "jpeg" or $type == "gif") { echo <<<HTML <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <link rel="shortcut icon" href="http://senapse.ru/fav.png"> <link media="screen" href="/templates/Default/style/style.css" type="text/css" rel="stylesheet"> <meta name="robots" content="noindex,nofollow"><title>{$row["dname"]}</title> <style> html, body { padding: 0px; margin: 0px; height: 100%; border: none; } .iframe { border: none; } .docs_panel_wrap { height: 45px; } .docs_panel { background: #F1F1F1; position: fixed; width: 100%; height: 45px; -webkit-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); -moz-box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.15); } .can_zoom { max-width: 100%; cursor: -webkit-zoom-in; cursor: -moz-zoom-in; cursor: -zoom-in; } .can_zoom_out { min-width: 100%; cursor: -webkit-zoom-out; cursor: -moz-zoom-out; cursor: -zoom-out; } </style> <script> function saveDoc() { var src = '/index.php?go=doc&act=download&did={$did}&dl=1'; location.replace(src); return false; } function imgZoom(obj) { if (obj.className == 'can_zoom') { obj.className = 'can_zoom_out'; } else { obj.className = 'can_zoom'; window.scroll(0, 0); } } function onload() { var iframe = document.getElementById('iframe'); if (iframe) { if(window.innerWidth) { var h = window.innerHeight; } else { var h = document.body.clientHeight; } iframe.style.height = (h - 45 - 2) +'px'; } } </script> </head> <body onkeydown="if (event.keyCode == 83 && (event.ctrlKey || event.metaKey)) return saveDoc(event);" onload="onload();"> <noindex> <div class="docs_panel_wrap"> <div class="docs_panel"> <div style="padding: 10px 20px;"> <div class="button_div fl_r" style=" margin-top: -3px;"><button onclick="return saveDoc();">Сохранить документ на диск</button></div> <div class="fl_r" style="padding: 6px 10px 0px; color: #888888;"></div> <a style="padding-top: 6px; display: block;" class="fl_l" onclick="return saveDoc();"><b>{$row["dname"]}</b></a> </div> </div> </div><center><img src="/uploads/doc/{$row["duser_id"]}/{$row["ddownload_name"]}" class="can_zoom" onclick="imgZoom(this);"></center> </noindex> </body></html> HTML; if($_GET["dl"] == 1){ $filename = str_replace(array('/', '\\', 'php', 'tpl'), '', $row['ddownload_name']); define('FILE_DIR', "uploads/doc/{$row['duser_id']}/"); include ENGINE_DIR . '/classes/download.php'; $config['files_max_speed'] = 0; $format = end(explode('.', $filename)); $row['dname'] = str_replace('.'.$format, '', $row['dname']).'.'.$format; if(file_exists(FILE_DIR.$filename) AND $filename){ $file = new download(FILE_DIR.$filename, $row['dname'], 1, $config['files_max_speed']); $file->download_file(); } } } else { $filename = str_replace(array('/', '\\', 'php', 'tpl'), '', $row['ddownload_name']); define('FILE_DIR', "uploads/doc/{$row['duser_id']}/"); include ENGINE_DIR . '/classes/download.php'; $config['files_max_speed'] = 0; $format = end(explode('.', $filename)); $row['dname'] = str_replace('.'.$format, '', $row['dname']).'.'.$format; if(file_exists(FILE_DIR.$filename) AND $filename){ $file = new download(FILE_DIR.$filename, $row['dname'], 1, $config['files_max_speed']); $file->download_file(); } } } else { header("Location: /index.php"); } exit; break; Автор Я Edited October 13, 2015 by kolyan22region 5 Quote Link to comment Share on other sites More sharing options...
timbios Posted October 12, 2015 Report Share Posted October 12, 2015 Опять же.. что за оформление без скрина?Это так же как продавать что то на рынке, не имея его при себе...А говоря, что после покупки вы увидите что купили.. Quote Link to comment Share on other sites More sharing options...
kolyan22region Posted October 13, 2015 Author Report Share Posted October 13, 2015 Опять же.. что за оформление без скрина?Это так же как продавать что то на рынке, не имея его при себе...А говоря, что после покупки вы увидите что купили.. Залил скрины 1 Quote Link to comment Share on other sites More sharing options...
timbios Posted October 13, 2015 Report Share Posted October 13, 2015 Залил скрины Воот, так кот лучше))Лови + сики Quote Link to comment Share on other sites More sharing options...
nyagan40 Posted January 19, 2016 Report Share Posted January 19, 2016 сделать бы в модульном окне а не на всё ширину экрана было бы круто !и красиво Quote Link to comment Share on other sites More sharing options...
Василий Posted March 26, 2016 Report Share Posted March 26, 2016 Классная работает . но нельзя сделать чтоб как Вк на стене открывалось ?? Quote Link to comment Share on other sites More sharing options...
kolyan22region Posted March 28, 2016 Author Report Share Posted March 28, 2016 Классная работает . но нельзя сделать чтоб как Вк на стене открывалось ?? Владимир Воронков (Developer Sloopy) сливал этот модуль. По борозди по форуму Quote Link to comment Share on other sites More sharing options...
Василий Posted March 28, 2016 Report Share Posted March 28, 2016 Владимир Воронков (Developer Sloopy) сливал этот модуль. По борозди по форуму Блин не могу найти .. Quote Link to comment Share on other sites More sharing options...
kolyan22region Posted March 29, 2016 Author Report Share Posted March 29, 2016 Блин не могу найти .. http://cmstools.ru/index.php?/topic/160-gif-kak-u-vk/ Quote Link to comment Share on other sites More sharing options...
Василий Posted March 29, 2016 Report Share Posted March 29, 2016 http://cmstools.ru/index.php?/topic/160-gif-kak-u-vk/ спасибо Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.