lineNumbers: true, matchBrackets: true, \tindentUnit: 4, mode: "javascript" }); </script> HTML; } echo <<<HTML <br /><br /><div style="border: solid 1px #BBB;width:99%;height:440px;"><textarea style="width:100%;height:440px;" name="file_text" id="file_text" wrap="off">{$content}</textarea></div> <br /><input onClick="savefile('{$file_path}/{$file_name}')" type="button" class="btn btn-success btn-small" value="{$lang['user_save']}" style="width:100px;"> {$script} HTML; } else { $root = ROOT_DIR . '/templates/'; $_POST['dir'] = clear_url_dir(urldecode($_POST['dir'])); if (file_exists($root . $_POST['dir'])) { $files = scandir($root . $_POST['dir']); natcasesort($files); if (count($files) > 2) { echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">"; // All dirs foreach ($files as $file) { if (file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root . $_POST['dir'] . $file)) { echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>"; } } // All files foreach ($files as $file) { if (file_exists($root . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root . $_POST['dir'] . $file)) { $serverfile_arr = explode(".", $file);
if ($_SERVER['HTTP_HOST'] != $_SERVER['HTTP_REFERER']) { @header('Location: ' . $config['http_home_url']); die("Access denied!!!<br /><br />Please visit <a href=\"{$config['http_home_url']}\">{$config['http_home_url']}</a>"); } } $id = intval($_REQUEST['id']); if ($_REQUEST['area'] == "static") { $row = $db->super_query("SELECT name, onserver FROM " . PREFIX . "_static_files WHERE id ='{$id}'"); } else { $row = $db->super_query("SELECT name, onserver FROM " . PREFIX . "_files WHERE id ='{$id}'"); } if (!$row) { die("Access denied"); } $url = @parse_url($row['onserver']); $file_path = dirname(clear_url_dir($url['path'])); $file_name = pathinfo($url['path']); $file_name = totranslit($file_name['basename'], false); if ($file_path and $file_path != ".") { $file_name = $file_path . "/" . $file_name; } $file = new download(FILE_DIR . $file_name, $row['name'], $config['files_force'], intval($user_group[$member_id['user_group']]['files_max_speed'])); if ($_REQUEST['area'] == "static") { if ($config['files_count'] and !$file->range) { $db->query("UPDATE " . PREFIX . "_static_files SET dcount=dcount+1 WHERE id ='{$id}'"); } } else { if ($config['files_count'] and !$file->range) { $db->query("UPDATE " . PREFIX . "_files SET dcount=dcount+1 WHERE id ='{$id}'"); } }